Skip to content
● Grav 2.2 is out: 2x faster cold starts and 96% less memory on big sites. Read the announcement →

Use images instead of icons in

Started by Christoph 8 years ago · 4 replies · 1960 views
8 years ago

Hello,
I'm using the deliver theme and I 'd like to set images in a grid instead of the font-awesome icons.
Replacing 'icon' with e.g. 'image' won't work.
https://learn.getgrav.org/content/image-linking only explains how to insert images in markdown.
But the grid content is in frontmatter.

Can you tell me how to solve that?

Here's the frontmattter code for one of the grids:

YAML
header: 'header text'
text: 'main text'
icon: wheelchair
linkurl: contact
linktext: 'link text'
last edited 04/21/18 by Christoph
8 years ago

The variables that are set in the frontmatter are used in the theme templates. Have a look at how the portfolio templates uses images. I'm sure you can apply that to the template which is creating your grid.

8 years ago

I ve found the following code in templates/modular/features.html.twig

TWIG
<div class="feature">
{% if feature.icon %}
<i class="fa fa-fw fa-{{ feature.icon }}"></i>
<div class="feature-content icon-offset">
{% else %}

How can I add the new type 'image'?

last edited 04/25/18 by Christoph
8 years ago

The topic is interesting, but all my efforts didn't work
Either I got an 500 Error or it just didn't show up.

Suggested topics

Topic Participants Replies Views Activity
Themes & Styling · by FrViPofm, 2 weeks ago
4 408 7 days ago
Themes & Styling · by johan thomas, 5 years ago
1 760 2 weeks ago
Themes & Styling · by stuart young, 2 months ago
3 617 2 months ago
Themes & Styling · by Sebadamus, 2 months ago
5 627 2 months ago
Themes & Styling · by martynfoster735, 2 months ago
1 600 2 months ago