Welcome Guest, Not a member yet? Register   Sign In
Dynamic Meta - what is the propper way to handle this?
#1

[eluser]Ki[/eluser]
Hi,
I wanted to ask for some expert advice on handling dynamic meta tags.

Scenario:
I have a few pages on my site that load google maps - google maps api is called in the <head> tag. I don't want to load it on all other pages an slow down loading time for users that dont need google maps. Same with javascript, some pages load funky javascript function but others, like help section, dont really need it.

Question
How can I include and exclude the loading of these api/javascript in the meta section (between the <head> tags) to increase the loading time for the pages that dont need these functions?

Current Solution
I have created my main meta tag view called meta_view.php - this one hold the info used on ALL pages, then created meta_maps_view.php that only has the code for loading google maps, then created meta_javascript.php to load only java functions. In building my site, I created a master view, called content_view.php to load site template with same header and footer, and dynamic content gets passed to it through $this->data['content'] = $this->load->view(view_name,TRUE).
But now, that I need to load different meta for different sections, I am forced to create multiple templates view for each meta I need, so I end up with 5-6 versions of content_view.php all loading same header and footer but different meta. Controller determines which container_view to call based on the page.
Seems a bit redundant to re-create multiple containers to load the same header and footer just because I need different meta loaded. Anybody has a better alternative?


Messages In This Thread
Dynamic Meta - what is the propper way to handle this? - by El Forum - 05-24-2009, 04:19 AM
Dynamic Meta - what is the propper way to handle this? - by El Forum - 05-24-2009, 04:41 AM
Dynamic Meta - what is the propper way to handle this? - by El Forum - 05-24-2009, 05:48 AM
Dynamic Meta - what is the propper way to handle this? - by El Forum - 05-24-2009, 06:04 AM
Dynamic Meta - what is the propper way to handle this? - by El Forum - 05-24-2009, 07:31 AM



Theme © iAndrew 2016 - Forum software by © MyBB