Page 1 of 1

Help with CGHeadMaster

Posted: Mon May 23, 2016 6:26 pm
by naturelab
I am trying to consolidate / clean up the head section of a few websites by using the CGHeadMaster module.

In a previous website, I used this to create the TITLES

Code: Select all

{capture assign='titledescription'}{title} {if isset($workpage)}- {$year} | {foreach from=$mediatypes item='specifications' name="media"}{$specifications}{if $smarty.foreach.media.last} {else}, {/if}{/foreach}{else} | {sitename}{/if} - {if !isset($workpage)}{global_content name='strap'}{else}{sitename}{/if} {/capture}

{if $page_alias == 'home'}
  <title>{sitename} - {global_content name='strap'}</title>
  {else}
  <title>{$titledescription}</title>
{/if}
Unfortunately this no longer works in CMSMS 2.0.

Before trying to use CGHeadMaster, I tried adding :-

Code: Select all

{$titledescription=$titledescription scope=global}
but this doesn't work

The top of the template looks like this :-

Code: Select all

{strip}
{content assign="capturedcontent"}
{$theme_path = "{uploads_url}/cp/"}
{cms_selflink dir='previous' assign='prev_page'}
{cms_selflink dir='next' assign='next_page'}
{share_data scope=global vars='theme_path,capturedcontent,prev_page,next_page,year' }

{process_pagedata}
{/strip}
I can't seem to capture the {$year} & {$mediatypes} like I did before, so I have decided to use CGHeadMaster instead.

So far, without success :-

In my page template :-
I can't even get this to work

Code: Select all

{if isset($workpage)}
{cghm_config_set key='title' val={$year} }
or
{cghm_config_set key='title' val=$year }
or
{cghm_config_set key='title' val='$year' }
{/if}
Never mind this :-

Code: Select all

{cghm_config_set key='title' val='{title} {if isset($workpage)}- {$year} | {foreach from=$mediatypes item='specifications' name="media"}{$specifications}{if $smarty.foreach.media.last} {else}, {/if}{/foreach}{else} | {sitename}{/if} - {if !isset($workpage)}{global_content name='strap'}{else}{sitename}{/if}'
What am I doing wrong ?