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.

Linking Best Practice?

May 10, 2008 12:59pm

Subscribe [4]
  • #1 / May 10, 2008 12:59pm

    jschutt

    452 posts

    Hello All,

    Say I want to have several pages with that are available at these links:

    example.com/contact
    example.com/about
    example.com/schedule

    I understand the concept of template_group/template.  According to that I should have an individual template group for all three of those links.  But, what if I don’t want to create different template groups.  If, for example, there is no “contact” template group, it defaults to the template group designated as the “default” group.

    Does that sound correct?  And if so, is it a good practice to not specify the template group?

    Thanks Much

    Jesse

  • #2 / May 10, 2008 2:26pm

    adamwiggall

    178 posts

    Jessie

    You are right in thinking that these three can be placed in the default template group. They can each reside on their own template, or, with some use of conditionals you could have them share a template (but this can get messy after a while if a lot of content is being shared).

    Think of template groups as being needed when you want to separate different types of pages across the site. e.g. A ‘products’ template grouop and a ‘people’ template group will get you a nice URL structure going like

    example.com/products/widget

    example.com/people/John_Doe

    Apart from the URL structure, you get nicely organized templates that should be logical for all involved.

  • #3 / May 10, 2008 2:32pm

    jschutt

    452 posts

    That makes sense. I think. 😊

    These things are so hard for me to put into thoughts!

    So if the url segment that is supposed to be a template group does not exist, it will go back to the template group that the site index resides in.

    Jesse

  • #4 / May 10, 2008 2:36pm

    Jason Morehead

    456 posts

    Does that sound correct?  And if so, is it a good practice to not specify the template group?

    As with so many things, it depends on the site in question. As was mentioned earlier, you don’t have to use template groups at all. In theory, you could use just one massive template to drive an entire site. Of course, that’s rarely ideal because the template would likely be far to complicated to manage and maintain efficiently.

    However, you don’t want to go overboard and have a template group for every single page on your site.

    My personal preference is if I have a batch of templates that are for a common purpose, or make up a single section, than I create a template group for them. For example, if I have a site with a blog, chances are there will be several templates that will be used: one for archives, one for single entry pages, one for comment previews, and so on. And so I would create a template group to contain all of them, just to keep things neat and tidy.

    But like I said, that’s my personal preference, and sometimes, depending on the site I’m building, it doesn’t make sense. The nice thing about EE is that it doesn’t force you to structure your site in any one way. Of course, that’s a bit of a double-edged sword, because it does require a bit more forethought to ensure that the method you’re using is the most efficient one.

  • #5 / May 10, 2008 2:41pm

    Jason Morehead

    456 posts

    So if the url segment that is supposed to be a template group does not exist, it will go back to the template group that the site index resides in.

    This is actually true of any template group. Let’s say that you have a site with two template groups: “site” (which is where your site index is located) and “blog”. Within “blog”, you have two templates: “index” and “archives”.

    Obviously, if you go to http://domain.com/blog/ or http://domain.com/blog/index, that will pull up the “index” template, and if you go to http://domain.com/blog/archives, that will display the “archives” template within the “blog” group. But if you go to http://domain.com/blog/foo—in other words, if you specify a template that doesn’t exist within the “blog” group—then EE will display that group’s “index” template by default.

  • #6 / May 10, 2008 2:44pm

    adamwiggall

    178 posts

    Sorry reading back I left out the template name so more likely to look like

    example.com/products/parts/widget

    example.com/people/administration/Jon_Doe

    To answer your question, if someone tries to access a page that doesn’t exist, you are going to get a 404 error and EE will redirect to whatever you page you have specified in the control panel. So some thought needs to go into what template groups need to be on the site to make the structure safe and sound.

    Have you looked at the excellent set of articles Michael Boyink wrote?

    They will help you straighten this in your mind. Probably 😏

  • #7 / May 10, 2008 2:45pm

    jschutt

    452 posts

    Thanks for the responses!

    Let me give some examples so you can see what I am talking about.

    The organization that I am creating the site for is Camp Forest Springs.  I have built this site in EE but I am not feeling that it is in the optimal state regarding template usage. 

    First of all, almost all of the content is hard-coded into the templates, because I have yet to figure out how to deal with this much content.

    Second, there are many different “sites” within the overall site - which only seems to multiply the difficulty.

    One area
    Another area
    Yet another area

    Jesse

  • #8 / May 10, 2008 2:46pm

    jschutt

    452 posts

    Have you looked at the excellent set of articles Michael Boyink wrote?

    They will help you straighten this in your mind. Probably 😏

    I have gone through this series, but I can’t seem to translate it into my needs!

    Jesse

  • #9 / May 10, 2008 9:42pm

    adamwiggall

    178 posts

    Well, having looked through the site I think that you have got it about right, the template groups lead to a nice URL structure.

    The fact that you have content in the templates is a separate issue, putting them into weblogs is easy, and should allow you to make the content generation simple.

    How do you feel it needs to be improved?

  • #10 / May 10, 2008 9:45pm

    jschutt

    452 posts

    Thanks for looking Adam.

    I think that probably the biggest thing that needs to be improved is getting the content into weblogs.  From what I have read and learned from Mike Boyink, I should create a weblog for each of the major sections.  But, if I understand that right, I will need something like 27 different weblogs?! 

    And then dealing with the navigation..!

  • #11 / May 10, 2008 10:38pm

    PXLated

    1800 posts

    I should create a weblog for each of the major sections.  But, if I understand that right, I will need something like 27 different weblogs?

    Not necessarily. If your content needs different custom fields, then you’d need different weblogs with different field groups assigned. But, if your content doesn’t, instead it (or certain sections) can use the same fields, you can then use categories (or other methods) to differentiate and then display the content.
    My first step in planning a site is content analysis, that guides me in weblog, custom field, and category creation.

  • #12 / May 10, 2008 10:43pm

    jschutt

    452 posts

    So instead of breaking the sections down by weblog, I could use one weblog and create a category group with all the major sections. 

    Hmm.  That’s a good idea!

    It seems that many of the training materials out there deal with sites that fit into a smaller mold.  Does that make sense?  The basic “about, portfolio, contact, product” type. 

    Maybe this site would be a good candidate for the MSM?

  • #13 / May 11, 2008 2:12am

    PXLated

    1800 posts

    You might want to look at this Wiki article… Categories or Weblogs

    It seems that many of the training materials out there deal with sites that fit into a smaller mold.  Does that make sense?  The basic “about, portfolio, contact, product” type.
    Maybe this site would be a good candidate for the MSM?

    Yes, there are a lot of sites that have fewer areas and the training guides generally focus on those but it’s not necessarily because you can’t create a humongous site with EE, it’s just that for training, you don’t want to overwhelm the trainee. Large sites just take a lot more up front planning and analysis. I very rarely even start the design phase until that part is done.
    MSM isn’t really meant for a large site, it’s meant for running multiple distinct sites through one install of EE.

  • #14 / May 11, 2008 10:17am

    jschutt

    452 posts

    MSM isn’t really meant for a large site, it’s meant for running multiple distinct sites through one install of EE.

    Right.  But the way the site is set up, there could definitely be several distinct sites.  I could then break out main sections of the ministry into their own area.

    Something else that I thought of… would the ee search results work the same if I used categories?  I know that I can set up a search results template for each weblog, but what if I only use one weblog?  Will the search results for the “About Us” section actually point to the “About Us” template group even though I could use categories to break it down further?

    Thanks so much for all your input!

    Jesse

  • #15 / May 11, 2008 10:55am

    PXLated

    1800 posts

    Right.  But the way the site is set up, there could definitely be several distinct sites.  I could then break out main sections of the ministry into their own area.

    To me it would just add complexity and expense. But, that’s just based on my experience and not knowing all the details of your site(s).

    but what if I only use one weblog?

    I have never had a site, even a simple blog, where I’ve managed to have just one weblog. Most sites have different types of content, each requiring a different set of custom fields. Yes, one can shoehorn all types of content into one field set but it makes content entry and everything else harder in my estimation. And ignores one of EE’s main features/advantages.

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

ExpressionEngine News!

#eecms, #events, #releases