‘best practice’ template group strategies
Posted: 29 June 2004 03:16 AM   [ Ignore ]  
Grad Student
Rank
Total Posts:  38
Joined  06-13-2004

I’m just getting familiar with EE and I’d like to get some ‘best practice’ advice as I begin to structure my site. Keep in mind that I am using EE more as a cms than strictly blog tool.

What are some of the strategies and advantages of using the template group structure? I assume the key advantage is primarily organizational; organizing the template groups to mirror the site structure (ie, a ‘news’ template group, a ‘products’ template group, perhaps even sub-sections like an ‘electronics products’ template group, etc…). One key advantage to doing that is to generate user friendly and search engine friendly URLs.

What else? Are there any other key concepts or advantages to template groups?

Are there any EE tags that relate specifically to template groups? path and auto_path seem to - is there a specific logic to when and why you would group templates together to make scripting simpler or more modular?

What about strategies for sharing ‘global’ templates? I’m thinking that site wide embedded templates (ie, header, main-nav, footer) might make sense to go into a specific template group.

I’d appreciate any insights. Thanks.

Profile
 
 
Posted: 29 June 2004 11:02 AM   [ Ignore ]   [ # 1 ]  
Moderator
Avatar
RankRankRankRankRankRankRankRank
Total Posts:  33276
Joined  05-14-2004

I have several template groups - one for each weblog and then I have one that contains all my includes (as per your last comment).  The weblog=template group thing just seems to make sense… =)

 Signature 
