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 exclude newest entries -- multiple weblogs

June 28, 2007 4:39pm

Subscribe [1]
  • #1 / Jun 28, 2007 4:39pm

    Eric Barstad

    198 posts

    Hi, I thought the offset parameter would do the trick for what I wanted, but not quite.

    I currently have this:

    <h2 class="more">More Writing</h2>
    <ul class="writing">
    {exp:weblog:entries weblog="editorials|fiction" limit="6" orderby="date"}
        <li {switch="class='odd'|"}><a href="http://{url_title_path={weblog_short_name}/article}">{blog_title}: {title}</a></li>
    {/exp:weblog:entries}
    </ul>

    I want this list to show the most recent entries from the editorials and fiction weblogs, except for the newest one in each blog. Using offset=“2”, for example, just takes off the newest entries by date, regardless of weblog. But what I want is for the list to exclude the newest fiction entry and the newest editorials entry. Possible?

  • #2 / Jun 28, 2007 5:38pm

    Eric Barstad

    198 posts

    Doesn’t affect my question above, but I guess you can’t use {url_title_path={weblog_short_name}/article}—blast!

    Edit: Went with Lisa’s suggestion in this post: {comment_url_title_auto_path}

  • #3 / Jul 03, 2007 12:57pm

    Eric Barstad

    198 posts

    silenz had posted a really clever solution to a similar problem, using embed variables to do what I wanted. Because of how my templates were set up, it didn’t work for me, so what I ended up doing was this:

    index.php

    {embed="includes/header"}
    {embed="includes/masthead"}
    {embed="includes/sidebar-1"}
    
    <h2 class="editorial">Editorial</h2>
    {exp:weblog:entries weblog="editorials" limit="1" orderby="date"}
       <?php define("article1", "{entry_id}") ?>
       <h3><a href="http://{url_title_path=editorials/article}">{title}</a></h3>
    <p>   {if article_image != ""}<br />
          {article_image_thumb}<br />
       {/if}<br />
       {exp:char_limit total="230"}<br />
          {body}<br />
       {/exp:char_limit}<br />
       <br />
       <a href="http://{url_title_path=editorials/article}class=continue">Continue Reading</a><br />
    {/exp:weblog:entries}<br />
        <br />
    <h2 class="fiction">Fiction</h2><br />
    {exp:weblog:entries weblog="fiction" limit="1" orderby="date"}<br />
       <?php define("article2", "{entry_id}") ?><br />
      </p><h3><a href="http://{url_title_path=fiction/article}">{title}</a></h3>
    <p>   {if article_image != ""}<br />
          {article_image_thumb}<br />
       {/if}<br />
       {exp:char_limit total="230"}<br />
          {body}<br />
       {/exp:char_limit}<br />
       <br />
       <a href="http://{url_title_path=fiction/article}class=continue">Continue Reading</a><br />
    {/exp:weblog:entries}</p>
    
    <p>{embed="includes/footer"}

    sidebar-2.php

    <div id="sidebar-2">
            
            <h2 class="more">More Writing</h2>
            <ul class="writing">
            {exp:weblog:entries weblog="editorials|fiction" limit="6" orderby="date" entry_id="not <?=article1?>|<?=article2?>"}
                <li {switch="class='odd'|"}><a href="http://{comment_url_title_auto_path}">{blog_title}: {title}</a></li>
          {/exp:weblog:entries}
            </ul>
       </div><!-- /sidebar-2 -->

    index.php is set for php on output and sidebar-2.php is set for php on input.

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

ExpressionEngine News!

#eecms, #events, #releases