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.

Customized URL Solutions

March 26, 2012 12:09pm

Subscribe [3]
  • #1 / Mar 26, 2012 12:09pm

    DigitalDesigns

    94 posts

    We need recommendations from the community on customizing our URL’s.

    We are currently using templategroup/view as our standard, but we would like to remove “view” (this is typically our single-entry template name) as part of the url.

    Current URL: http://www.mysite.com/templategroup/view/title-of-entry
    Desired URL: http://www.mysite.com/templategroup/title-of-entry

    Can this be done with a module?

    Thanks-

  • #2 / Mar 26, 2012 2:49pm

    Rob Allen

    3114 posts

    You can do this with a couple of conditionals in your /group/index template

    {if segment_2 == ""}
    Listing view
    {/if}
    
    {if segment_2 != ""}
    Entry view
    {/if}
  • #3 / Mar 27, 2012 10:48am

    DigitalDesigns

    94 posts

    Would this be placed in a link? Or would this conditional go around the whole template?

  • #4 / Mar 27, 2012 10:58am

    Rob Allen

    3114 posts

    You’d put it wherever you wanted to output the contet, most likley between the documents body tags:

    <!DOCTYPE html>
    <html>
    <head>
    <title>Title of document</title>
    </head>
    
    <body>
    
    {if segment_2 == ""}
    Listing view
    {/if}
    
    {if segment_2 != ""}
    Entry view
    {/if}  
    
    </body>
    
    </html>
.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases