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

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 30 2025 21:45:57
Script start
Timing: Jan 30 2025 21:45:57
Module start 'layout'
Timing: Jan 30 2025 21:45:57
Module start 'content'
Timing: Jan 30 2025 21:45:57
Module end 'content'
Timing: Jan 30 2025 21:45:57
Script end

Main resources:

Total runtime0.0211 sec
Peak memory usage4,096.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0043 588.2813151.2266
Module start 'layout' 0.00430.0032 739.5078220.7188
Module start 'content' 0.00750.0120 960.2266997.7578
Module end 'content' 0.01950.0015 1,957.984429.9922
Script end 0.0210  1,987.9766 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002311.0689140.0002
Check MTime0.00104.8985140.0001
Mysql Total
Database connection0.00073.189910.0007
Mysqli_queries0.002210.473730.0007
Looping result0.00000.047510.0000
Template Total0.00104.910.0010
Template load0.00083.877810.0008
Template processing0.00021.038810.0002
Override
Cache load0.00062.624110.0006
General
dbfile0.00031.403180.0000
String conversion0.00000.027240.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs