Page 1 of 1

Page-specific head nugget???

Posted: Wed Jan 17, 2007 1:28 am
by Don Chambers
I do not think the current Head Nugget plugin supports this, but is there any way to get a page-specific modification to the <head>?

I need one particular function on a static page, but I would not want this function on every s9y page as it would have undesireable results.

Perhaps this should be a feature request for the Static Page plugin or the Head Nugget Plugin????

Right now, I will settle for anything that works.

Re: Page-specific head nugget???

Posted: Wed Jan 17, 2007 8:55 am
by garvinhicking
Hi!

You'll need to make this modification in your themes index.tpl itself, as making PageNuggets specific would be a lot of coding effort.

In index.tpl it's easy. Just go to your <head> section and insert:

Code: Select all

{if $staticpage_pagetitle == 'My staticpage'}
<meta name="desc" content="My staticpage" />
{/if}
Of course, replace the <meta> stuff with the content you actually want/need, and replace "My staticpage" with the title of your static page!

HTH,
Garvin

Posted: Wed Jan 17, 2007 5:34 pm
by Don Chambers
Thanks Garvin

1) rather than modify the index.tpl file (which I have no problem doing) - could I not just use the head nugget plugin for this code as I am already using that plugin?

2) is $staticpage_pagetitle equal to the value of <title>My Page Title</title>, or is it just the value shown in the static page drop down box?

3) what would be the equivalent of this IF statement if the page I wanted to include a page specific piece of code within the <head> for is one of my contact form pages?

Posted: Thu Jan 18, 2007 9:36 am
by garvinhicking
Hi!

1.) You could use that, but then you'd require the "Smarty Markup" event plugin to execute. Else, Smarty instructions will not be parsed inside a nugget by default.
2) is $staticpage_pagetitle equal to the value of <title>My Page Title</title>, or is it just the value shown in the static page drop down box?
For each static page you can enter the title of the page, and that is the value of $staticpage_pagetitle.
3) what would be the equivalent of this IF statement if the page I wanted to include a page specific piece of code within the <head> for is one of my contact form pages?
I believe the variable would be the same, just replaced with the title of your contactform. $staticpage_pagetitle is set by many plugins, so I hope the contact form is one of them.

Regards,
Garvin