Hi there (again),
I would like to add links to the features (with those lovely icons) of the One-Page Skeleton. How could I manage this?
THX in advance
Hi there (again),
I would like to add links to the features (with those lovely icons) of the One-Page Skeleton. How could I manage this?
THX in advance
First you would need to add some links in the yaml frontmatter of the features.md page (using links to valid pages of course):
features:
- header: Markdown Syntax
icon: text-height
link: /features/markdown-syntax
- header: Twig Templating
icon: code
link: /features/twig-templating
- header: Smart Caching
icon: rocket
link: /features/smart-caching
...
Then in your theme's templates/modular/features.html.twig file you would have to read those links and use them (see the link around the feature.header:
<div class="modular-row features {{ page.header.class}}">
{{ content }}
<div class="feature-items">
{% for feature in page.header.features %}
<div class="feature">
{% if feature.icon %}
<i class="fa fa-fw fa-{{ feature.icon }}"></i>
<div class="feature-content icon-offset">
{% else %}
<div class="feature-content">
{% endif %}
{% if feature.header %}
<h4><a href="{{ base_url }},{{ feature.link }}">{{ feature.header }}</a></h4>
{% endif %}
{% if feature.text %}
<p>{{ feature.text }}</p>
{% endif %}
</div>
</div>
{% endfor %}
</div>
</div>
That would then link your title to the page you set. Of course if not everyone had a link you would have to add some logic to test if a link exists first.
Log in to reply.
| Topic | Participants | Replies | Views | Activity |
|---|---|---|---|---|
| 0 | 1327 | 9 years ago | ||
| 2 | 921 | 9 years ago | ||
| 2 | 4050 | 9 years ago | ||
| 1 | 2928 | 9 years ago | ||
| 3 | 1107 | 9 years ago |