Showing weblog content within a category listing
Posted: 21 January 2008 08:47 AM   [ Ignore ]  
Lab Assistant
Avatar
RankRank
Total Posts:  242
Joined  03-08-2007

I am trying to build a page that has the 7 days of the week (my categories) listed as the categories and below that the list of content from the classes weblog to display below the days of the week.. What happens if I don’t put in the if:statement is that the same listing gets put in every day of the week instead of just the day it’s suppose to. I know I am doing the if statement wrong, cause now nothing is showing up…

First I had {if category == ‘category_name’} but that didn’t work either… Am I trying to something that can’t be done?

<div id="content">
{exp:weblog:entries weblog="{my_weblog}" entry_id="21" limit="1" disable="member_data|trackbacks" dynamic="off"}
                        
<h6>{title}</h6>
{body}
{
/exp:weblog:entries}

{exp
:weblog:categories weblog="{classes_weblog}" style="linear"}
<div id="classes-day-left">
                
                                <
h4>{category_name}</h4>
<
ul>
{if category == 'TRUE'}
{exp
:weblog:entries weblog="{classes_weblog}" orderby="time" }
<li>{time format="%g:%i %A"} | {class-name} with {instructor}</li>
{/exp:weblog:entries}
{
/if}
</ul>
</
div>
{/exp:weblog:categories}

                            
            
</div>
 Signature 

Just an artist trying to make it on the WWW

Profile
 
 
Posted: 21 January 2008 10:19 AM   [ Ignore ]   [ # 1 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  242
Joined  03-08-2007

I know I pull the content to another page, but I wanted to try and avoid that… Has anyone tried to do this?

 Signature 

Just an artist trying to make it on the WWW

Profile
 
 
Posted: 21 January 2008 02:04 PM   [ Ignore ]   [ # 2 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  242
Joined  03-08-2007

can anyone tell me what I am doing wrong?

 Signature 

Just an artist trying to make it on the WWW

Profile
 
 
Posted: 21 January 2008 05:00 PM   [ Ignore ]   [ # 3 ]  
Grad Student
Rank
Total Posts:  79
Joined  06-27-2007

Does this help?

http://expressionengine.com/forums/viewthread/68946/

 Signature 

Me

Profile
 
 
Posted: 21 January 2008 05:41 PM   [ Ignore ]   [ # 4 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  653
Joined  06-29-2005

Try my little changes and see if it works.

<div id="content">
{exp:weblog:entries weblog="{my_weblog}" entry_id="21" limit="1" disable="member_data|trackbacks" dynamic="off"}
                        
<h6>{title}</h6>
{body}
{
/exp:weblog:entries}

<div id="classes-day-left">



<
ul>
{exp:weblog:entries weblog="{classes_weblog}" orderby="time" category="{category_id}"}

{categories}
{if count
== "1"
                
                                
<h4>{category_name}</h4>
{/if}
{
/categories}

<li>{time format="%g:%i %A"} | {class-name} with {instructor}</li>
{/exp:weblog:entries}

</ul>
</
div>


                            
            </
div>

You also might want to study on what I’ve got working so far in this other thread. It uses an embedded template to show multiple categories and custom_category_fields as headings. Entries are nested differently in that example, with an exp:weblog:entries tag actually placed BETWEEN the {categories} tag pair of the parent exp:weblog:entries tags.
(sample page here)

Terry

Profile
 
 
Posted: 22 January 2008 06:49 AM   [ Ignore ]   [ # 5 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  242
Joined  03-08-2007

It didn’t work… But I think I might be able to figure it out.. I noticed that the {if} statement wasn’t closed, so I closed that and it still didn’t work. I feel that I am a bit closer though to my goal! smile Thank you!

 Signature 

Just an artist trying to make it on the WWW

Profile
 
 
Posted: 22 January 2008 01:35 PM   [ Ignore ]   [ # 6 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  653
Joined  06-29-2005

Let us know what you discover!

As I mentioned, in that other page I had to use an embedded template to accomplish what I wanted, and I’m finding that technique (especially passing embed:variables)is constantly allowing me to do otherwise impossible things. So, perhaps give that a try!

Terry

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: 77506 Total Logged-in Users: 21
Total Topics: 101526 Total Anonymous Users: 20
Total Replies: 544276 Total Guests: 272
Total Posts: 645802    
Members ( View Memberlist )