Profile
MSG
 
 
Posted: 29 June 2004 11:08 AM   [ Ignore ]   [ # 2 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  7509
Joined  08-05-2002

Organization is definitely a big one.  Having a page full of just templates would make it difficult to keep it all straight.  Also, by using template groups, it allows more of a structure to the site.  So, instead of http://www.yoursite.com/index.php/template1/, http://www.yoursite.com/index.php/template2/, http://www.yoursite.com/index.php/template3/, you can create another layer of branching/division.

It also allows the use of a more module approach to designing a site, since there is the ability to embed templates.  What amuses me is that embedding templates came from an offhand suggestion and it blossomed into something used an incredible amount of users.  Having seen the Template area of the CP for Sue’s, Lynda’s and LissaJill’s sites…I am sure they can probably comment more on this.

Another reason is that when the UserBlog Module is released template group access will be very key.  The UserBlog Module will easily allow an admin to create a blog for each user.  So, each user will have their own template group and weblog to use as they please.  If we had not used template groups, this would have been far more difficult.  And of course, by using template groups, in the future as EE grows, it will allow more access and control.

The permalink variables also use templates groups and templates.  Further, you can use the {segment} globals, which parse the incoming URL, to use the sections of the URL (we break it up by the slashes) for greater control of what is displayed depending on the URL.

 Signature 
Profile
 
 
Posted: 29 June 2004 03:49 PM   [ Ignore ]   [ # 3 ]  
Grad Student
Rank
Total Posts:  32
Joined  06-08-2004

Somewhat related here, is there any way to allow administration to category groups like template groups?

Example being: I create UserA who is the ‘editor’ for SiteA. I can assign privs to add/edit within a template group, but apparently not similar privs to use a category group. Argh! So I as superadmin would need to create/manage/assign the categories for SiteA at this point I guess.

Is there any _vague_ roadmap for future releases? It sounds as if UserBlog will handle lots of my needs, and I see lots of ‘if’s in the source for it. With not even a vague release roadmap I can’t decide if it’s sensible for me to begin working on adding these features myself—they could show up as an EE module tomorrow, the day before or after I finished adding it myself, or 6 months later.

What to do!? I’m beginning to be a bit disappointed for buying into a product with a closed development cycle - and in this case I don’t mean the coding/development, but the features. The ‘Surprise!’ style makes it kinda hard to work with for anything but personal usage I’m afraid. I understand the problems inherent in setting dates for features, but even _seasonal_ or quarterly-based would be some improvement. Sorry to gripe, but I’m just stuck in a bad position with this situation. (Dive into lots of development that may be for naught or might not - can’t tell!)

Profile
 
 
Posted: 30 June 2004 01:48 AM   [ Ignore ]   [ # 4 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  12779
Joined  04-29-2002

I use embedding frequently - it makes creating mini-sites go so much faster.

When I design a site, I create a template group called site. In that template group I put in the following:

leftnav, topnav, rightnav, footer - anything that would be used in multiple “pages.”

If I’m creating subdomain template groups, I put those items inside a subdomain template group.

For a primary domain, I create an additional weblog (data container) called site to use for making pages like: About Us, Terms of Use, that sort of thing. I reserve another weblog (data container) for weblog like entries.

If I’m making a CMS type site, it often doesn’t need a secondary weblog (data container) if there aren’t any entries that need to be used for other than presenting site info.

Does this make sense? I went a bit beyond template management here. smile

 Signature 

Quick Reference - EE Trial Options - EE Wiki - Docs for updating a build

Profile
MSG
 
 
Posted: 30 June 2004 02:24 AM   [ Ignore ]   [ # 5 ]  
Grad Student
Rank
Total Posts:  38
Joined  06-13-2004

Actually Sue that helps out a lot. It’s just extremely helpful to hear how people approach site management in general.

It’s interesting that you’re separating static content and dynamic content using two separate weblogs (aka data containers, which is the perfect way to describe it). What’s the thinking behind that? Is it related to caching? To member privileges? Wouldn’t that make the URLs a bit funky in terms of user and search engine friendliness?

I noticed in the Knowledge Blog that Rick suggests separate blogs for ‘events’ and ‘news’ - which makes a lot of sense.

I’d love to hear some more details about your approach. And other people’s approaches.

Profile
 
 
Posted: 30 June 2004 03:04 AM   [ Ignore ]   [ # 6 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  12779
Joined  04-29-2002

Adam, the reason I separate dynamic content and static content using a different weblog is so that I can have the best of both worlds. If this is a CMS only site, I’d have one weblog to search through.

For a content driven site, I’d set the search to be through the weblog for the dynamic content.

The URLs wouldn’t be that mixed up.

For instance,

http://www.pmachinehowto.com/index.php/site/about/ is my About Page.

I don’t have a terms of use page, but if I did, it could be at:

http://www.pmachinehowto.com/index.php/site/terms/

Now sites that are hanging off a primary install are going to be a bit more problematic:

Greeting Card Wiz I did a few days ago for a client. gcw is the template group.

One Wealthy Team uses onewealthyteam as the template group. (Same client)

The pages are all set to PHP available, and parsed on input. I use the following:

<?
      $title = “Some Title”;
      $entry_id = 123;
?>

And echo out the entry_id and title as needed. The title can be different than the title of the entry.

 Signature 

Quick Reference - EE Trial Options - EE Wiki - Docs for updating a build

Profile
MSG
 
 
Posted: 30 June 2004 07:16 PM   [ Ignore ]   [ # 7 ]  
Moderator
Avatar
RankRankRankRank
Total Posts:  1083
Joined  08-01-2002

Templates with in Templates (or template layers) is something that I had seen and used in a number of high end CMS systems, and personally could not imagine using a CMS without the ability smile  Rick and Paul did a great job at going beyond what I had personally hoped for, with the ability to pre or post process php within the templates/subtemplates, and using user group permissions on subtemplates is very powerful as well…

 Signature 
Profile
 
 
Posted: 01 July 2004 01:00 AM   [ Ignore ]   [ # 8 ]  
Grad Student
Rank
Total Posts:  67
Joined  05-13-2004

FYI, I have used the following approach :

Each Template Group is a different site (=DNS domain).
In a Template Group, each Template is a Page (=subject eg “products”)
In each Template, PHP cares about how to show a particular content (be it weblog entries, search results, categories, archives, forms, etc.) and does the formatting.

It means that everything related to a subject is shown on the same page, keeping page outlook (header, navbar, sidebar, etc.) identical whatever is shown as content.

The downside is that templates tend to be fat, managing all sort of contents relating to a subject. The upside is that IMHO the user experience is better, sticking on the same page vs being brought to new pages and not knowing where he has been forwarded.

What do you think ? Am I on a right track or not ?

 

Profile
 
 
Posted: 07 July 2004 04:08 PM   [ Ignore ]   [ # 9 ]  
Lab Assistant
RankRank
Total Posts:  122
Joined  01-20-2003

Sue, question regards the idea of using a weblog to manage “static” about, terms, privacy, etc. pages if you don’t mind.

What I’ve tended to do is setup a template group then create templates for each page rather than set up a weblog to manage the content. What do you see as advantages of using the weblog method? I can see:
- more client manageable formatting options
- internally searchable
- possibly run off one template using url_title?
versus advantages of “hardcoded” template method:
- revision history
- less steps to edit
- faster/easier setup


Back on topic.
A big plus for me was being able to rename “index.php” to the name of a templategroup and eliminate a segment of the default URI all together. Basically I create a generic or descriptively named templategroup and run most of the site out of there. I’ll create other templategroups for specific areas of the site if I need to but I try and focus more on a short URI (with url_title they can get loooong).

I use .htaccess to point my homepage to a specific template which gives some more flexibility. In my case the code is something like

directoryIndex competitions/home index.php index.html

That means http://www.winstuff.co.nz/ is magically and invisibly showing http://www.winstuff.co.nz/competitions/home/ while my EE “homepage” is http://www.winstuff.co.nz/competitions/index/

For global templates I do the same as others - create a template group named “z” then create all the global stuff and pull it in using

{embed=z/incMast}
{embed
=z/incMenu}
{embed
=z/incMenuOnline}

Once you’ve decided/designed the layout of your site being able to make new templates by duplicating existing ones is a really fast way to make a complex site.


I’m still toying with setting up a personal blog (and moblog) on a different domain using the same EE install, I have it set up exactly as above as well and it’s really just waiting for me to buy a new fandangled cameraphone to make sure it works as expected and have a bit of fun with smile


etosha, I have a similar approach but I’m trying not to limit myself by saying this template group is this site or this templategroup is this weblog. If it makes sense to create a new templategroup and separate a bunch of pages I’ll do that - it means I’ve got multiple weblogs spread across multiple templategroups and templates spread across multiple domains - which means the backend isn’t so tidy but the frontend (users/search engines) is pretty good looking.
When you say your templates “tend to be fat” do you mean you have a lot of templates under a few templategroups or something else? My template list is a mile long, I think I will eventually set up different users for myself with different privileges to manage things a bit. “PHP cares about how to show a particular content” - do you mean EE tags or something special with PHP? Just curious and looking for new ideas for my sites smile


It is probably a good thing™ the site I play with EE on is a side income/spare time thing and not mission critical as I do a far amount of experimenting smile It’s definitely given me a nice foundation on which to build the next complex CMS style site I need to do.
I’m typing this on my powerbook bouncing around in the back of a bus, apologies if it’s a bit disjointed or rambling wink

Profile
 
 
Posted: 08 July 2004 01:44 AM   [ Ignore ]   [ # 10 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  12779
Joined  04-29-2002

Rish -
I set up a template group and feed those templates text from weblog entries. This way, the client just goes into the edit tab and finds the text to change.

I initially set up the entries and put in something like this:

About us text goes here

Then it’s up to them to go fix the real text.

I don’t want the client inside the actual templates fiddling around. smile

 Signature 

Quick Reference - EE Trial Options - EE Wiki - Docs for updating a build

Profile
MSG
 
 
Posted: 08 July 2004 08:27 AM   [ Ignore ]   [ # 11 ]  
Grad Student
Rank
Total Posts:  67
Joined  05-13-2004

Rish,

When I say my “templates tend to be fat” and “PHP cares about how to show a particular content”, I mean the following.

In my site, a template is a page related to a subject.
Whatever is related to that subject (be it weblog single entry, multiples entries, category archives, search results, etc) is shown on that page with that template.

Basically I use segments to pass parameters (ex: templategroup/template/monthly_archive) to the template, so that it is aware of what kind of content has to be shown. Depending on the segment, I use PHP Switch/ Case directives (eg : case monthly_archive) to select the appropriate block of tag code, which will display the content as I want it to be displayed.

Which means a template code is quite large, but I have really few templates (one per page basically).

Does that make sense ?

Profile
 
 
Posted: 15 July 2004 12:35 PM   [ Ignore ]   [ # 12 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  779
Joined  12-01-2002

Ahhh… this is the post I’ve been searching for. Sue: when your setting up static versus dynamic content? Your using two weblogs, do you have a naming methodology, that seems to make it easier for client/users to understand.  I’ve just been struggling with a way to present “static text” so one it doesn’t display on the main page, but two is easy to modify and adjust when necessary.  I was looking at adding a custom field, then changing the query, but your method sounds pretty darn reasonable to me.

Profile
 
 
Posted: 15 July 2004 01:58 PM   [ Ignore ]   [ # 13 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  12779
Joined  04-29-2002

Clients “see” two different “Data Containers” - one for the site and one for dynamic content such as news items. (That’s what most of mine use the dynamic stuff for, just news.)

So if the site is Hamrick Family Law, they’d see two weblogs to post/edit to:

Hamrick Family Law Pages and Hamrick Family Law News

(My maiden name, not a real site. Two of my siblings are lawyers.)

Here’s a real example: Nebraska DUI

This one doesn’t have news, but I’m going to be making a links blog instead of news.

Each one of the items on the left and right are in a single weblog. They are single entries.

 Signature 

Quick Reference - EE Trial Options - EE Wiki - Docs for updating a build

Profile
MSG
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 09:33 AM
Total Registered Members: 66463 Total Logged-in Users: 60
Total Topics: 84852 Total Anonymous Users: 13
Total Replies: 455301 Total Guests: 191
Total Posts: 540153    
Members ( View Memberlist )
Newest Members:  drivenewmediaTgunRooks TowermarkfavazzastephenhfoxysaxAtosheviboyjbcobbsOut_There