Message2675
Logged In: YES
user_id=700629
<p>ooops! so i have to escape html here ... an admin please
fix this. sorry for the mess. here's another try:</p>
<p>i happened to want to change the roundup page title from
a <h2> to <h1> (which, by the way, is the natural
structural choice for a page title in HTML. the layout / font
size can be easily changed with CSS). trying to do so in the
classic template, i found this:</p>
<p>page.html (master page macro):</p>
<pre><td class="page-header-top"
metal:define-
slot="body_title"><h2>name</h2><
;/td></pre>
<p>with the body_title slot getting replaced in all the
templates using this macro with something similar to this:</p>
<pre><td class="page-header-top" metal:fill-
slot="body_title">
<h2
tal:content="python:context._classname.capitalize()+'
editing'"></h2>
</td></pre>
<p>this means that to change the <h2> to <h1>, i
have to replace <h2> with <h1> *in all templates
filling the slot*, ie. in 16 files (the <h2> in page.html
gets removed by macro expansion)! beside, all those 16 files
repeat the same markup (<td class="page-header-
top" ...>) - so if i want to change this, i have to do
16 replaces again. not good (style, maintainable) ...</p>
<p>this patch puts the <td class="page-header-
top" ...> and the <h2> (which should be
changed to a <h1> - see above) into page.html and
removes it from the filling templates. to fill a slot without the
html element that defines the fill, i use tal:omit-
tag="python:1" in a defining <span>.</p>
<p>the patch applies with patch -p0 in the
templates/classic/html dir. a similar change should be applied
to the 'minimal' templates (and possibly other slot fills with
duplicate markup).</p> |
|
Date |
User |
Action |
Args |
2009-02-03 14:22:56 | admin | link | issue873502 messages |
2009-02-03 14:22:56 | admin | create | |
|