Amending <head> for specific page

Archived from the LCMS Discussion forum.

njw — Tue Nov 11, 2008 1:08 am

Steve

I want to embed some software into one LCMS page. Is there an easy way to add code to the <head> tag for a single page, rather than for all the pages (via Main template)?

Many thanks

Neil


shannah — Wed Nov 12, 2008 11:06 am

You could put an if statement in the main template.

e.g.

Code: Select all
{if $page->val('path') == 'mypath'}Your special content here{/if}

njw — Wed Nov 12, 2008 11:21 am

yet again. My problem is not knowing what the correct variables are! Well, one of them, anyway.

Neil


njw — Thu Nov 13, 2008 11:14 pm

The {if} statements are working i.e. they are selecting the correct page, but I am trying to execute php code and because MainTemplate is a .html, the php code is not executing.

Can I rename the MainTemplate to be a .php or is there a less drastic solution?

Many thanks

Neil