Zikula: A Flexible Open Source Content Management System
home | forum | contact us

Dizkus

Bottom
Break down of 'main' templates...
  • Posted: 27.06.2007, 22:33
     
    AmmoDump
    rank:
    Professional Professional
    registered:
     December 2003
    Status:
    online
    Posts:
    2975
    Is there a reason (performance, perhaps) that no one seems to make the templates so they are even more broken down.

    master_header
    master_footer
    master_logo_area
    master_breadcrumbs
    ect.

    if needed...
    admin_breadcrubms
    ect.

    I mean for most templating editing X amount of templates for every time I need to add metadata to the head is annoying. Same with adjusting redundant areas of all the templates: adding a link to the breadcrumbs... ect....





    --
    David Pahl
    Zikula Support Team
  • Posted: 27.06.2007, 23:00
     
    nestormateo
    rank:
    Professional Professional
    registered:
     September 2006
    Status:
    offline
    last visit:
    21.11.08
    Posts:
    1450
    personally i use fragments, and prevent to have this problem!
    i have: MyTheme/pntemplates/includes/*tpl
    header.tpl
    navigation.tpl
    layout.home.tpl
    layout-admin.tpl
    ...
    layout-nocolumns.tpl
    footer.tpl

    and include that from each module template...

    If you want i can share you one of my themes in 0.764
    or an alpha theme to 0.8

    --
    - Mateo T. -
    Mis principios... son mis fines
  • Posted: 27.06.2007, 23:24
     
    AmmoDump
    rank:
    Professional Professional
    registered:
     December 2003
    Status:
    online
    Posts:
    2975
    Oh, I was more curious about why noone seems to do it.. performance or whatever? I am sure I could easily create the templates.. but I would like to check out your .764.. template. I always like to get ideas from others. I was never really a problem before but I am currently working on a site with a complex navbar, and I keep having to adjuct multiple templates.(annoying).

    BTW. I tried out your gmail xpertmailer thing. Worked great-first try!

    --
    David Pahl
    Zikula Support Team
  • Posted: 27.06.2007, 23:40
     
    Wendell
    rank:
    Professional Professional
    registered:
     February 2004
    Status:
    offline
    last visit:
    01.11.08
    Posts:
    1037
    I agree, that is much easier. I have just started this practice myself.


    Code

    <!--[include file="header.htm"]-->



    Note that even the templates in the templates/modules/ folder do not need to indicate the actual folder that the include files are in. What I mean is that you don't have to use ../header.htm in those templates, it knows automatically to look in the main templates folder.



    edited by: Wendell, Jun 27, 2007 - 10:42 AM

    --
    DWX Logo
  • Posted: 28.06.2007, 01:05
     
    nestormateo
    rank:
    Professional Professional
    registered:
     September 2006
    Status:
    offline
    last visit:
    21.11.08
    Posts:
    1450
    IMO, the discussion is needed.
    Fragmenting the template affects significantly the performance?

    Well, i was des-measured in my first steps with my themes.
    A lot of templates for all and a lot of CSS!
    With the mail of Steffen with the "14 rules for faster-loading pages" of Yahoo developers, i entered to reflect more about it...

    Now, i'm improving my themes reducing the templates used and the CSS too.

    This theme that now i share to yours is the one that i've use to www.redlar.org and it haven't sufficients modifications but is the structure, plugins ans CSS management the idea.

    I'm thinking that isn't bad to fragmentate. Compared with complex modules that include a lot of fragments too fetch'ed for pnRender it's a small part the theme responsability in the performance.

    Here is one of my themes: Redlar.org theme
    I hope comments and critics to this, to improve together a good technique to modularize the themes too.

    See ya later!

    --
    - Mateo T. -
    Mis principios... son mis fines
  • Posted: 28.06.2007, 01:41
     
    AmmoDump
    rank:
    Professional Professional
    registered:
     December 2003
    Status:
    online
    Posts:
    2975
    Nice..

    Wendell is right... for example your home.htm can be changed to:

    Code

    <body onload="hideLoadingPage();">
    <!--[include file="templates/0-loading.html"]-->

    <div id="page-wrap">
    <!--[include file="templates/2-1-header.html"]-->

    <!--[redlar_navcurrent current="index" assign="navcurrent"]-->
    <!--[redlar_navlinks current=$navcurrent ]-->

    <div id="content-wrap">
    <!--[include file="templates/layout-home.html"]-->
    </div><!--[include file="templates/3-bottom.html"]-->


    I also think the header could be striped out and 'included'.


    --
    David Pahl
    Zikula Support Team
  • Posted: 28.06.2007, 01:44
     
    AmmoDump
    rank:
    Professional Professional
    registered:
     December 2003
    Status:
    online
    Posts:
    2975
    Also your ../templates/templates I found a bit confusing.

    I think if we start to move in this direction, some sort of standard should be established. Naming and directory placement... not that the code is hard to follow..

    --
    David Pahl
    Zikula Support Team
  • Posted: 28.06.2007, 01:57
     
    nestormateo
    rank:
    Professional Professional
    registered:
     September 2006
    Status:
    offline
    last visit:
    21.11.08
    Posts:
    1450
    It's true, it not intutitive at all, it have a logic.
    I use a numeration in the filename of the secondary templates, in order of use in the module templates.

    Latest structure that i use is like that:
    MyTheme/pntemplates/includes
    0-loading.tpl (for loading box if desired)
    1-header.tpl
    2-navigation.tpl (now i'm replacing it for a plugin)
    3-layout-X.tpl (different layouts for home, admin, 3-2-1 columns, no-columns, etc.)
    4-bottom.tpl

    You got the idea?
    it's a lot confusing when you go to the folder and found admin, bottom, loading, home, navbar, all listed in disorder, so, i preffer this naming 'code' to best control of the secondary templates...

    tell me what do you think of the rest. plugins, CSS...

    Soon, i can share a 0.8 beta theme with better structure and performance...

    --
    - Mateo T. -
    Mis principios... son mis fines
  • Posted: 28.06.2007, 02:05
     
    AmmoDump
    rank:
    Professional Professional
    registered:
     December 2003
    Status:
    online
    Posts:
    2975
    Oh, no.. I got that part...

    I meant you have two directories named templates...

    --
    David Pahl
    Zikula Support Team
  • Posted: 28.06.2007, 15:04
     
    videokid
    rank:
    Professional Professional
    registered:
     March 2003
    Status:
    offline
    last visit:
    19.11.08
    Posts:
    901
    Very interesting...

    I've done it once and I had to really 'hard code' it

    Code

    <!--[include file="/home/_user/public_html/_site/themes/YExtraLite/templates/footer.htm"]-->


    I thought 'too much hassle' icon_smile

    I guess I'll have to pick it up again...

    - Igor

    --
    Have a nice day
    zikulapro.be is currently running
    Zikula 1.0.2
  • Posted: 28.06.2007, 21:37
     
    Wendell
    rank:
    Professional Professional
    registered:
     February 2004
    Status:
    offline
    last visit:
    01.11.08
    Posts:
    1037
    You know, I am working on a new theme for 0.8 and finding that this practice will no longer be necessary. Why? Because in 0.8 you can use conditional statements to determine if the user is viewing home, admin or user pages. So you end up only needing one master template! :)

    So I guess I will stop doing this even though I just started. ;)



    edited by: Wendell, Jun 28, 2007 - 08:38 AM

    --
    DWX Logo
  • Posted: 28.06.2007, 23:15
     
    nestormateo
    rank:
    Professional Professional
    registered:
     September 2006
    Status:
    offline
    last visit:
    21.11.08
    Posts:
    1450
    That's true Wendell! it's a good point.
    But i think that in complex environments one master template is harder to mantain, and i think that have multiples templates to each module is a good solution for sites that customize some areas...

    If you concentrate all the logic in one template you can have a big problem mantaining and introducing changes to it!

    IMHO, it is necessary to find the balance between modularity and performance, and not to fall in no of the ends:
    * One master template "for best performance and excesive use of logic"
    * A lot of templates "for easy maintain and changes"

    What do you think?
    Let's think and structure a good balance!



    edited by: nestormateo, Jun 28, 2007 - 06:15 PM

    --
    - Mateo T. -
    Mis principios... son mis fines
  • Posted: 28.06.2007, 23:27
     
    Wendell
    rank:
    Professional Professional
    registered:
     February 2004
    Status:
    offline
    last visit:
    01.11.08
    Posts:
    1037

    nestormateo

    IMHO, it is necessary to find the balance between modularity and performance


    I definitely agree with this statement. But if your theme is designed using proper XHTML and CSS, the template should be pretty simple to begin with (in theory) because the styling is all in the CSS.

    I'm not arguing with you, I definitely like the way you think. :) I'm stilling mulling all this over after finding out about page types in 0.8.



    edited by: Wendell, Jun 28, 2007 - 10:28 AM

    --
    DWX Logo
  • Posted: 02.07.2007, 00:16
     
    nestormateo
    rank:
    Professional Professional
    registered:
     September 2006
    Status:
    offline
    last visit:
    21.11.08
    Posts:
    1450
    Well, following with the construction of a good modular and performance(able) structure for the templates, it's time to share my latest 0.764 theme and wait to your opinions!

    Here is Asoinca-theme, a very contextual theme for www.asoinca.org

    Here i propose four templates:
    pntemplates/includes/
    0-head.tpl
    1-header.tpl
    2-layout.tpl
    3-footer.tpl


    I introduced logic into head and layout templates to choose the stylesheet and divs, and mantain the modularity of the pntemplates/modules folder, because sometimes it's needed to introduce very specific chages

    I propose four styles too:
    style/
    global.css (cross browser support)
    layout.css (distribution and appearance)
    misc.css (site-specific styles)
    modsblocks.css (PN modules and blocks)

    I wait your oppinions!

    --
    - Mateo T. -
    Mis principios... son mis fines
  • Posted: 04.07.2007, 19:02
     
    AmmoDump
    rank:
    Professional Professional
    registered:
     December 2003
    Status:
    online
    Posts:
    2975
    I did give it a slight whirl.. very nice...

    I do like the way Wendell handles includes, though. Shorter and nicer.

    I do wonder about following Parent/Child relationships through CSS though. I am not sure the difference between the separate styles is easier to follow than one master sheet, at least to make modifications to (as not the original author). A well applied mater CSS may make the logic easier... I know from personal experience, that following the CSS through multiple sheets can get though at times.

    Over all, though I really like the flow and the ease of use your layout.


    --
    David Pahl
    Zikula Support Team

Main Menu

Extensions Database

Documentation

Development

Login

Donate to Zikula