Use News summary within Title, How?

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
sarah_h
Forum Members
Forum Members
Posts: 189
Joined: Tue Apr 25, 2006 8:30 am

Use News summary within Title, How?

Post 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
mw
Forum Members
Forum Members
Posts: 159
Joined: Mon Aug 25, 2008 8:38 pm
Location: Comox Valley, BC, Canada

Re: Use News summary within Title, How?

Post 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
Post Reply

Return to “CMSMS Core”