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.

General

Photographer Theme - Social Icons

Solved by pamtbaau View solution

Started by Nimesh 4 years ago · 5 replies · 573 views
4 years ago

Hello,

I have got a site set up using the Photographer theme and everything looks to be going nicely with it - really loving using Grav.

My issue is that the theme doesn't have any documentation - I'm trying to get the social icons going in the footer but I can't find any settings or anything within any template files to do so. I've scoured the entire of my Grav's backend.

Any help will be appreciated! Thanks.

4 years ago

@njp, Uhh... the socials are already inside the footer aren't they... At least that's what i see in the footer of the demo site.

4 years ago

Yes they are, however I didn't use their skeleton site - and I'm looking through the code files and I can't find the individual entries for me to change - all I can find is some kind of a loop code in a footer file in the 'partial' folder of the theme. The loop code clearly displays the social icons in a line - but I can't find where it gets the info for the socials for me to input (social site, link, icon etc). There are no theme settings to set the socials.

4 years ago Solution

@njp, Template /user/themes/photographer/templates/partials/footer.html.twig lines 6-8 loops through the items from site.socials.

TWIG
{% for item  in site.social %}
   <li><a href="{{ item.url }}"><img src="{{ theme_url }}/img/{{ item.icon }}" alt=""></a></li>
{% endfor %}

Whereby site refers to the config file /user/config/site.yaml and socials to its entry:

YAML
# Social networks usernames (many more available: google-plus, flickr, dribbble, pinterest, instagram, tumblr, linkedin, etc.)
social:
  -  url: "#"
     icon: facebook.png
  -  url: "#"
     icon: gplus.png
  -  url: "#"
     icon: twitter.png
  -  url: "#"
     icon: rss.png    
4 years ago

Aah! Thank you! I did spot this and I did check the site.yaml but there was no 'social' lines in there nor anything commented.

Where did you get this information from on the social addition? I looked everywhere and found nothing!

Thank you so much, just copied and pasted this into the site.yaml, added my links etc and all works a treat!

4 years ago

@njp,

@pamtbaau wrote:

Uhh… the socials are already inside the footer aren’t they… At least that’s what i see in the footer of the demo site .

@njp wrote:

Yes they are, however I didn’t use their skeleton site

Well I did and you could have too.... Especially if you know the demo/skeleton does show socials...

Suggested topics

Topic Participants Replies Views Activity
General · by Jerry Hunt, 4 days ago
2 85 12 hours ago
General · by pamtbaau, 18 hours ago
1 60 17 hours ago
General · by Andy Miller, 1 day ago
0 47 1 day ago
General · by Marcel, 12 months ago
6 350 5 days ago
General · by Duc , 6 days ago
3 44 5 days ago