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 template for new entries

October 26, 2011 9:29pm

Subscribe [5]
  • #1 / Oct 26, 2011 9:29pm

    Mediafluent

    15 posts

    Hi, I’m setting up my first EE site and have a few more questions (more threads coming) :roll:

    I have about 10 templates right now: embed group (header footer nav etc), home page, rss, and the article page. When a writer/editor creates a new entry, I want it to default to the article template. How do I do that?

    Also, on the new/edit entry page, under the Pages tab, how can I make the other templates (.header .footer .nav) stop from appearing in the list? I thought the .name would do it but no.

    I did search for answers on forum but nothing…

    Thanks for help!

    Jim

  • #2 / Oct 27, 2011 2:32pm

    Kevin Smith

    4784 posts

    Hi DreamProducer,

    When you say “default to the article template”, what do you mean specifically? If you want to make sure your entries from a particular channel show on a template, you’ll do that using the Channel Entries Tag. The Getting Started guide is a good place to start for those concepts, too.

    If you just mean you want new Page entries in a particular channel to set a particular template as the default, you’ll do that by going to Add-ons > Modules > Pages and setting default templates in the Pages module configuration. There isn’t a way to keep hidden templates from showing in the list, however. Hidden templates are shown in the CP, they just aren’t accessible from the front-end when called directly.

  • #3 / Oct 27, 2011 4:30pm

    Mediafluent

    15 posts

    Thanks Kevin. That’s helpful. The second option is what I meant.

  • #4 / Oct 28, 2011 5:39pm

    Mediafluent

    15 posts

    Actually not quite what I meant. Here’s an example:

    I have 3 channels: about, support, mission
    I have 3 templates: site/about, site/support, site/mission

    When I create a new entry in “about” channel, I want the site/about template used by default. How do I make that the default template for all “about” channel entries?

  • #5 / Oct 29, 2011 5:19am

    Rob Allen

    3114 posts

    DreamProducer, it’s EE tags that output the Channel data in whichever templates you allocate them to.

    In your site/about template you’d add a tag to pull in entries from your About Channel, eg

    {exp:channel:entries channel="about"}
    {title}
    {custom_field}
    {/exp:channel:entries}

    Then in site/support template you’d call your Support Channel entries into the tag link this:

    {exp:channel:entries channel="support"}
    {title}
    {custom_field}
    {/exp:channel:entries}

    Get the idea?

  • #6 / Oct 29, 2011 7:19am

    Mark Bowen

    12637 posts

    Hi DreamProducer,

    Does Rob’s advice above help at all? Thanks for the help there Rob.

    Alternatively is it perhaps you are creating a list of links something like this :

    {exp:channel:entries
     dynamic="no"}
    
    <a href="http://" title="{title}">{title}</a>
    
    
    {/exp:channel:entries}

    and what you want is to be able to click on them and go to the correct template?

    If so then you would need to set up the Admin > Channel Administration > Channels > Edit Preferences (Each of your three channels shown in your post above) > Comment Page URL

    You could then do this sort of thing :

    {exp:channel:entries
     dynamic="no"}
    
    <a href="http://{comment_entry_id_auto_path}" title="{title}">{title}</a>
    
    
    {/exp:channel:entries}

    Does that help at all?

    Thanks,

    Mark

  • #7 / Nov 07, 2011 12:56pm

    Mediafluent

    15 posts

    Bluedreamer & Mark, I get it. Thanks for your responses. I apologize for not responding sooner and being a bit more clear on my question. I should have mentioned the pages tab-

    On the site I’m building, we have x number of pages in the About channel so each entry is set up as a page. When content writers want a new page and make a new entry in the About channel, they have to go to Pages tab and enter a URI and select a template. By default, the embeds/.footer template is listed first and they have to change it to the “site/about” template. Isn’t there a way to make the site/about template show up as the default template for the About channel; the site/support template show up as the default template for the Support channel, etc.?

    Also, it would be nice to be able to hide templates that they will never need to use from showing up in the selection box of the Pages tab.

  • #8 / Nov 07, 2011 2:01pm

    Sue Crocker

    26054 posts

    Hi, DreamProducer.

    When you set up the Pages module, you can specify the default template per Channel. You’ll need to set this up for each channel.

    Does that help?

  • #9 / Nov 07, 2011 2:45pm

    Mediafluent

    15 posts

    Ahh! That’s it! Looks like Kevin essentially gave the same answer but I somehow confused myself and asked essentially the same question again. 😊

    I guess a feature request would be the ability to hide (or make visible) a template from designated member groups.

    Thanks Sue & Kevin.

  • #10 / Nov 07, 2011 2:46pm

    Sue Crocker

    26054 posts

    Yes, if you wanted to restrict based on Member group. 😊 Feel free to start a new thread if you have any more questions.

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

ExpressionEngine News!

#eecms, #events, #releases