Loading...
 
Skip to main content

Features / Usability


Request: add name of page as a class to the body tag

Maybe the tiki developers could add something like the mediawiki does:
it adds the name of the page, namespace or skin as a class to the body tag of each page

the advantage would be that you could change the theme for one single page - would make skinning some "special" pages easier. like removing the left and right columns for some kind of splash page or such things.

otherwise one has to do a dirty workaround like

example
Copy to clipboard
{php} if ($_GET['page'] == "SplashScreen" || $_POST['page'] == "SplashScreen") { echo '< div id="leftcolumn" class="hidden">'; } else { echo '< div id="leftcolumn">'; } {/php}


in the template files

You can change the theme for a single page using Theme Control (tiki-theme_control.php). (Also Smarty syntax is simpler if logic has to be put in the files.)

-- Gary



splash screen would only be one page for example - but there might be some pages in the future where i might have to hide the left sidebar again or have to change something else

and using another theme would not be as good as we would have to maintain two themes instead of one

and would it be that hard to include a class in the body tag in tiki3? it would make it easier to maintain the css file(s) ... while i'm writing of this ... why don't i change the header file myself - just have to figure out how to access the pagename out of smarty without php


ok i changed myself this

old
Copy to clipboard
< body {if isset($section) and $section eq 'wiki page' and $prefs.user_dbl eq 'y' and $dblclickedit eq 'y' and $tiki_p_edit eq 'y'}ondblclick="location.href='tiki-editpage.php?page={$page|escape:"url"}';"{/if} onload="{if $prefs.feature_tabs eq 'y'}tikitabs({if $cookietab neq ''}{$cookietab}{else}1{/if},5);{/if}{if $msgError} javascript:location.hash='msgError'{/if}" {if $section} class="tiki_{$section}"{/if}>


to this:

new
Copy to clipboard
< body {if isset($section) and $section eq 'wiki page' and $prefs.user_dbl eq 'y' and $dblclickedit eq 'y' and $tiki_p_edit eq 'y'}ondblclick="location.href='tiki-editpage.php?page={$page|escape:"url"}';"{/if} onload="{if $prefs.feature_tabs eq 'y'}tikitabs({if $cookietab neq ''}{$cookietab}{else}1{/if},5);{/if}{if $msgError} javascript:location.hash='msgError'{/if}" {if $section} class="tiki_{$section} __page-{$page}__"{/if}>