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 to pass a variable from one weblog to another on the same page

April 26, 2011 5:36pm

Subscribe [4]
  • #1 / Apr 26, 2011 5:36pm

    Here’s what I’m trying to do:

    I have a page to list an author’s information, which is contained inside weblog “authors.” On that page, I want to have a list of their recent blog posts, which is inside weblog “blogs.” I am using the segment variable to create the author page on the fly. I have created a field author_cat in order to have the blog show only those assigned to that author’s category. How can I make author_cat appear in category=“author_cat”?

    {exp:weblog:entries weblog="{embed:my_weblog}" limit="1" track_views="one" status="not closed" disable="member_data|trackbacks"}
    <h2>{title}</h2>
    <p>{blog_intro_text}<br />
    {/exp:weblog:entries}</p>
    
    <p><br />
    {exp:weblog:entries weblog="blog_articles" limit="15" status="Blog|Blog Featured" dynamic="on" disable="member_data|pagination" orderby="entry_date" sort="desc" category="{author_cat}"}<br />
        </p><h2><a href="http://{url_title_path=blogs/blog_view}">{title}</a></h2>
    <p>{intro_para}<br />
                 <br />
    {/exp:weblog:entries}

  • #2 / Apr 26, 2011 6:38pm

    Adam Khan

    319 posts

    A couple of messy things in the architecture here. First, there’s no need to use categories if you have a weblog of authors—just add a relationship field inside blog posts where you can select from the Authors weblog. Second, if you do want to use categories as well (which I’d recommend against), then you don’t need the author_cat field as you already have the category.

    These are pretty basic EE concepts so I’d recommend reading some of Boyink’s stuff for nicely-written primers.

  • #3 / Apr 26, 2011 8:43pm

    Thank you so much for pointing me in the right direction. I don’t know why I tried to make it so darn complicated!

  • #4 / Apr 27, 2011 6:51am

    John Henry Donovan

    12339 posts

    Pet Rescue Barbie,

    Are you good to go now or do you require additional help with this?

  • #5 / Apr 27, 2011 10:33am

    All good!

  • #6 / Apr 28, 2011 10:29am

    Sue Crocker

    26054 posts

    Glad to hear. Feel free to start a new thread if you have any more questions.

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

ExpressionEngine News!

#eecms, #events, #releases