ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Using Fewer Templates

December 03, 2010 5:33pm

Subscribe [5]
  • #1 / Dec 03, 2010 5:33pm

    DesignBloke

    63 posts

    I have three blogs and want to limit the number of templates used. 

    Blog A has a summary section at: http://statebystategardening.com/la/blog_summary/

    Blog A displays the actual article where people can comment on a separate template:
    i.e. http://statebystategardening.com/la/blog/a_wildlife_weekend/

    Can I reuse those same templates for my other two blogs or do they each need their own set of templates. (i.e. one for articles, summary, archives, rss, printer friendly, etc for Blog A, another set for Blog B and a third set for Blog C)

  • #2 / Dec 04, 2010 5:52pm

    Greg Salt

    3988 posts

    Hi DesignBloke,

    Templates can be used for multiple blogs/other content but exactly how this is done is going to depend on exactly how you have set your own individual site up. Although, what is the reason that you want to limit the number of templates? If it’s because of repeating design elements/HTML snippets then you can use embedded templates to alleviate code repetition.

    Cheers

    Greg

  • #3 / Dec 04, 2010 6:32pm

    DesignBloke

    63 posts

    Well, I’m simplifying things to say that I have only three blogs.  Actually there are three blogs for every state in our publication region.  (So over 40 unique blogs)

    What I am doing is using the exact same templates for each state (each state has it’s own template group).  I have a master template group and whenever I do an update I delete the other TGs and then recreate them duplicating the master TG.  Then I just paste in the proper variables at the top of each template to pull the respective content from the EE database and grab the proper images.  (i.e. Pictures are stored in locations such that example.com/images/{my_template_group}/image.jpg will always display the correct image for any state.)

    The main reason I want to have one master blog template is just for ease of updates.  The other blog templates will be exact duplicates of each other with the exception of telling it which blog content and header to use.  I can make things work in EE, but I am always striving to do things in the most efficient manner possible. (I’m not as adept at that)

  • #4 / Dec 06, 2010 3:04am

    John Henry Donovan

    12339 posts

    DesignBloke,

    Do you have authors that update each blog from the control panel?
    I ask this because if it was one author doing them all them you could just have the states as categories and only have one weblog and one template group to show all.

    http://statebystategardening.com/la/blog/state/new-york/index
    http://statebystategardening.com/la/blog/a_wildlife_weekend/

    Is ‘la’ what you have renamed index.php?

    If it is multiple authors and multiple weblogs then I am guessing you need that template group to differ the URL? What does the template group name reflect? The State or the blog name?

    How you construct your URL is key here as your template is dynamic and feeds off this URL. You can sometimes manually construct the URL to your liking also to improve your efficiently in the backend.

  • #5 / Dec 06, 2010 10:52am

    DesignBloke

    63 posts

    Do you have authors that update each blog from the control panel?

    Yes, every blog has its own author that needs CP access to only his/her own blog.

    Is ‘la’ what you have renamed index.php?...What does the template group name reflect? The State or the blog name?

    No.  I eliminated index.php altogether.  “LA” actually represents the state.  Each state has it’s unique content at mydomain.com/STATEabbreviation/blog_001/ I’m not allowing the blog name into the url so that I can use the same template sets blog_001 thru blog_003 for each state’s template group with only changing variables the top.  This is one website for 14 completely separate publications, but for ease of updates, etc I am giving them all the same exact structure.

    This isn’t a big issue really.  I was just interested in doing this in a more efficient manner.  But, I think what I am setting up will work - even if it is a bit redundant.

  • #6 / Dec 06, 2010 5:56pm

    Ingmar

    29245 posts

    So, you’re good?

  • #7 / Dec 06, 2010 5:57pm

    DesignBloke

    63 posts

    Yeah. I’m ok.  I’ll post again if anything goes terribly wrong.

  • #8 / Dec 07, 2010 8:02am

    Sue Crocker

    26054 posts

    Sounds good. Don’t hesitate to post again as needed.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases