HTML Page Titles of Pages within Target Containers

67 views
Skip to first unread message

TheJonathan

unread,
Mar 10, 2006, 1:24:42 PM3/10/06
to RedDot CMS Users
I problem I've always had with using target containers was getting the
html page title (<title>My title</title>) that lives in the Foundation
page (the page with a target container) to be set to the Headline of
the page within the target container. For example, when I build a news
section, the news stories will be loaded into a target container, but I
want their titles to be the name of the story, not the news section.

I got a great, simple solution from RedDot Support today. Simply use
the Info placeholder with "Content" set to "Page: Site Map Name" then
check the "Use data of page in target container" option. For example,
the Foundation template would have a line like this:

<title><%hdl_SectionTitle%>: <%inf_PageSiteMapNameOfTarget%></title>

"Site Map Name" is always set to the Headline by default if there isn't
one filled in in the Page properties, so this totally works.

Google search will totally love this fix ;-)

Cheers,
Jonathan

Luca Loguercio

unread,
Mar 10, 2006, 2:28:24 PM3/10/06
to RedDot-C...@googlegroups.com
Hey Jonathan,

Another trick we use here with rexecuting code is that in the inner
template we'll define a function called getTitle()

function getTitle ()

getTitle = "<%hdl_headline%>"

end function


and then in the outer template we'll do something like

<%
innerTitle = getTitle()

Response.write("<title>UNICEF - " & innerTitle & "</title>")

%>

since asp will error out if you call an undefined function, i also
like to define the getTitle function in the outer template, setting
getTitle = '' just in case the inner template doesn't have getTitle()
in it.

And i'm just writing the code from memory, so don't quote me on it

- Luca

TheJonathan

unread,
Mar 13, 2006, 8:36:13 AM3/13/06
to RedDot CMS Users
Do you pre-execute those scripts? Our sites are all ASP.NET so we
can't execute VBScript on the client-side, but we pre-execute ASP in
the publisher.

Luca Loguercio

unread,
Mar 13, 2006, 8:59:54 AM3/13/06
to RedDot-C...@googlegroups.com
Yes, sorry for not mentioning that. Both those chunks of code would be inside pre-execute blocks.

- Luca

----------------------
via BlackBerry
.
Reply all
Reply to author
Forward
0 new messages