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.

Default indices for templates?

November 10, 2009 1:36pm

Subscribe [2]
  • #1 / Nov 10, 2009 1:36pm

    sandiegozoo

    62 posts

    [ADDENDUM: Please? Anyone? It doesn’t seem like it should be that hard… I simply can’t find the documentation.]

    I am sure I am missing it somewhere, but I cannot seem to figure out how to set a default index for a sub-section. 

    Example:
    http://www.sandiegozoo.org/groupevents/social/

    I need the entry currently called “overview” to be the entry that appears when the above url is called.  EE seems, however, to want to do things alphabetically.  I was hoping that calling the page index.html would create that default, but it did not.  G comes before I is the rule that must put Group Tours there instead.  Is there nothing I can do to make this happen short of redirects?

    Another example:
    http://www.sandiegozoo.org/groupevents/corporate/
    I gave the “overview” entry the URL title of index.html, but rather than making it the default, it now uses the page with the URL title of “packages”, which is first within that template’s entries alphabetically by non-URL title.

    Please tell me there is some way of designating a template’s default page without using the old-skool AAAAArdvark naming convention…

    Thank you for any help…

    Kristin

  • #2 / Nov 10, 2009 3:23pm

    JArment

    131 posts

    Kristin,

    There are a few ways you could do this.

    1. You could use a conditional statement in your weblog:entries tag parameters.

    {exp:weblog:entries weblog="weblog_name"{if segment_3 == ""} url_title="index.html"{/if}}

    In this example, if there is no 3rd segment in the URL, the entry titled “index.html” will be loaded.

    2. You could also use the “make sticky” option. This will only work if you aren’t using the option for other things. Basically, you would select the option “make sticky” for your overview entries, and, by default, that entry will show as the first entry.

    Documentation:
    http://expressionengine.com/docs/templates/globals/url_segments.html - see maadmac’s contributed notes
    http://expressionengine.com/docs/cp/publish/index.html#tab_options - see “Make Entry Sticky”

  • #3 / Nov 10, 2009 4:45pm

    sandiegozoo

    62 posts

    Oh, lawdy, “sticky” is just what I needed!  It seems to work the way I wanted, with one sticky entry available per template.  Using two in one blog will not cause a problem, I hope.

    Thank you!

    Kristin

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

ExpressionEngine News!

#eecms, #events, #releases