Page 1 of 1

Use News summary within Title, How?

Posted: Sat Dec 13, 2008 10:20 am
by sarah_h
Hi,

I thought it'd be a good idea to be able to use the news summary within the title tag. I've set up the news to use a different detailtemplate and a detailpage. This detailpage uses a new news_detail page template.

So I thought I could use this within this template

{eval var=$entry->summary}

This page template is only used to display news items but I see a smarty error: missing var parameter. I think I'm missing something fundemental here. I thought that this var would be passed to the page. The url string is passing things correctly because I can see the news article. I'm thinking this is because $entry is not setting?

Can anyone point me in the right direction?

Sarah

Re: Use News summary within Title, How?

Posted: Fri Dec 19, 2008 9:15 pm
by mw
I think you need:

Code: Select all

{assign var='mytitle' value=$entry->title}
then in your head....

Code: Select all

{if isset($mytitle)}<title>{$mytitle}</title>{else}<title>{title} -  {sitename}</title>{/if}
I found that info here (I'm trying to figure this out also):
http://wiki.cmsmadesimple.org/index.php/User_Handbook/Developers_Guide/Smarty_Tips

I am trying to do something similar with the Calendar module:
pull out the $event.event.title and use it on another page but so far no luck