Theme-specific templates
Sometimes it's necessary, or at least easier, to use a custom template (.tpl file) in a theme than to try to get the desired appearance or element position using the default templates and CSS. This method isn't encouraged, because any template customizing makes updating the site harder.One example of theme-specific variation in template files is how the site-header area of the page is done in Strasa, compared to the other bundled themes. The design has the menu at the top of the page, above the site title and so on, and the log-in form at the bottom of the site header, and so is the opposite of the normal arrangement. We tried to use CSS's relative and absolute positioning to move the menu to that position, but this failed in IE6 and IE7, for various reasons. (For example, IE6 needs the parent div to have its height specified in order to have a child positioned relative to the parent's bottom edge. But giving the Tiki site header a definite height is a bad idea because we want it to accomodate logos of various sizes, custom content, and so on, so it needs to be flexible.)
The solution is to make tiki-site_header.tpl simply a wrapper that contains include files for the header components:
| Standard tiki-site_header.tpl | Strasa's tiki-site_header.tpl |
{include file='tiki-site_header_top.tpl'}
{include file='tiki-top_bar.tpl'}
{include file='tiki-top_bar_custom_code.tpl'} | {include file='tiki-top_bar.tpl'}
{include file='tiki-site_header_top.tpl'}
{include file='tiki-site_header_login.tpl'}
{include file='tiki-top_bar_custom_code.tpl'} |
So Strasa's tiki-site_header.tpl lists the components in a new order (tiki-topbar.tpl at the top), which places them on the page in that order. The actual code in the included files doesn't get modified for the theme; it just gets relocated on the page, so there are no theme-specific code variations to keep in sync with the core code.
Sometimes a template-with-code does get modified for a theme. If this path is chosen, then be sure the modifications are clearly commented, documented and so on, so that when the default files are edited as Tiki advances (and they will be), the theme's modified files can be updated accordingly and so stay compatible with the new Tiki version.
Sidebar
Last forum posts
- Re: Re: Shadow Layer Example, and Theme Layout Schema
- Re: Shadow Layer Example, and Theme Layout Schema
- Re: Shadow Layer Example, and Theme Layout Schema
- Shadow Layer Example, and Theme Layout Schema
- Re: Re: description of a page in tiki-print_multi_pages.tpl
- Re: description of a page in tiki-print_multi_pages.tpl
- description of a page in tiki-print_multi_pages.tpl
- Re: Re: Re: Re: New FiveAlive theme
- Re: Re: Re: New FiveAlive theme
- Re: Re: New FiveAlive theme
Last changes
Site Config
-
Multilingual feature has been activated
Sat 24 of July, 2010 08:40 GMT
-
Menu has changed
Tue 01 of June, 2010 02:12 GMT
-
Transition to Tiki 5
Tue 13 of Apr., 2010 07:01 GMT
-
Configurable header buttons in XtratoVeil layout
Sat 17 of Oct., 2009 12:54 GMT
-
Infinite Carousel problem and workaround
Mon 21 of Sep., 2009 05:55 GMT
-
Various preference changes
Tue 15 of Sep., 2009 07:02 GMT
-
Some changes now that we have Tiki 3 here
Fri 28 of Aug., 2009 16:45 GMT
-
Site updated to Tiki 3
Thu 27 of Aug., 2009 09:52 GMT
-
Turning some stuff on & off
Sat 25 of Oct., 2008 11:30 GMT
-
Menu demos updated
Sat 25 of Oct., 2008 09:46 GMT
Sidebar
Theme: Fivealive
Shoutbox
chibaguy, 05:06 GMT, Wed 08 of Sep., 2010:
Ah, yeah, those were part of the Templatemo package and were just carried forward for no particular reason. I removed them in the Tiki 5 version.
orionrobots, 10:03 GMT, Tue 07 of Sep., 2010:
In greenblog, in hte styles/greenblog folder when I downloaded the tiki4 zip for it.
chibaguy, 05:06 GMT, Mon 06 of Sep., 2010:
sorry, orionrobots, where do you see those images? (Some themes have image files that aren't used by Tiki but were part of the original theme files, but I don't know if this is true in this case.)
orionrobots, 20:54 GMT, Sat 04 of Sep., 2010:
Hmm - those thumb_01 ... thumb_06 images in greenblog don't appear to have any function.. Have I missed something?
orionrobots, 18:23 GMT, Sat 04 of Sep., 2010:
Alternatively, I could consider taking the orionrobots design and adapting it into greenblog... Switching floral for techie stuff... Might work beautifully...
