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.

Problem getting channel entries to render when using URL segments

February 01, 2011 12:49pm

Subscribe [3]
  • #1 / Feb 01, 2011 12:49pm

    designbuddy

    6 posts

    Hi everyone - I have a really weird problem, must be doing something wrong and hoping someone can point me in the right direction…

    I have a template for multiple pages (service) which I’m calling from a channel (services) dynamically in another template (services).  The channel contains information about services, with a title, short description, long description and call to action.  I’m calling the service template by adding the url_title to the end of my URL on my services page, then using URL segments to pull it out on my service page (using the url_title segment to tell the channel which entry to pull back and populate the service template with.  Phew!

    This works great, but the problem is when I try to add any other channel data in the service template (from my portfolio for related work, and another channel for related services).  Both of these channels aren’t rendering at all.  I know the code is good as I’ve used exactly the same code in other areas of the site and they work fine.

    The only conclusion I can come to is that using the URL segment is throwing it out somehow.  Has anyone else experienced this or can anyone point out where I’m going wrong?  I can’t find any other examples of this issue in the forums…

    Here’s a snippet if this helps:

    <div class="service-content">
                                {exp:channel:entries channel="services" url_title="{segment_3}"}
                                    <h1>{title}</h1>
                                    {service_long_desc}
                                {/exp:channel:entries}
                            </div>
                        <div class="inner">
                            <span class="title sub black">Related Work</span>
                            <div class="related-work shadow">
                                {exp:channel:entries channel="portfolio"}
                                        <div class="folioentry nojs">
                                            {preview}
                                            <div class="foliodesc">
                                                <span class="folio-title">{title}</span>
                                                {short_desc}
                                                <a>{site_url}images/site/folio-btn.gif</a>
                                            </div>
                                        </div>
                                {/exp:channel:entries}
                            </div>
  • #2 / Feb 02, 2011 6:36am

    John Henry Donovan

    12339 posts

    designbuddy,

    Try adding the dynamic= parameter in there

    {exp:channel:entries channel="portfolio" dynamic="no"}
  • #3 / Feb 02, 2011 9:56am

    designbuddy

    6 posts

    Lifesaver!  That works a treat - thank you very much!

    Edit/

    Just read this about the dynamic attribute - http://ellislab.com/expressionengine/user-guide/modules/channel/parameters.html#par_dynamic

    makes a lot more sense now 😊

  • #4 / Feb 02, 2011 5:06pm

    Ingmar

    29245 posts

    I am very glad to see John Henry was able to help. Please post again as needed.

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

ExpressionEngine News!

#eecms, #events, #releases