Page-specific head nugget???

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
Don Chambers
Regular
Posts: 3659
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Page-specific head nugget???

Post 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.
=Don=
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Page-specific head nugget???

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Don Chambers
Regular
Posts: 3659
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Post 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?
=Don=
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply