Troubles with Weblog Category Archive Tag
Posted: 04 July 2008 06:42 AM   [ Ignore ]  
Summer Student
Total Posts:  11
Joined  07-04-2008

Hi, I am quite new to EE (started yesterday) and love it. Of course I am finishing my first site and now encounter my first real problem.

My goal is to build a list of Articles ordered by Categories, the code I would expect is this :

<div class="concept">
    <
h4>concept</h4>
    <
ol>
        <
li><a href="#">concept article title</a></li>
        <
li><a href="#">concept article title 2</a></li>
    </
ol>
</
div>
<
div class="design">
    <
h4>design</h4>
    <
ol>
        <
li><a href="#">design article title</a></li>
    </
ol>
</
div>
<
div class="code">
    <
h4>code</h4>
    <
ol>
        <
li><a href="#">code article title</a></li>
    </
ol>
</
div>

I don’t see a way to do this with the weblog:category_archive since I need it to loop on the extra chunk that is the container div.

Any suggestion ?

Profile
 
 
Posted: 04 July 2008 08:51 AM   [ Ignore ]   [ # 1 ]  
Summer Student
Total Posts:  11
Joined  07-04-2008

I found a solution, not a really pretty one since it isn’t DRY at all. I hope to find something more elegant later :

<div class="searchArticlesResults">
    
{exp:weblog:category_archive weblog="articles" show="1" show_empty="yes" style="linear"}
    {categories}
    
<div class="{category_name}">
        <
h4>{category_name}</h4>
        <
ul>
    
{/categories}
    {entry_titles}
        
<li><a href="{path=">{title}</a></li>
    
{/entry_titles}
    {
/exp:weblog:category_archive}
        
</ul>
    </
div>
    
{exp:weblog:category_archive weblog="articles" show="2" show_empty="yes" style="linear"}
    {categories}
    
<div class="{category_name}">
        <
h4>{category_name}</h4>
        <
ul>
    
{/categories}
    {entry_titles}
        
<li><a href="{path=">{title}</a></li>
    
{/entry_titles}
    {
/exp:weblog:category_archive}
        
</ul>
    </
div>
    
{exp:weblog:category_archive weblog="articles" show="3" show_empty="yes" style="linear"}
    {categories}
    
<div class="{category_name}">
        <
h4>{category_name}</h4>
        <
ul>
    
{/categories}
    {entry_titles}
        
<li><a href="{path=">{title}</a></li>
    
{/entry_titles}
    {
/exp:weblog:category_archive}
        
</ul>
    </
div>
</
div>

Profile
 
 
Posted: 14 July 2008 06:31 PM   [ Ignore ]   [ # 2 ]  
Summer Student
Total Posts:  4
Joined  07-14-2008

I have the exact same issue.  I need to build <ul>lists of articles that are contained in a “category” div.  This should be a relatively simple task IMHO.

At least three members have posted the same basic question in the last week, w/ no eloquent solutions found.  I’m not seeing much flexibility in the category_archive tag.  Tags can’t be nested, correct? 

Are there any useful articles out there on looping and nesting? I’m searching everywhere.  HELP! 

We are very excited about the possibility of using EE for our site but it feels like I’m slamming into limitations right out of the box.  Are we missing something simple?

Thanks!

Profile
 
 
Posted: 14 July 2008 06:52 PM   [ Ignore ]   [ # 3 ]  
Summer Student
Total Posts:  4
Joined  07-14-2008

I just found this wiki article,Category Archives with Custom Fields that shows a solution that works.... but sounds load intensive.

I’d still love to see a more useful category_archive or moare articles on techniques.

Cheers,

Profile
 
 
Posted: 18 July 2008 11:12 AM   [ Ignore ]   [ # 4 ]  
Summer Student
Total Posts:  11
Joined  07-04-2008

Following your finding here is the code I came with. But like it says since it can be quite load intensive I have used the disable function. Anyway once the cache is turned on this shouldn’t be ar real problem.

<div class="searchArticlesResults">
{exp:weblog:category_archive weblog="articles" style="linear"}
  {categories}
  
<div class="{category_name}">
    <
h4>{category_name}</h4>
    <
ul>
    
{exp:weblog:entries weblog="articles" category="{category_id}" sort="desc" disable="categories|custom_fields|member_data|pagination|trackbacks" dynamic="off"}
      
<li><a href="{title_permalink=">{title}</a></li>
    
{/exp:weblog:entries}
    
</ul>
  </
div>
  
{/categories}
{
/exp:weblog:category_archive}
</div>

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 10:33 AM
Total Registered Members: 61035 Total Logged-in Users: 35
Total Topics: 73817 Total Anonymous Users: 15
Total Replies: 398203 Total Guests: 491
Total Posts: 472020    
Members ( View Memberlist )
Newest Members:  Richard DyckEspenshawnblancid3abonnieshulldkrapejleijenaartr309purpleoctopusKlaxson