Hi Folks.
I am trying to sort an issue where I need to add Facebook and Twitter card meta tags depending on channel and page loaded.
Generally for the whole site I have a single master layout file and a main template file for each channel since the info varies greatly enough that one template or layout file for ALL channels just won’t work without a crazy amount of conditionals.
The main layout file is mostly general stuff - declaration, head, body tag, closing scripts (attaching jquery etc). Within the head I include a conditional to load FB and TW metadata if there is a layout:variable present in the loaded channel’s main template.
The FB and Twitter metadata is contained in a partial to load items like description, title etc depending on the loaded page. So this partial includes it’s own set of Channel Entry tags in order to pull in the correct data from the loaded page.
So everything works fine, but I am wondering if I am over-complicating it. My fear here at the moment is to bog down loading time. Does anyone have any thoughts on that?
Thanks!
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.