Page 1 of 1

Products module title to page title

Posted: Wed Aug 19, 2015 10:21 am
by pwg
I'm not sure why i'm having a problem with this, as I have it sorted in other modules, but in the Products module I can't seem to set the page title.

I have

Code: Select all

{assign var='alt_title' value=$entry->product_name->value}
towards the top of my Products detail template, and call the title via

Code: Select all

{if isset($alt_title)}
<title>{$alt_title} | {sitename}</title>
{else}
<title>{title} - {sitename}</title>
{/if}
in the Global metadata.

I tried printing the variables but no results. Which I assume means I'm doing something wrong, but wonder, what?

Variations work in news, CGBlog, and Company directory modules,

Wondering if there is anything obvious I'm missing?

Thanks for any help.

Re: Products module title to page title

Posted: Wed Aug 19, 2015 11:58 am
by Rolf
Do you have in your template {content assign='content'} is the top of your template, and in the body content {$content} ?
This way the page/module content passes the Smarty engine and can be re-used

grtz. Rolf

Re: Products module title to page title

Posted: Wed Aug 19, 2015 8:52 pm
by pwg
Hi Rolf, thanks for the reply.

I was using {content assign='capturedcontent'} and {$capturedcontent}, however tried {content assign='content'} / {$content} and the way I do most of my templates, {content assign='main_content'} / {$main_content}, all to no avail.

Could it have something to do with {process_pagedata}?
I have tried with and without, to no success, but it seems I would need to process the page data prior to the head, to use an alt title?

Thanks again for any help - perhaps a small thing, but important for seo.

Cheers,

Paul

Re: Products module title to page title

Posted: Thu Sep 17, 2015 7:38 am
by iturbay
I have a similar problem with the modules cgblog and cgcalendar.
In the module companydirectory all good works. Have you found a solution?

Re: Products module title to page title

Posted: Thu Sep 17, 2015 7:50 am
by pwg
Hi iturbay,

Yes, have a look at: http://forum.cmsmadesimple.org/viewtopi ... =7&t=73344

Calguy was good enough to offer a solution and updating to 1.12.1 a more permanent fix.

Cheers,

Paul

Re: Products module title to page title

Posted: Thu Sep 17, 2015 8:19 am
by iturbay
Thank you so much! Now the problem is solved!