Part of the EllisLab Network
pMachine Pro has been replaced by ExpressionEngine, our full featured web publishing solution. Please consider upgrading.
You can download pMachine Pro here: Download pMachine Pro  |  Download Language Packs
   
 
Help with conditional problem?
Posted: 09 March 2005 12:32 PM   [ Ignore ]  
Lab Assistant
RankRank
Total Posts:  105
Joined  2004-01-06

I’ve created a page that lists the titles and descriptions of items in the parent category, followed by the titles and descriptions of items by subcategory.

I have a few conditionals in here to control the display of various bits of field content. This page was working fine until I added the {if PDF==“YES”} sections to both the category and subcategory display.

I can have this conditional in either of these locations with no problem, but when I have the conditional in both locations I get bad output—the list under the subcategory is truncated after the fist title, or I get an extra {/if} tag printing on pages which have no subcategories.

I’ve read through the code over and over and I can’t figure out where I’ve gone wrong… can anyone with fresh eyes see my mistake?

Thanks!


{embed=“resources/header”}


{exp:weblog:category_heading weblog=“resources”}

<P class=“sectionhead”>{category_name}<embed=“global/pdf”}{/if}
</p>

{/exp:weblog:entries}


{if segment_4 != “” }
{exp:query sql=“SELECT cat_id FROM exp_categories WHERE cat_name = ‘{segment_4}’;”}
{exp:query sql=“SELECT cat_name, cat_id AS cat_id2 FROM exp_categories WHERE parent_id = {cat_id} ORDER BY cat_order;”}
<embed=“global/pdf”}{/if}
</p>

{/exp:weblog:entries}


{/exp:query}
{/exp:query}
{/if}

 

{embed=“resources/footer”}

Profile
 
 
Posted: 09 March 2005 12:37 PM   [ Ignore ]   [ # 1 ]  
Lab Assistant
RankRank
Total Posts:  105
Joined  2004-01-06

Um—and here’s the second problem—my code is getting chopped when I try to paste it here. I guess I need suggestions on that first!

Profile
 
 
Posted: 09 March 2005 01:19 PM   [ Ignore ]   [ # 2 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  9868
Joined  2002-06-19

First, you posted this to a pMachine forum, not an ExpressionEngine one.

I’d suggest moving this thead over to the appropriate EE forum so that the appropriate people see it.  In order to display your code right, try just copying it into a plain .txt file on your server and linking to it.

 Signature 

Chris Curtis
chriscurtis.org

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 233, on December 18, 2007 12:04 AM
Total Registered Members: 64512 Total Logged-in Users: 0
Total Topics: 81071 Total Anonymous Users: 0
Total Replies: 436300 Total Guests: 20
Total Posts: 517371    
Members ( View Memberlist )
Newest Members:  acidbluejarencyRizqiRustin PharesnaorshushnMasterNielsenTeksxenulirokaKelvin Wong
Active Members: