Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-02-04 07:34:27

squaredeye
Member
From: Greenville, SC
Registered: 2005-07-31
Posts: 1,495
Website

Get sticky article to sidebar, live article to main column.

Well, its a wee bit more complicated than that. I’m up too late, and this is my last ditch effort at figuring this out.
I want to have an “main-column” article and accompanying “sidebar” article that show up on the section frontpage of “about-us”.

I have individual articles that either display a “default” sidebar article or an excerpt if there is one when the condition for “individual articles” is met.

I am having trouble displaying the “sidebar” article for the section frontpage. Please help :)

Here’s my page: This displays an article on the section frontpage in the main column, and one article in the main column when the condition is “individual article:
<code>
<—-main column—->
<txp:if_section name=“about-us”>
<txp:if_individual_article>
<txp:article limit=“1” />
<txp:else />
<txp:article_custom section=“about-us” category=“front-article” status=“live” />
</txp:if_individual_article>
</txp:if_section>
</code>

Here’s my sidebar form/s: (here’s where its slightly more complicated)
<code>
<——sidebar—->
<txp:if_excerpt>
<txp:excerpt />
<txp:else />

<txp:if_section name=“about-us”> <txp:if_individual_article> <txp:article_custom section=“about-us” form=“sidenote-style” limit=“1” category=“side-note” status=“live” /> <txp:else /> <txp:article_custom section=“about-us” category=“front-side” form=“sidenote-style” status=“sticky” /> </txp:if_individual_article>
</txp:if_section>

</txp:if_excerpt>
</code>

I’m pretty stumped.

Thanks,

Matthew

Last edited by ma_smith (2006-02-04 07:35:35)


Offline

#2 2006-02-04 12:45:16

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Get sticky article to sidebar, live article to main column.

I think it’s the nesting of conditional tags that’s the problem. As far as I know you can’t have another txp:if after a txp:else.

Offline

#3 2006-02-04 12:49:12

squaredeye
Member
From: Greenville, SC
Registered: 2005-07-31
Posts: 1,495
Website

Re: Get sticky article to sidebar, live article to main column.

I started to think that might be the case :(

Any Ideas of how else I might accomplish this.

Thanks for your help Els, as usual.

Matthew


Offline

#4 2006-02-04 13:15:37

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Get sticky article to sidebar, live article to main column.

Would this do what you want?
<code>
<— sidebar —>
</code><code>
<txp:if_section name=“about-us”>
</code><code>
<txp:if_individual_article>
<txp:if_excerpt>
<txp:excerpt />
<txp:else />
<txp:article_custom section=“about-us” form=“sidenote-style” limit=“1” category=“side-note” status=“live” />
</txp:if_excerpt>
</txp:if_individual_article>
</code><code>
<txp:if_article_list>
<txp:article_custom section=“about-us” category=“front-side” form=“sidenote-style” status=“sticky” />
</txp:if_article_list>
</code><code>
</txp:if_section>
</code>

Offline

#5 2006-02-04 13:20:29

squaredeye
Member
From: Greenville, SC
Registered: 2005-07-31
Posts: 1,495
Website

Re: Get sticky article to sidebar, live article to main column.

Els,
I actually went one level too deep with the illustration above. If you remember, yesterday you helped me move to that level, well… I needed to step one level back toward the first article (the illustration above is embedded in that article form). Once I did that I just added an “else” to the initial individual_article statement and viola!

I may try your solution as well though, see if that works. I so rarely us the if_article_list tag, it would be nice to learn some of its functionality.

Cheers,

Matthew


Offline

#6 2006-02-04 13:30:28

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Get sticky article to sidebar, live article to main column.

I so rarely us the if_article_list tag, it would be nice to learn some of its functionality.

As far as I know it’s just the contrary of <txp:if_individual_article>. So instead of
<code>
<txp:if_article_list>
blah
</txp:if_article_list>
</code>
you could also use
<code>
<txp:if_individual_article>
<txp:else />
blah
</txp:if_individual_article>
</code>

Offline

#7 2006-02-04 13:58:57

squaredeye
Member
From: Greenville, SC
Registered: 2005-07-31
Posts: 1,495
Website

Re: Get sticky article to sidebar, live article to main column.

Els,
That’s a great explanation. I never thought of it that way:
I’ve used these conditionals before to get the kind of result I was looking for:
<code>
<txp:if_category>
<txp:else />
<txp:if_individual_article>
<txp:else /> <txp:article form=“front_thumb” sortby=“posted” limit=“4” />
</txp:if_individual_article>
</txp:if_category>
</code>

This was a way of getting section frontpage results before as well.

For what its worth.

M


Offline

Board footer

Powered by FluxBB