Skip to content
Grav 2.0 is officially stable. Read the announcement →
Archive

One Page Demo Icons

Started by Muut Archive 11 years ago · 8 replies · 543 views
11 years ago

Hello, I cant seem to determine this from the docs. Where are the icon images being called from on the features page

11 years ago

somethings not clicking here I still cant seem to follow them to the end. Are you talking about user hemes\antimatter emplates\modular?

11 years ago

Yes the antimatter theme loads the font awesome font and those font icons are referenced via the yaml in the page header. Then they are output in the appropriate <i> tag via the twig template.

11 years ago

ah ok makes much more sense now, thanks!

11 years ago

Would it be possible, to use images instead of icons here? I tried to replace the icon: with image: but that didn`t help.

11 years ago

You could but you would also have to tweak the twig file to reference the image correctly. Currently its just inserting the name of the icon in an appropriate <i> tag. Obviously this would have to be changed to an <img> tag for images.

11 years ago

Hello, this is how I did it:

1) uploaded the images to the (new) folder: /grav/user/images/features/

2) added the image condition within antimatter/templates/features.html.twig

TWIG
{% if feature.image %}
<img src="/grav/user/images/features/{{ feature.image }}">
{% endif %}

2) replaced all the "icon" text with "image" within features.md:

YAML

...
    - header: Markdown Syntax
      image: text-height.png
    - header: Twig Templating
      image: code.png
...
---

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1345 9 years ago
Archive · by Muut Archive, 9 years ago
2 933 9 years ago
Archive · by Muut Archive, 9 years ago
2 4060 9 years ago
Archive · by Muut Archive, 9 years ago
1 2945 9 years ago
Archive · by Muut Archive, 9 years ago
3 1117 9 years ago