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.

Change Template Index or Forward to another Template

May 05, 2012 10:04am

Subscribe [2]
  • #1 / May 05, 2012 10:04am

    MtechSite

    1 posts

    Hello,

    Our website structure isn’t using the default ‘index’ under template groups. I would like to either,

    1. Remove the index (which I think isn’t possible?) or change the index template to another on template group, OR,
    2. Have the index forward to another template. I tried doing that using the following method - gave ‘no access’ privileges to all user groups to the template and instead tried forwarding it to the homepage or the 404 page. Unfortunately, it isn’t working.

    Scenario,
    The index on this template group doesn’t have the privilege to see the page, which is working I guess, but showing a blank page instead of forwarding to the template identified (which is the homepage for now).

    http://ascentppe.info/index.php/team/
    http://ascentppe.info/index.php/team/index

    Thanks!
    Reza Patel

  • #2 / May 05, 2012 10:06am

    MtechSite

    1 posts

    Sorry, used a different account to post than the one that holds the license. Hope that’s not an issue..

  • #3 / May 07, 2012 12:16pm

    Dan Decker

    7338 posts

    Hi Reza,

    Indeed, you can not remove or rename the index template in any template group.

    However, what you want as a solution is easy enough.

    First, remove any restrictions you have on the index templates in any of your groups. That’s an extra step we don’t need.

    Then, in each index template, you can set either of these redirects:

    {redirect="SITE_INDEX"}
    
    --- or ---
    
    {redirect="404"}

    The only exception to this is the index template that is set to be the index of your site. Obviously, that has to contain the content you want displayed on your site’s homepage.

    Cheers,

  • #4 / Sep 11, 2012 6:28pm

    Is there a way to redirect to other templates besides site_index or 404?  For one reason or another, I often find that it would be convenient to use some other template besides “index” as the default template for a particular template group.  I would love to be able to choose the template that was used by default by the template group.

    Is there a way to do that?

  • #5 / Sep 12, 2012 3:42pm

    Dan Decker

    7338 posts

    Hi adb7901,

    Absolutely!

    You simply specify the template-group/template:

    {redirect='site/thank-you'}

    ~

  • #6 / Sep 12, 2012 5:09pm

    That seems a bit too easy.  Oh well.  You can never learn something until you learn it I guess lol…

  • #7 / Sep 13, 2012 5:30pm

    Dan Decker

    7338 posts

    Indeed!

    If you need anything else, please let me know.

    Cheers!

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

ExpressionEngine News!

#eecms, #events, #releases