Roundup Tracker - Issues

Issue 873502

classification
improved body_title slot
Type: Severity: normal
Components: User Interface Versions:
process
Status: closed fixed
:
: richard : ax-, richard
Priority: normal : patch

Created on 2004-01-09 03:40 by ax-, last changed 2004-01-19 22:55 by richard.

Files
File name Uploaded Description Edit Remove
body_title.patch ax-, 2004-01-09 04:07
Messages
msg2674 Author: [hidden] (ax-) Date: 2004-01-09 03:40
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:

page.html (master page macro):

<td class="page-header-top" metal:define-
slot="body_title"><h2>name</h2></td>

with the body_title slot getting replaced in all the 
templates using this macro with something similar to this:

<td class="page-header-top" metal:fill-slot="body_title">
 <h2 tal:content="python:context._classname.capitalize
()+' editing'"></h2>
</td>

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) ...

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>.

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).
msg2675 Author: [hidden] (ax-) Date: 2004-01-09 03:50
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>&lt
;/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>
msg2676 Author: [hidden] (richard) Date: 2004-01-19 22:55
Logged In: YES 
user_id=6405

Applied, thanks. 
History
Date User Action Args
2004-01-09 03:40:48ax-create