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

I need help with the Photographer theme frontpage

Solved by Merijn Rutgers View solution

Started by Merijn Rutgers 9 years ago · 6 replies · 939 views
9 years ago

Hi there!
First, I love grav, it is great! But I need some help.
In the Photographer theme, on the frontpage [https://demo.getgrav.org/photographer-skeleton/] you can see 3 boxes:
Woman, men and children. I can not for the life of me figure out where to change the destination of the link for each section.
I am using the admin plugin so I am editing the pages from within said plugin.
When I go to edit the Categories page in Expert mode you see something like:

YAML
    image: page1_img3.jpg
    class: box3
    title: Children
    title_position: bottom

But the link to the page from -in this case box 3- is not visible in the page, there is no text with linkurl or url. So I do not know where to edit it. I have tried adding linkurl of url but that did not work.
Does anybody have a clue?
Thanks for taking the time to look into this. (edit: some silly word)

9 years ago

You, kind internetperson, are a superhero!

I on the otherhand am confused,

There are 3 boxes that need links and in the location you linked to/specified there is only 1 link that is intended as a general link?

So I am feeling outnumbered! 😅 Am I wrong to think that if I fix this link I will get 3 different boxes all linking to the same place? I was hoping to find a way to create 3 seperate links for the 3 boxes.
if that is what would happen; is there a code example you would be willing to link me to so I can change whatever was needed to create 3 seperate links?

Super happy you have taken the time to reply to me..thank you!!

9 years ago

You have seen that this is inside a loop? Configure your categories like this.

YAML
-
  image: page1_img3.jpg
  class: box3
  title: Children
  title_position: bottom
  linkUrl: YOUR_DESIRED_TARGET_URL

and change the Line 8 in the template to

TWIG
<a href="{{ category.linkUrl }}">

aaaaand please mark this topic as solved. ;-)

6 years ago

I have a server with ubuntu 20.04, php 7.3 and grav 1.6.25. Your solution doesn't work with me.
I changed all the file categories.html.twig and I added this line from<a href="#"> to <a href="{{ item.linkurl }}" class="figure">. This is the file without formatt.

<div class="row_2">
<div class="container">
<div class="row">
<ul class="list1">
{% for item in page.header.categories %}
<li class="col-lg-4 col-md-4 col-sm-4">
<div class="{{ item.class }}">
<a href="{{ item.linkurl }}" class="figure">
{% if item.title_position == 'top' %}
<p>{{ item.title }}</p>
{% endif %}
<figure>{{ page.media[item.image] }}</figure>
{% if item.title_position == 'bottom' %}
<p>{{ item.title }}</p>
{% endif %}
</a>
</div>
</li>
{% endfor %}
{{ content }}
</ul>
</div>
</div>
</div>

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