0

i have a channel, called html5, that contains more articles (4 right now) and i have a template to show theese articles. When you open the website.com/html5, everything works: the default article is displayed, and the menu in sidebar contains all the articles listed, BUT, when you click on any of the links in the menu (redirecting you to website.com/html5/article-name), the right article is shown, but in the menu, just the active article is shown, and other articles just disappear. So i ask, how to list all articles in channel even in single-article page?

{embed="overall/header"}
<div class="row" style="margin-top: 10px;">
            //Sidebar START
    <div class="large-4 columns">
    <ul class="side-nav">
                //This shows static link to the home of the HTML section
                <li><a href="/html">HTML5</a></li>
                //And this lists all the articles... (The problem is right there!)
                {exp:channel:entries channel="html5"}
                    <li><a href="{url_title_path='html/index'}">{title}</a></li>
            {/exp:channel:entries}
    </ul>
    </div>
            //Sidebar END
    <div class="large-16 columns">
        {if segment_2 == ""}
        //STATIC content goes here              
        {/if}
        {if segment_2}

            {exp:channel:entries channel="html5"}
                <h2>{title}</h2>
                {page_content}
           {/exp:channel:entries}
        {/if}

    </div>
</div>
{embed="overall/footer"}
1

On your side nav {exp:channel: entries} tag you need to add dynamic="no" to tell EE to ignore the URL and list all entries.

Keep your standard/main EE tags as is and u should be golden.

| improve this answer | |
1

Use the dynamic="no" parameter on the channel entries tag for the menu, otherwise the channel entries tag will use the entry ID or url title from the URL to determine which entry to display.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.