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.

Template Structure - articles vs. index

July 20, 2007 2:21pm

Subscribe [3]
  • #1 / Jul 20, 2007 2:21pm

    lemonman

    68 posts

    Hello, I have been using expression engine for some time now and have the opportunity now to restructure an older site of mine.

    I have 4 sections.
    They are:
    *  Home
    * About
    * Archives
    * Contact


    Each one of these sections has a custom designed ‘index’ page.
    I want to publish to the four sections as ‘blogs’ as there will be a ton of posts for each.
    The snag i have encountered is as follows.

    Keeping in mind that i have already removed index.php using htacess AND have added the names of each of my template groups to the following line in htacess.

    RewriteEngine on
    RewriteCond $1 ^(Home|About|Archives|Contact|P[0-9]{2,8}) [NC]

    How can i have each template group display a custom index page while at the same time displaying the entries(aka articles, aka ‘pages’) without adding an ‘article’ template?

    To recap,
    right now I have index pages for each of the sections.
    When An entry is clicked, i must use a template group called ‘article’ or something like it which will display my ‘content’ with a universal style for all interior pages.

    how can i get this format to work

    <a href="http://www.domain.com/about/my-first-entry">http://www.domain.com/about/my-first-entry*</a>

    to display an interior style template for each of my newly added pages?

    when only this one is working at the moment

    <a href="http://www.domain.com/about/article/my-first-entry">http://www.domain.com/about/article/my-first-entry</a>


    Help much appreciated, and since my last post I addressed Lisa - and she likes to whistle - I’ll ask.. Any ideas? Im thinking it must be a mod_rewrite but i can’t seem to get it to work..

    Cheers, Thanks…

    [Moderator Edit: Moved to How-To Forum]

  • #2 / Jul 20, 2007 3:02pm

    asozzi

    262 posts

    First off, why exactly do you need to remove the /article/ ?

    Now assuming you have good reasons, you could use the index.php template within each weblog group with some conditionals and embed the needed templates like:

    {if segment2==""}
     {embed="embeds/page-index"
      weblog="Home"
      page_title="Home Sweet Home"
    }
    
    {if:else}
    {embed="embeds/page-article"
      weblog="{segment1}"    // Or just hardcode it in each template group
      article="{segment2}"
    }
    {/if}

    For demonstration purposes I called templates in the template group “embeds”, you can choose anything you want. Also you

    In the embeded templates you just make up a page-index template and an “page-article” template.


    In your page-article template use something like

    {exp:weblog:entries weblog="{embed:weblog}"}
       <h1>{title}</h1>
       {body}
    {/exp:weblog:entries}

    It should still pick up the right article from the url since you called it as an embed.


    Hope this helps

  • #3 / Jul 20, 2007 3:40pm

    Lisa Wess

    20502 posts

    lemonman, have you looked at the new Pages module?

  • #4 / Jul 20, 2007 3:52pm

    lemonman

    68 posts

    Thanks, The segment conditional doesnt really work out.. I thinks it’s due to my mod_rewrites.
    Are you saying that i should add this to index.php somewhere?


    Here’s what failed when I typed ‘www.domain.com/about/article’

    {if segment2!="" AND segment3!=""}
       <h2>Article</h2>
    <p>{/if}

  • #5 / Jul 20, 2007 3:55pm

    lemonman

    68 posts

    Lisa, the pages module doesn’t show up!!
    I downloaded the latest version of EE and upgraded and it wasn’t included..

  • #6 / Jul 20, 2007 4:01pm

    Lisa Wess

    20502 posts

    Are you sure that you are downloading a licensed version of EE and not EECore?

  • #7 / Jul 20, 2007 4:18pm

    lemonman

    68 posts

    I was pretty sure.. Actually I realize now, I uploaded EE core on top of my 1.5.2! In ‘my download area’ I am only given the option To download ExpressionEngine Core.

    We have purchased commercial licenses for all installations of EE as required by the EE Docs.
    I cannot see updates for commercial license or ‘Full Versions’...

  • #8 / Jul 20, 2007 4:21pm

    lemonman

    68 posts

    looks like it wasn’t renewed as I was told ..
    i trust ill get the pages module now…
    cheers Lisa.

  • #9 / Jul 20, 2007 4:23pm

    Lisa Wess

    20502 posts

    If you scroll down, do you see a list of your expired licenses? If not, you may be logged in with the wrong username, though it does appear you should have some expired licenses showing there.  They should have a renew link, though. =)

  • #10 / Jul 20, 2007 5:12pm

    Cripes

    7 posts

    I see that in the pages module, it wont work if you have removed index.php (or at least it doesn’t for me)

    arghlgh…

    Ah well. Its Friday.

  • #11 / Jul 20, 2007 5:15pm

    Lisa Wess

    20502 posts

    Uh, huh? I remove index.php and the Pages module works extremely well. =) If you want to post more information I’d be happy to help.

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

ExpressionEngine News!

#eecms, #events, #releases