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.

Embeded template with weblog query not displaying when parent called with added Segment

September 11, 2009 5:01am

Subscribe [3]
  • #1 / Sep 11, 2009 5:01am

    J.B.

    79 posts

    I’m probably not doing this properly and I apologize if I’m missing something blantently posted documentation… maybe I’m tired.

    I have a simple header template that has a basic weblog call grabbing some content from a specific record

    {exp:weblog:entries weblog="{my_weblog}" url_title="recordtitle" disable="member_data|trackbacks"}

    .  Header starts page within the ‘head’ tag and ends at a ‘div’ container start tag.

    All templates that include this header seem to display it fine.  However, I have one template that is a listing of several entries.  If you click on any of them you link to a template with an added segment of the {title} of the clicked on entry.

    <a href="http://{path={my_template_group}}labbio_listing/{title}">{my_images}/people/{title}-sm.jpg</a>

    The page called with the

    {title}
    added as a segment is not rendering the embeded header template fully.  To be precise, it omitts rendering the embeded header exactly where it has a
    {exp:weblog:entries..}
    call and recovers right after the corresponding
    {/exp:weblog:entries}

    .

    The Odd thing is I have another weblog call in the page with the embeded template, it occurs below the embed call.  This weblog query works fine with/without the segment added to the URL. If I call this template w/o the added segment, the header template fully renders.

    My guess is by adding the segment, I’m placing the whole page within a EE generated exp:weblog:entries call and thus end up with 2 nested calls… from what I can gather from other posts, it’s not ‘recommended’ to have nested calls, but most are getting away with it if they encapsulate the inner call within an embeded template.  In this case, it’s my encapsulated weblog call that is failing to render, but the non-embeded one does.

    Is this behavior expected and I’ll have to find a different way, am I missing something (I hope I’m not doing something stupid with syntax) or both and I’m miss-using the segment method?

    As a layout…

    Templates
      header
      page1
      page2

      both page1 and page2 embed header and both have weblog calls outside of the embed (i.e. the begin/close of the call does not contain the embed syntax).  header has a weblog call as well.

    On page1 list of entries are generated, header is fully rendered.  If you click on an entry, you are sent to site/page2/title, where title is the title of entry clicked.  The called page2 renders everything but header; the portion between the header‘s weblog query.  Going to just site/page2, header and the rest of page2 is fully rendered.

    TIA

    EE 1.6.8

  • #2 / Sep 11, 2009 9:04am

    silenz

    1651 posts

    Long story, short answer:

    Add dynamic=“off” to the weblog-tag that pulls specific data, so it is not influenced by the the title in the URL.

    {exp:weblog:entries weblog="{my_weblog}" url_title="recordtitle" disable="member_data|trackbacks" dynamic="off"}

    http://expressionengine.com/docs/modules/weblog/parameters.html#par_dynamic

  • #3 / Sep 11, 2009 10:20am

    Ingmar

    29245 posts

    What silenz says (thanks for the assist!). Let us know if that helps, leejb. For a bit more of an explanation check out the Importance of Semantics.

  • #4 / Sep 11, 2009 1:32pm

    J.B.

    79 posts

    Nail on the head… embarassing as it is, thanks.  Sorry about the post, wanted to be clear and another reason why not to submit them at 4:30am… I should know better…

    Thanks for the link to study up on, basic but good tid-bits I should’ve found on my own.

  • #5 / Sep 11, 2009 2:11pm

    Ingmar

    29245 posts

    No worries 😊 Glad you’re all set. Please don’t hesitate to post again as needed.

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

ExpressionEngine News!

#eecms, #events, #releases