Forums / Setup & design / Specific titles and keywords for each news entry

Specific titles and keywords for each news entry

Author Message

Gert

Friday 21 November 2008 3:43:57 am

Hi,

I'd like to use special text fields for title and keywords that should later, when the entry is viewed, appear in the html-output's <head>-section.

Could anybody please help me and tell me how I could achieve this?

Thanks in advance,

Gert.

canguro web solutions
consulting & development
http://www.canguro.at

Tero Auralinna

Friday 21 November 2008 5:37:36 am

I have done custom title with code below. Just replace default title code and add custom title field (identifier should be custom_title) to all classes you want. For keywords add keyword field to classes and modify template code to display keyword data also.

{def $nv_node = fetch( 'content', 'node', hash( 'node_id', $current_node_id ) )}
{def $site_title = $nv_node.data_map.custom_title.data_text|trim|wash}
{undef $nv_node}

{if $site_title|eq( "" )}
{let name=Path path=$module_result.path reverse_path=array()}
	{section show=is_set($module_result.title_path)}
	{set path=$module_result.title_path}
	{/section}
	
	{section loop=$:path}
	{set reverse_path=$:reverse_path|array_prepend($:item)}
	{/section}
	
	{set-block scope=root variable=site_title}
	{section loop=$Path:reverse_path}{$:item.text|wash}{delimiter} - {/delimiter}{/section}
	{/set-block}
{/let}
{/if}

NXC Finland - Open Source solutions, Internet marketing and web analytics
http://www.nxc.fi
http://www.auralinna.fi
http://twitter.com/teroauralinna