Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2011-04-08 08:35:59

tye
Member
From: Pottsville, NSW
Registered: 2005-07-06
Posts: 859
Website

Section Page --> Sticky article, custom articles, articles

I’ve got a section intro page – on this page I have in the following order:

sticky article
custom_article – cat 1
custom_article – cat2
article_list – cat3

The sticky article works as it should, by disappearing when any of the other links on the page are clicked.

The custom_articles stay at the top of the page when any other link is clicked.

All links are article intros which link to the main article.

I’ve tried several conditionals (if_article_list, if_individual_article, if_article_category) – but I can’t seem to remove them.

I did achieve this by putting them in the form for the sticky article – that worked… but I was wondering if there is another way?

The 2 custom articles are like Feature Articles, so I did think of using smd_featured, but it would be over kill for this site, and the article changes often.

Any enlightenment from anyone?

I’m sure (but cold be wrong) that this is acheivable using txp tags only

Offline

#2 2011-04-08 11:27:00

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

Re: Section Page --> Sticky article, custom articles, articles

It’s hard to tell what is wrong or what could be improved if we don’t know the code you used ;) Can you please post it?

Last edited by els (2011-04-08 11:28:20)

Offline

#3 2011-04-08 12:53:15

tye
Member
From: Pottsville, NSW
Registered: 2005-07-06
Posts: 859
Website

Re: Section Page --> Sticky article, custom articles, articles

Sorry – of course, this is what I have now.

Page template:

<txp:if_article_list>
<txp:article limit="1" status="sticky" form="waiting-intro" />
</txp:if_article_list>
<txp:if_category>
<txp:category title="1" link="1" wraptag="h2" />
</txp:if_category>
<txp:article category="sculps" form="waiting-listing" limit="10" pageby="10" />

waiting-intro Form

<h1><txp:title /></h1>
<txp:body />
<div class="sectionfeatured">
<txp:article_custom section="arts"  category="coming" limit="1" />
</div>
<div class="sectionfeatured">
<txp:article_custom section="arts" category="arrived" limit="1" />
</div>

Offline

#4 2011-04-08 19:10:13

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

Re: Section Page --> Sticky article, custom articles, articles

Putting the article_custom tags in the sticky article’s form is one way to achieve what you want. This is another (if I understand correctly what you are trying to do):

<txp:if_article_list>
   <txp:if_category>
      <!-- category page -->
      <txp:category title="1" link="1" wraptag="h2" />
      <txp:article form="waiting-listing" limit="10" />
   <txp:else />
      <!-- section landing page -->
      <txp:article limit="1" status="sticky" form="waiting-intro" />
      <div class="sectionfeatured">
      <txp:article_custom section="arts" category="coming" limit="1" />
      </div>
      <div class="sectionfeatured">
      <txp:article_custom section="arts" category="arrived" limit="1" />
      </div>
      <txp:article_custom category="sculps" form="waiting-listing" limit="10" />
   </txp:if_category>
<txp:else />
   <!-- individual article page -->
   <txp:article />
</txp:if_article_list>

Does this – more or less – do what you need?

Note that there is no attribute category for <txp:article />; what the tag displays depends on the context. On a category page: articles from that category; on a section page: articles from that section; on an individual article page: that individual article. A category or section attribute wouldn’t do anything here.

Offline

#5 2011-04-11 03:43:24

tye
Member
From: Pottsville, NSW
Registered: 2005-07-06
Posts: 859
Website

Re: Section Page --> Sticky article, custom articles, articles

Hey Els – that pretty much fixed it :)

I had to add a few extra tags of my own, but your code made me get more adventurous with tags.

If even have a if_category within an if_category – I wasn’t aware you could do that

Thanks for your cunning use of txp tags :)

Offline

Board footer

Powered by FluxBB