Loading...
 
Skip to main content

Themes


How to move edit tabs from top to bottom

I am in the process of deriving my own style from the neat.css style. I would like to move the "edit remove rename..." tabs at the top of an editable wiki page to the bottom, just like the default2 theme does. How do I do this?

I notice when I change the theme from neat to default2, something is causing the tabs to change from class=tabbut to class=button2, however I can't seem to find how to control this. Any pointers to move the tabs to the bottom of the page would be appreciated.

> I am in the process of deriving my own style from the neat.css style. I would like to move the "edit remove rename..." tabs at the top of an editable wiki page to the bottom, just like the default2 theme does. How do I do this?

You have to modify the tiki.tpl file of your theme. For the edit, remove, etc., links to be below the wiki page content, tiki.tpl should have $mid (which loads the page content) first and the tiki-page_bar.tpl include statement (which loads the links) second. Reversing this order puts the links above the content.

To have links below page content
Copy to clipboard
{include file=$mid} {if $show_page_bar eq 'y'} {include file="tiki-page_bar.tpl"} {/if}


> I notice when I change the theme from neat to default2, something is causing the tabs to change from class=tabbut to class=button2, however I can't seem to find how to control this. Any pointers to move the tabs to the bottom of the page would be appreciated.

That something is the fact that different template files are being used by the two themes. Default2 uses the default templates, but neat has its own versions in some cases. Selector classes are mainly specified in templates, so it's normal that Default2 might indicate one class for these links and Neat might indicate another.

Classes of divs, links, etc, are generally specified in the template the theme is using. The default templates are in the templates directory. Sometimes a theme, like neat, has its own version of a particular template if the style sheet alone isn't sufficient to enable a layout change. In that case, the file would be in the templates/styles/(theme_name) directory.

Neat has its own version of the tiki.tpl template, whereas default2 uses the default tiki.tpl file. This is how neat gets its link tabs above the page content. Its tiki.tpl file has been modified to produce that.

The normal procedure to make a new Tiki theme, if it involves new template versions, is to add a directory in the templates/styles directory with the new theme's name, where its .tpl versions will go. These will be selected for use rather than the default .tpls when the theme is used. Of course this directory name is the same as the theme's stylesheet file (templates/styles/neat and neat.css, for example). Look at the directory organization of themes and styles if you're not sure about it.

-- Gary - themes.tw.oQuestion

> Sometimes a theme, like neat, has its own version of a particular template if the style sheet alone isn't sufficient to enable a layout change. In that case, the file would be in the templates/styles/(theme_name) directory.
>

Thanks... I got the edit tabs moved to where I want. One glitch I ran into however is that although I had created a 'neat-admin' theme from 'neat' (carefully copying the template/style files to templates/styles/neat-admin), I had to modify the tiki.tpl file in the templates/styles/neat directory, not the templates/styles/neat-admin directory as I would have expected... and yes, the theme showing in the Admin panel under (web site)>Administration>GeneralPreferences is indeed 'neat-admin'. Very strange - may be a bug somewhere. Outside of that, it's working with the suggestions you provided. Thanks!

At one time I was told not to use hyphens in Tiki theme names, and in fact I got fatal errors when I tried to. But that was quite a few versions ago and now there are bundled themes like olive-red.css, so I assumed the coding had changed and hyphens in names became OK. But if you couldn't get your neat-admin theme to work right without editing neat/tiki.tpl, then maybe there is a bug or something in there somewhere. The design is that themes' files are what are edited to have an effect, not files in other themes' directories. 😉

-- Gary