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.

Show a Content of a Page Entry on the selected Template

October 27, 2011 10:55am

Subscribe [2]
  • #1 / Oct 27, 2011 10:55am

    aight8

    8 posts

    Hello

    I dont understand the paradigma from the built-in “pages” module.

    Normally you use channel entries to list ONE or MORE of it trougth the {exp:channel:entries} tag.

    I know, when you enable the pages module, then you can assign a custom URL to the entry. But wait, stop! This entry isn’t now only a normal entry, its now like a now like a router entry + data-holding entry.
    When you type something in the “page url” field, and i’m open it in the browser, it will render the deposited “template” under the pages tab.

    Why do you merge this routing functionality with normal data-holding channel entries?

    —-
    I probably misunterstood the idea of “pages”. Now i try to SHOW the data-holding channel entry in the assigned template like this:

    content:
    {content}

    or

    {exp:channel:entries channel="seo-page" url_title="title-1" dynamic="no"}
    content:
    {content}
    {/exp:channel:entries}

    seo-page: is the default page channel type
    title-1: is the url title of the page
    {content}: a custom textarea field in the pages entry


    But the the tags stays empty. Then i remove ‘url_title=“title-1”’ to list the whole channel, but its stays empty too.

    Can you help me please to understand the usages of “pages” and why this codes not work?

  • #2 / Oct 27, 2011 9:15pm

    Boyink!

    5011 posts

  • #3 / Oct 28, 2011 11:00am

    aight8

    8 posts

    Thanks Boyink!..

    I have now make an example can you take a look at it, please:

    ———

    Template: pages/index (List all entries)

    {embed="includes/.header"}
    {embed="includes/.body_start"}
    
    {exp:channel:entries channel="news" dynamic="no"}
    {if no_results}Keine Einträge vorhanden{/if}
    <a href="http://{title_permalink=">{title}</a>
    
    {/exp:channel:entries}
    
    {embed="includes/.body_end"}

    Template: pages/show (Show one entry)

    {exp:channel:entries channel="news" url_title="{segment_3}" limit="1"}
    {if no_results}{redirect="404"}{/if}
    
    {embed="includes/.header"}
    {embed="includes/.body_start"}
    
    <a href="http://{path=pages}">Zurück zur Übersicht</a>
    
    
    
    <b>{title}</b>
    
    {content}
    
    {embed="includes/.body_end"}
    {/exp:channel:entries}


    —————-

    Now you can create entries in the news channel and can also add a “Pages Url”. The template must be “pages/show”. Then its redirect the URL to the show page and dynamicly set the {exp:channel:entries channel..} entry. The url_title parameter will be dismissed when im not use the dynamic=“no” parameter.

    Only two compact templates for this “List + Detail View incl. custom URL”
    —————-

    Thats the right way isn’t it? Some usefull tipps? 😊

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

ExpressionEngine News!

#eecms, #events, #releases