Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2010-03-28 22:01:01

slabanosa
Member
From: Silva Carbonaria
Registered: 2004-06-01
Posts: 57

combining if_individual_articles if_article_list and sticky pages ?

Hi,

please bear with me, I have been wrapping my head around this but cannot find the solution although I feel it must be fairly simple.
I have a section where I want to output 3 sticky articles as a list on the landing page, no dynamic articles should show up on the landing page.
Dynamic content should show up when individual article or category lists are called from the sidebar

I either get
  • the landing page correctly rendering with 3 static articles but then I cannot get the individual stickies to render or the category list to show up a list of corresponding dynamic articles
  • or a landing page with 3 dynamic articles and everything works fine: categories listings show up, article and sticky pages render correctly when called for just the landing page is wrong.
    here’s what the form looks like now with just the landing wrong (option2)
<txp:if_individual_article>
<!-- retrieving some customfields for layout -->
 <txp:if_custom_field name="Director" >
    <txp:article section="programme" form="filmprog" /> 
 <txp:else />
<!-- this line to render the stickies in individual context -->
   <txp:article section="programme" status="sticky" form="inside_one" />
 </txp:if_custom_field>
<txp:else />
<!-- this line to render category listings and  articles properly -->   
<txp:article  excerpted="1" form="listfilms" section="programme" sort="Title asc" status="4" />
</txp:if_individual_article>

and this is what I would need on my landing section page either in a <txp:if_article_list> or in <txp:if_individual_article> or anything else

<txp:article section="programme" limit="3" status="sticky" form="inside_one" sort="Posted asc"/>

thanks for any hint or insight on how to solve this

Offline

#2 2010-03-28 22:57:20

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

Re: combining if_individual_articles if_article_list and sticky pages ?

Like this?

<txp:if_individual_article>
<!-- retrieving some customfields for layout -->
  <txp:if_custom_field name="Director" >
    <txp:article form="filmprog" /> 
  <txp:else />
<!-- this line to render the stickies in individual context -->
    <txp:article status="sticky" form="inside_one" />
  </txp:if_custom_field>
<txp:else />
  <txp:if_category>
<!-- this line to render category listings and  articles properly -->   
    <txp:article excerpted="1" form="listfilms" sort="Title asc" />
  <txp:else />
    <txp:article limit="3" status="sticky" form="inside_one" sort="Posted asc"/>
  </txp:if_category>
</txp:if_individual_article>

I left out the section attribute, it doesn’t work in article tags. <txp:article /> only ever displays the articles in the current section. You also don’t need status="4" because it’s the default value.

Offline

#3 2010-03-28 23:14:59

slabanosa
Member
From: Silva Carbonaria
Registered: 2004-06-01
Posts: 57

Re: combining if_individual_articles if_article_list and sticky pages ?

well yessss that does seem to work fine, thank you so much Els, I can now go to sleep :-)

Offline

Board footer

Powered by FluxBB