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.

Use entry tags inside {exp:weblog:entries} attributes?

December 17, 2009 11:31pm

Subscribe [1]
  • #1 / Dec 17, 2009 11:31pm

    Ludwig Wendzich

    47 posts

    I’ve setup a Configuration weblog so that content admins have access to easily change some settings; such as how many news items appear on the home page.

    My question is how do I get the field value from that weblog into the attributes for a {exp:weblog:entries} loop.

    I currently have:

    {exp:weblog:entries weblog="config" url_title="config"}
    <div id="about">
    {exp:weblog:entries weblog="page" dynamic="off" url_title="home"}
    {page_content}
    {/exp:weblog:entries}
    </div>
    <div id="events">
    <h3>Upcoming Events</h3>
    <p><ul>{exp:weblog:entries weblog="event" limit='{upcoming_number}' dynamic="off" show_future_entries="yes" sort="asc" orderby="entry_date" start_on="{current_time format='%Y-%m-%d 00:00'}"}<br />
    <li><a href="http://{path=pages/event}{entry_id}">{title}</a> <span class="date">{entry_date format="%j %M"}</span></li><br />
    {/exp:weblog:entries}</ul><br />
    </div><br />
    <div id="news"></p><h3>Latest News</h3>
    <p>{exp:weblog:entries weblog="news" dynamic="off" limit="{news_number}"}</p><h4><a href="http://{title_permalink=pages/story}">{title}</a></h4>
    <h5>{entry_date format="%l, %j %F, %y"}</h5>
    <p>{exp:char_limit total="300"}<br />
    {news_content}<br />
    {/exp:char_limit}<br />
    <a href="http://{title_permalink=pages/story}">continue reading</a><br />
    {/exp:weblog:entries}<br />
    </div><br />
    {/exp:weblog:entries}

    This gives the following error:

    MySQL ERROR:

    Error Number: 1064

    Description: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘{upcoming_number}’ at line 2

    Query: SELECT t.entry_id FROM exp_weblog_titles AS t LEFT JOIN exp_weblogs ON t.weblog_id = exp_weblogs.weblog_id LEFT JOIN exp_members AS m ON m.member_id = t.author_id WHERE t.entry_id !=’’ AND t.site_id IN (‘1’) AND (t.expiration_date = 0 || t.expiration_date > 1261059854) AND exp_weblogs.is_user_blog = ‘n’ AND t.weblog_id = ‘5’ AND t.entry_date >= ‘1261004416’ AND t.status = ‘open’ ORDER BY t.sticky desc, t.entry_date asc LIMIT 0, {upcoming_number}

    Any advice would help,
    Thanks 😊

  • #2 / Dec 18, 2009 1:32am

    Ludwig Wendzich

    47 posts

    Ahh! Solved with {embed="path/to" variable1="" variable2=""}

  • #3 / Dec 18, 2009 1:33am

    John Henry Donovan

    12339 posts

    No problems, glad you found a solution. 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