Knowledge Base

How do I use the entry title or other information in my page <title>?

You can easily do this on any of your “single-entry” type Templates (i.e. “comments”). Simply use something like this:

<title>{exp:weblog:entries rdf="off" limit="1"}{title}{/exp:weblog:entries}</title>

Note that you can also use this method to add the content from other fields in addition to just the {title}.  Simply use the same method and put in the field of choice.  To display custom field information:

<title>{exp:weblog:entries rdf="off" limit="1"}{custom_field}{/exp:weblog:entries}</title>

To put date information:

<title>{exp:weblog:entries rdf="off" limit="1"}{entry_date format="%d %m}}{/exp:weblog:entries}</title>

To display categories:

<title>{exp:weblog:entries rdf="off" limit="1"}
{categories backspace
="1"}{category_name},{/categories}
{
/exp:weblog:entries}</title>

Last Updated on Feb 27, 2007 at 10:21   ( Permalink )
Category: Templates, Other