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.

Tiered content pages question

March 04, 2009 6:27am

Subscribe [2]
  • #1 / Mar 04, 2009 6:27am

    Hi everyone,
    I am looking to create a series of sections (weblogs) containing either 1 or more entries. I would like to have it that the first entry loads when the weblog is called, as well as a list of all entries within the weblog in a list on the side.

    How would I go about structuring my content in order to achieve this? I have attempted with just weblogs and have worked with a category to no avail.

    Any assistance would be greatly appreciated.

    Thanks in advance,
    Matt.

  • #2 / Mar 04, 2009 7:10am

    Kris Khaira

    38 posts

    Wouldn’t you just need to make a weblog for each section, and then use the Weblog Entries Tag in different parts of the template for each of the weblogs?

    For example, put this is in the main part of the template:

    {exp:weblog:entries weblog="news" limit="1"}
    <h2>{title}</h2>
    <p>{body}<br />
    {/exp:weblog:entries}

    And this in the sidebar for a list of 10 entries:

    <ul>
    {exp:weblog:entries weblog="news" limit="10"}
    <li>{title}</li>
    {/exp:weblog:entries}
    </ul>
  • #3 / Mar 04, 2009 8:26am

    Thanks Kris. I have been doing this.

    The issues are two-fold:

    1. The linking of the various list items to the entries. I have tried {permalink) and various other tags, to no avail.

    2. The list items display. I would like to display the list items for the weblog being viewed, independently of which entry is being viewed. The list changes whenever I view a different entry, as apposed to remaining the same (even though I am calling the main weblog and not the specific entry).

    Other things I would like to do with this is append a CSS class to the item currently being viewed. This can wait until the above two issues have been resolved though.

    Thanks in advance,
    Matt.

  • #4 / Mar 04, 2009 4:13pm

    Kris Khaira

    38 posts

    1. You could try this:

    <ul>
    {exp:weblog:entries weblog="{segment_1}" limit="10"}
    <li><a href="/{weblog_short_name}/{entry_id}">{title}</a></li>
    {/exp:weblog:entries}
    </ul>

    2. There’s a variable called {segment_1} that takes the first variable in the current URL so you could do something like this:

    <ul>
    {exp:weblog:entries weblog="{segment_1}" limit="10"}
    <li><a href="/{weblog_short_name}/{entry_id}">{title}</a></li>
    {/exp:weblog:entries}
    </ul>
  • #5 / Mar 04, 2009 5:32pm

    Boyink!

    5011 posts

    I think you’re after this basic code.

    An example is here, along with a version of the template that applies an active class to the currently viewed item.

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

ExpressionEngine News!

#eecms, #events, #releases