Showing weblog content within a category listing
Posted: 21 January 2008 09:47 AM   [ Ignore ]  
Lab Assistant
Avatar
RankRank
Total Posts:  247
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 11:19 AM   [ Ignore ]   [ # 1 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  247
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 03:04 PM   [ Ignore ]   [ # 2 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  247
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 06:00 PM   [ Ignore ]   [ # 3 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  164
Joined  06-27-2007

Does this help?

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

 Signature 

Me and Mine
twitter
VisionPoint Marketing

Profile
 
 
Posted: 21 January 2008 06:41 PM   [ Ignore ]   [ # 4 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  671
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

 Signature 

Terry Leigh Britton
http://twitter.com/TerryBritton
http://twitter.com/Terr_ee

Search the web using Terry Leigh Britton to find all kinds of stuff I’m into!
Or use Yasni for Terry Leigh Britton

Profile
 
 
Posted: 22 January 2008 07:49 AM   [ Ignore ]   [ # 5 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  247
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 02:35 PM   [ Ignore ]   [ # 6 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  671
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

 Signature 

Terry Leigh Britton
http://twitter.com/TerryBritton
http://twitter.com/Terr_ee

Search the web using Terry Leigh Britton to find all kinds of stuff I’m into!
Or use Yasni for Terry Leigh Britton

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 1743, on December 02, 2009 03:47 PM
Total Registered Members: 120421 Total Logged-in Users: 73
Total Topics: 126520 Total Anonymous Users: 55
Total Replies: 665279 Total Guests: 342
Total Posts: 791799    
Members ( View Memberlist )