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.

How do you "nest" weblogs?

August 27, 2007 7:11pm

Subscribe [4]
  • #1 / Aug 27, 2007 7:11pm

    grrramps

    2219 posts

    I have an interesting issue with EE 1.6.0 and nesting weblogs.

    In my test setup up I created a template as a test page using Weblog “A”, and embedded another template which contains Weblog “B” (nested within Weblog “A” expression). As I expected, the resulting test page displayed content from Weblog “A” followed by content from Weblog “B.”

    {exp:weblog:entries weblog="site" orderby="random" limit="1"}
    {summary}
    {embed="site/promo"}
    {/exp:weblog:entries}

    That works fine on the test page which is a template with an embedded template nested within the weblog [removed]in the test page).

    However, when I drop the {embed="site/promo_entry"} string into the actual content page within the weblog expression, nothing appears. It’s just a blank space with no embedded weblog content.

    Strange that it works appropriately on the test page/template, but not in live content.

    Am I missing something?

  • #2 / Aug 27, 2007 7:42pm

    maadmac

    224 posts

    As I expected, the resulting test page displayed content from Weblog “A” followed by content from Weblog “B.” ...

    Am I missing something?

    Maybe.  If I understand what you’re trying to do—that is, display the content of two different weblogs—then you are better served doing this:

    {exp:weblog:entries weblog="weblog_a|weblog_b"} ... etc.

    You can “pipe” multiple weblogs in the weblog parameter, if that’s all you’re trying to do.  Not sure why the embed worked in the one example, I think actually that may have been a fluke… although to be honest, much of this still mystifies me!

  • #3 / Aug 27, 2007 8:33pm

    grrramps

    2219 posts

    Nope, that doesn’t do it, either, though it sounds plausible. I can drop the Weblog “B” content into a template and embed the template within Weblog “A” and, of course, that works fine.

    For whatever reason, Weblog “B” won’t render on the live page within Weblog “B”.

    It’s gotta be something else. Funny how it renders fine in a test page/template, though.

  • #4 / Aug 28, 2007 1:19am

    Derek Jones

    7561 posts

    Explain, please:

    However, when I drop the {embed="site/promo_entry"} string into the actual content page within the weblog expression,

    And perhaps also give a bigger picture as to why you are doing what you are doing, i.e. why do you want to “nest” the weblogs in the first place?

  • #5 / Aug 28, 2007 1:24am

    grrramps

    2219 posts

    Derek, well the idea is simple: I want content from two weblogs to show up on the same page, within the same entry. Content from Weblog “A” is at the top, with content from Weblog “B” at the bottom. The top is multiple paragraphs, while the bottom is more like a tag paragraph.

    How’s that?

    What’s really odd is that it works fine in a test template, and works fine when rendering the content template (with all the XHTML, EE tags, etc.) in EE’s control panel. But the Weblog “B” template won’t render on the final page.

  • #6 / Aug 28, 2007 1:31am

    Derek Jones

    7561 posts

    Why not use relationships?  I still need to see a greater explanation of which weblog contains what content (it’s unclear to me if the embed is in the template or the entry), as well as what tag parameters you are using, and an example URL (in case url titles / dynamic display is a consideration).  You really haven’t provided enough in the way of tag snippets to be able to ascertain precisely what you have.

  • #7 / Aug 28, 2007 2:03am

    grrramps

    2219 posts

    Derek, here’s a few pieces. More to come. This is the test template:

    {exp:weblog:entries weblog="site" orderby="asc" limit="1"}
    {summary}
    {embed="template_group/promo_entry"}
    {/exp:weblog:entries}

    Here’s the embed template:

    {exp:weblog:entries weblog="promo" orderby="random" limit="1"}
    {promo_entry}
    {/exp:weblog:entries}

    That works fine in the test template and renders appropriately. What you’ll see is a summary, then a promo blurb at the end. That’s what I want. But, the final page won’t render the promo blurb. It leaves a blank space.

    The original page the blurb is going into is a template page with an embedded template for the content (similar to above), and that template has the embedded template for the promo blurb (above).

    The original page is rather complex, with tags for Comments, Pagination, Multi-field, and {embed_ee_code} and so on. To answer your question, the promo blurb is a sentence designed to be placed at the end of an entry. Nothing special or tricky.

    I’ll send you the template code by PM.

  • #8 / Aug 28, 2007 8:23am

    Derek Jones

    7561 posts

    Still a bit hard to follow since I’m not seeing all of the templates involved nor the URLs that they are being accessed at.  Some troubleshooting tips that will help you nail it down:

    1) Turn on the template parser log (Output and Debugging Preferences).  This will help you make sure that the right templates are being called, and that your tags are being picked up.
    2) Add unique text both outside and inside the weblog entries tags on the embedded templates.  This will be visual proof that the embed is being processed, and that the weblog entries tag has results that it will output.  You may also provide an {if no_results} to those weblog entries tags, to alert you if the tag is not producing any results.
    3) Induction testing.  Your test template works, so your reduction test is fine; now it’s time to analyze what’s different about it.  Keep adding things to it one at a time until it matches entirely the template(s) being called by the page you have now that isn’t working.

  • #9 / Aug 28, 2007 8:44am

    silenz

    1651 posts

    Just to exclude the (often not so) obvious. You don’t happen to call your not-working template with an entry_id or url_title in the URL, do you?

    In that case you’d have to add dynamic=“off” to the embedded weblog-tag, as the URL-info would override the order=“random”...

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

ExpressionEngine News!

#eecms, #events, #releases