TurboGears2: Overriding meta element on child template.

16 views
Skip to first unread message

Rodney Haynie

unread,
Jul 30, 2009, 6:19:54 PM7/30/09
to turbo...@googlegroups.com
I have a situation where I would like to override the meta description
on particular pages. But on almost all of the rest I would like the
default meta description.

For example, in master.html I have:
<meta name="description" content="This is a really cool site." />

Then on home.html I have:
<meta name="description" content="Something different" />

But when the Home page renders, the source shows both meta elements.

Is there a way to automatically override a specific element on the child
template?

Is it possible without having to have a meta description element on each
template file?

I thought py:replace="''" would have something to do with it, but to no
avail.

Thanks for any help.
-Rodney


Diez B. Roggisch

unread,
Jul 31, 2009, 7:41:27 AM7/31/09
to turbo...@googlegroups.com
Rodney Haynie schrieb:

We currently use something along these lines, not sure if there is a
more elegant solution

master.html

<head>
<title py:if="defined("title")" py:content="title"/>
</head>

home.html

<?python
title = "some title"
?>


Diez

Reply all
Reply to author
Forward
0 new messages