Just when I think I have it. :(
I have created a channel for my Site Branding, and a channel field called Site Logo.
Here is my code to pull it through.
{exp:channel:entries channel="site_branding" limit="1"}
{site_logo}
{site_logo:normal}
{/site_logo}
{/exp:channel:entries}
I have an image manipulation setup. Shortname normal set to constrain with width and height set at 96px.
It is displaying the image with width and height of 400px. Which is what the original image I uploaded is set at.
I deployed this same tactic on other elements on the page and they work fine, this has stumped me.
EDIT:
Actually saying that, I just checked the others on the page with the different image manipulation and the width and height are pulling in the same as the big image. So I’m missing something here.
Hmm - I have never done it but you might have to use the image manipulation as the tag pair:
{site_logo:normal} {/site_logo:normal}
But…
While you certainly can store your site branding in a channel and call it dynamically, what are the odds it will ever change?
You’re adding a number of queries to every page load on the off chance that down the road somewhere you (or a client) can load in a new logo.
What I would suggest instead is hardcoding the logo and any other branding elements not likely to change into a Snippet or Embedded template that gets called from all other templates. This way you’d still have just one place to change out the logo file name and the amount of overhead added to each page load would be much less.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.