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

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Themes & Styling

Use images instead of icons in

Started by Christoph 8 years ago · 4 replies · 1622 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 Pedro M, 2 months ago
4 193 2 months ago
Themes & Styling · by Ian, 2 months ago
3 91 2 months ago
Themes & Styling · by Norbert, 2 years ago
11 451 3 months ago
Themes & Styling · by Lukáš Findeis, 3 months ago
0 45 3 months ago
Themes & Styling · by Sebadamus, 4 months ago
5 125 3 months ago