entries list from “individual” template
Posted: 17 September 2004 09:58 AM   [ Ignore ]  
Grad Student
Rank
Total Posts:  91
Joined  05-21-2004

Hello. EE newcomer from MT here. I’m recoding my site from scratch and am running into difficulty with an “individual” archive template (that’s MT lingo—doesn’t seem to be an EE equivalent).

I have a template created called archives for a blog named etherblog. The archives template is used for individual archives (permalinks). I’d like to have a list of recent entry in the sidebar on this template, but for some reason the code I use only returns one entry.

This is the code I use:

<h3>Recent Posts</h3>
    <
ul class="linklist">
        
{exp:weblog:entries weblog="etherblog" orderby="date" sort="desc" limit="5"}
            
<a href="{path=etherblog/archives}"><li>{title}</li></a>
        
{/exp:weblog:entries}
    
</ul>

This is the same code (minus a summary field) I use to display recent entries on the index page, and it works fine there. Why is it not working on the individual template page?

I did some poking around in the forums and found a post which suggests using the related_entries tag to accomplish the same thing, with the added benefit of excluding the current entry from the list. I do not have entries assigned to categories (yet, and perhaps won’t), so perhaps that doesn’t work either. Related to this, is there a way to specify all categories?

Profile
 
 
Posted: 17 September 2004 11:45 AM   [ Ignore ]   [ # 1 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  9868
Joined  06-19-2002

The issue you’re running into is that the {exp:weblog:entries} tag in your sidebar is restricting its display to the specific entry you’re viewing.  By default, that tag will always restrict itself to whatever’s specified in the URL.

In your case, though, you want to override this so that you can “hardcode” those entries in the sidebar.  That’s easy to do by just adding the dynamic=“off” parameter to the opening tag.  See this entry in the Knowledge-Blog.


> Related to this, is there a way to specify all categories?

Not sure what you mean.  Specify all categories for what?

 Signature 

Chris Curtis
chriscurtis.org

Profile
 
 
Posted: 17 September 2004 12:39 PM   [ Ignore ]   [ # 2 ]  
Grad Student
Rank
Total Posts:  91
Joined  05-21-2004

Thanks, Chris. I’ll give the dynamic setting a shot.

Not sure what you mean. Specify all categories for what?

I read in the manual the following, under related_entries:

If you don’t specify a category the query will show all entries in the same category as the one being viewed. When you add category numbers to the category parameter they will be included or excluded.

So without specifying a category, the entry’s current category will be used as a filter. It would appear that the only way to get EE to use the related tag for all categories would be to hardcode all categories into the template, yes?

I realize that using the related_entries tag for all categories doesn’t really make a lot of sense. That said, it also seems to be the only way to list recent entries without including the currently viewed entry. Am I right on this?


p.s. A few days ago, I accidentally posted to a pMachine topic. I realized today that the reason for this was because I found that topic through the search box at the bottom of the forum topic listing…the results of a search performed in that box returns posts from all forums. While I know that a better way of going about my searches would be to use the advanced search and/or to pay attention to the breadcrumbs at the top of the page, it would perhaps be a good idea to color-code the post boxes for each product. In other words, have posts in the pMachine forum in green and the EE forum posts in blue, and make this consistent in the search results page. This would make a number of things easier, not the least of which would be making sure one posts in the right forum.

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 09:33 AM
Total Registered Members: 64938 Total Logged-in Users: 63
Total Topics: 81908 Total Anonymous Users: 45
Total Replies: 440306 Total Guests: 284
Total Posts: 522214    
Members ( View Memberlist )