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.

Working within the same template

October 08, 2007 12:35pm

Subscribe [1]
  • #1 / Oct 08, 2007 12:35pm

    nullbreached

    116 posts

    I just had an opinion question really. Since I am building a gallery for my art would it be wise to build in two different template groups? Like have galleries and the galleries detail page in one and the basic pages in another group. I am building everything in the same template group. Just thought I would get some points on this…

  • #2 / Oct 08, 2007 1:07pm

    I think it really depends on how you want your URLs to appear. I typically group templates based on a site’s complexity—the bigger and deeper the site, the more likely I am to create different groups, obviously.

    But for you, it might suffice to have a single group so that your URLs are shorter and more attractive.

    For example, using the same ‘default’ template group for your templates would allow you to have:

    http://www.studio.com/gallery/  OR
    http://www.studio.com/detail/work_1

    Versus using a separate template group (lets call it ‘gallery’) that might force your URLs to read:

    http://www.studio.com/gallery/  OR
    http://www.studio.com/gallery/detail/work_1

    Of course, using a separate template group called gallery might make the URLs more descriptive, giving your visitors a sense of where they are, i.e. gallery > detail > work_1

    Make sense?

    It’s all preference really.

  • #3 / Oct 27, 2007 9:22am

    nullbreached

    116 posts

    Great thanks! 

    A little confusion still lies within the whole URL thing for me. When I set my site to a new template group, let’s call it “final” and put all my templates in there to work from… The template group “final” shows up in my URL… How come? Since I set the final template group to be my default, shouldn’t it ignore that?

    You had http://mysite.com/gallery/
          http://mysite.com/detail

    Which looks great.. but mine is coming up http://mysite.com/final/gallery

  • #4 / Oct 29, 2007 1:29pm

    If you’re linking between templates in the same group, you shouldn’t need to include the template group in your URL structure.

    For example, try looking at this page: http://mysite.com/final/gallery. And then try looking at this one: http://mysite.com/gallery (using your site’s base URL, of course).

    Are they the same?

    If so, then you’ll see that you can create URLs in your templates that don’t explicitly make reference to the template group. So you could have a link in your template that looked like this

    <a href="http://{title_permalink=final/detail}">{title}</a>

    that would lead to exactly the same place as

    <a href="http://{title_permalink=detail}">{title}</a>

    And the URL would contain the template group only if you set it to.

    The only rule here is that if you’re going to leave out the template group, the template that you’re linking from and the template that you’re linking to must be in the same group.

    Try it.

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

ExpressionEngine News!

#eecms, #events, #releases