3

I currently have the following code in my footer. Whenever the content is loaded through either an embed or a snippet, nothing in the tags loads.

<div id="footer-wrapper">
            <footer id="page-footer" class="5grid-layout">

                <!-- Content -->
                    <div class="row">
                        <div class="4u">
                            <section class="first">

                                {footer-left-heading}
                                <ul class="style1">
                                     {exp:channel:entries
                                                     channel="contact|donate|events|profile|sponsors"
                                                     limit="5"
                                                     disable="categories|category_name|member_data|pagination"
                                                     orderby="random"
                                                     }
                                    <li><a href="{site_url}page/{url_title}">{title}</a></li>
                                    {/exp:channel:entries}
                                </ul>

                            </section>
                        </div>
                        <div class="4u">
                            <section>
                                    {footer-middle-heading}
                                <ul class="style1-dates">
                                 {exp:channel:entries
                                                     channel="event"
                                                     limit="5"
                                                     disable="categories|category_name|member_data|pagination"
                                                     orderby="event_date"
                                                     sort="asc"
                                                     show_future_entries="yes"
                                                }
                                    <li><span class="date">{exp:low_nice_date date="{event_date}" format="%M %d"}</span> <a onClick="window.open('{title_permalink='page/event'}','Event','width =400,height=200')" href="#">{title}</a></li>
                                 {/exp:channel:entries} 
                                </ul>
                            </section>
                        </div>
                        <div class="4u">
                            <section class="box-contact">
                                <h2>Contact Us</h2>
                                <a href="#" class="image"><img src="{site_url}images/pic5.jpg" alt="" /></a>
                                    <ul class="style1">
                                        {exp:channel:entries
                                             channel="company_info"
                                             limit="1"
                                             disable="categories|category_name|member_data|pagination"
                                             show_future_entries="yes"}
                                        <li class="address">{address}</li>
                                        <li class="email"><a href="#">{email_address}</a></li>
                                        <li class="phone">{tel}</li>                
                                        {/exp:channel:entries}
                                    </ul>
                            </section>
                        </div>
                    </div>

                <!-- Row Divider -->
                    <div class="row row-divider">
                        <hr class="double" />
                    </div>
                    <!-- Copyright -->
                    <div class="row">
                        <div class="12u" id="copyright">
                            {copyright}
                        </div>
                    </div>

            </footer>
        </div>

Footer is loaded into the following page:

            <!-- Header -->
            {embed="includes/header"}


        </div>

    <!-- Main -->
        <div id="main-wrapper">
            <div class="5grid-layout">
                <div class="row">
                    <div class="4u">

                        <!-- Sidebar -->
                            {embed="includes/sidebar-box"}

                    </div>
                    <div class="8u mobileUI-main-content">

                        <!-- Content -->
                            <div id="content">
                                <article class="first">
                                        {exp:channel:entries 
                                                     channel="issues"
                                                     limit="1"
                                                     disable="categories|category_name|member_data|pagination"
                                                     orderby="date"
                                                     sort="asc"}
                                    <header>
                                        <h2>{title}</h2>
                                    </header>

                                 <p>{issue_short_description}</p>
                                 <p>{issue_description}</p>
                            {/exp:channel:entries}

                                </article>
                            </div>

                    </div>
                </div>
            </div>
        </div>


    <!-- Footer -->
        {footer}
2

To isolate the problem, I would

  1. Try with a very simple "hello world" snippet or embed and see if it renders
  2. Add a single simple exp:channel:entries tag in there and see if it works
  3. Add in your exp:channel:entries one by one to see where it breaks

EDIT: Try adding dynamic="no" to your channel entries loops, since you don't want EE to try to be intelligently guessing what you want by looking at the URL. That should help

Just replace your entire footer code with this

{exp:channel:entries
    channel="event"
    limit="5"
    disable="categories|category_name|member_data|pagination"
    orderby="event_date"
    sort="asc"
    show_future_entries="yes"
    dynamic="no"}

        {if count == 1}<ul>{/if}
            <li>{title}</li>
        {if count == total_results}</ul>{/if}

        {if no_results}<p>No event found</p>{/if}

{/exp:channel:entries}

When that works, reconstruct your original file slowly by adding {exp:channel:entries} loops one by one, adding dynamic="no"

What happened here is that, since you didn"t have dynamic="no" EE was trying to be intelligent when displaying the data by looking at the current URL. dynamic="no" tells it to forget about the URL completely and do as it is told.

Also, when working with loops and lists, it is good practice to put <ul></ul> inside your loop so as not to have a list with no <li> if there are no results. Updated code above.

7
  • Yes the static parts appear. I forgot to add that the content that is loaded on this page, is called from the entry post. {title_permalink='page/issue'} Meaning Site_url/template group/template name/entry Jun 26 '13 at 11:41
  • Try replacing your code with a very simple exp:channel:entries loop with dynamic="no" as a parameter. Jun 26 '13 at 11:45
  • None of the tags on the page load at all, whether it's an embed, snippet or global variable, except the one that's being brought in from the URL. {embed="includes/sidebar-box"} has the same channel inside it, but only loads the title of the current entry, instead of all the entries in the channel. EDIT: the url looks like this index.php/page/issue/issue-1 I'm trying to load the content by calling it from the URL, issue-1 being the entry. If i remove issue-1 then the page loads the first entry in the channel and the rest of the tags load fine. Jun 26 '13 at 11:54
  • Did you try with a very simple {exp:channel:entries} loop and dynamic="no" as a parameter? See edit above. Jun 26 '13 at 11:57
  • Okay I can see the entries now from that channel. Jun 26 '13 at 12:05

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.