Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Need some help with <txp:if_individual_article>!
On this landingpage (only tested in Firefox!) > www.redfoxwebdesign.nl/new/info the lists in the sidebar are contructed as follows >
<h4>Inclusief:</h4>
<txp:if_individual_article>
<txp:article_custom section="info" category="inclusief" sort="position asc">
<txp:if_first_article><ol class="titles"></txp:if_first_article>
<li<txp:if_article_id> class="active"</txp:if_article_id>><txp:permlink><txp:title /></txp:permlink></li>
<txp:if_last_article></ol></txp:if_last_article>
</txp:article_custom>
<txp:else />
<txp:article_custom section="info" category="inclusief" sort="position asc">
<txp:if_first_article><ol class="titles"></txp:if_first_article>
<li<txp:if_first_article> class="active"</txp:if_first_article>><txp:permlink><txp:title /></txp:permlink></li>
<txp:if_last_article></ol></txp:if_last_article>
</txp:article_custom>
</txp:if_individual_article>
<h4>Optioneel:</h4>
<txp:if_individual_article>
<txp:article_custom section="info" category="optioneel" sort="position asc">
<txp:if_first_article><ol class="titles"></txp:if_first_article>
<li<txp:if_article_id> class="active"</txp:if_article_id>><txp:permlink><txp:title /></txp:permlink></li>
<txp:if_last_article></ol></txp:if_last_article>
</txp:article_custom>
<txp:else />
<txp:article_custom section="info" category="optioneel" sort="position asc">
<txp:if_first_article><ol class="titles"></txp:if_first_article>
<li<txp:if_first_article> class="active"</txp:if_first_article>><txp:permlink><txp:title /></txp:permlink></li>
<txp:if_last_article></ol></txp:if_last_article>
</txp:article_custom>
</txp:if_individual_article>
And as you can see there are two (2) ‘active’ titles. Now the question is, what must I do to make one (1) title ‘active’ depending on the cat (‘inclusief’ or ‘exclusief’) of the article (on the landingpage!)? Thanks for any help!
Offline
Re: Need some help with <txp:if_individual_article>!
Hi redfox
Have you tried to use the tag
<txp:if_category name="inclusif">
in your code, i think it can solve your problem
Offline
Re: Need some help with <txp:if_individual_article>!
Dragondz > Yes, I did … but I can’t find a place where it does the job as wanted!
Offline
Re: Need some help with <txp:if_individual_article>!
I havent understund what you are trying to do?
Are you meaning : only one h4 title must be displayed depending on individual article?
Where “exclusief” category code, i see inclusief and optioneel !
If i understund (i try) you can do this:
<txp:if_individual_article>
<txp:if_category name="inclusief">
<h4>Inclusief:</h4>
<txp:article_custom section="info" category="inclusief" sort="position asc">
<txp:if_first_article><ol class="titles"></txp:if_first_article>
<li<txp:if_article_id> class="active"</txp:if_article_id>><txp:permlink><txp:title /></txp:permlink></li>
<txp:if_last_article></ol></txp:if_last_article>
</txp:article_custom>
</txp:if_category>
<txp:else />
<h4>Inclusief:</h4>
<txp:article_custom section="info" category="inclusief" sort="position asc">
<txp:if_first_article><ol class="titles"></txp:if_first_article>
<li<txp:if_first_article> class="active"</txp:if_first_article>><txp:permlink><txp:title /></txp:permlink></li>
<txp:if_last_article></ol></txp:if_last_article>
</txp:article_custom>
</txp:if_individual_article>
<txp:if_individual_article>
<txp:if_category name="optioneel">
<h4>Optioneel:</h4>
<txp:article_custom section="info" category="optioneel" sort="position asc">
<txp:if_first_article><ol class="titles"></txp:if_first_article>
<li<txp:if_article_id> class="active"</txp:if_article_id>><txp:permlink><txp:title /></txp:permlink></li>
<txp:if_last_article></ol></txp:if_last_article>
</txp:article_custom>
</txp:if_category>
<txp:else />
<h4>Optioneel:</h4>
<txp:article_custom section="info" category="optioneel" sort="position asc">
<txp:if_first_article><ol class="titles"></txp:if_first_article>
<li<txp:if_first_article> class="active"</txp:if_first_article>><txp:permlink><txp:title /></txp:permlink></li>
<txp:if_last_article></ol></txp:if_last_article>
</txp:article_custom>
</txp:if_individual_article>
Offline
Re: Need some help with <txp:if_individual_article>!
Are you meaning : only one h4 title must be displayed depending on individual article?
Yes … it’s ok on every individual article page … but now I want the same thing on the landingpage (Info). A highlighted title of the article shown!
Offline
Re: Need some help with <txp:if_individual_article>!
Hi RedFox
you mean in list mode?
Hum, if you can get the id of the article chown on landing page i think it’s possible, you can get the id by putting it in a txp:variable eg: in landing page make in the form you use to display the article: <txp:variable name=“mainid” value=’<txp:article_id />’ />
and in you title column make for ex:
<txp:article_custom section="info" category="optioneel" sort="position asc">
<txp:if_first_article><ol class="titles"></txp:if_first_article>
<txp:if_variable name="mainid" value='<txp:article_id />'>
<li class="highlight<txp:if_first_article>,active</txp:if_first_article>"><txp:permlink><txp:title /></txp:permlink></li>
<txp:else />
<li<txp:if_first_article> class="active"</txp:if_first_article>><txp:permlink><txp:title /></txp:permlink></li>
</txp:if_variable>
<txp:if_last_article></ol></txp:if_last_article>
</txp:article_custom>
NB: not tested
Offline
Re: Need some help with <txp:if_individual_article>!
Dragondz a écrit:
Hi RedFox
you mean in list mode?
Hum, if you can get the id of the article chown on landing page i think it’s possible, you can get the id by putting it in a txp:variable eg: in landing page make in the form you use to display the article: <txp:variable name=“mainid” value=’<txp:article_id />’ />
and in you title column make for ex:
<txp:article_custom section="info" category="optioneel" sort="position asc">
<txp:if_first_article><ol class="titles"></txp:if_first_article>
<txp:if_variable name="mainid" value='<txp:article_id />'>
<li class="highlight<txp:if_first_article>,active</txp:if_first_article>"><txp:permlink><txp:title /></txp:permlink></li>
<txp:else />
<li<txp:if_first_article> class="active"</txp:if_first_article>><txp:permlink><txp:title /></txp:permlink></li>
</txp:if_variable>
<txp:if_last_article></ol></txp:if_last_article>
</txp:article_custom>
NB: not tested and you must save the variable mainid before you call the right column
Offline
Re: Need some help with <txp:if_individual_article>!
See this TXP Tip > txptips.com/highlight-the-active-article-title for more info!
Offline