Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#25 2010-07-20 15:23:27

GugUser
Member
From: Quito (Ecuador)
Registered: 2007-12-16
Posts: 1,473

Re: How to highlight article title ... !?

What is “info” in the URL (www.redfoxwebdesign.nl/new/info)? An article?

Offline

#26 2010-07-20 17:26:46

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

Re: How to highlight article title ... !?

RedFox wrote:

Eh, no, although there will not be very many new articles, they will come sooner or later. And it can be an article in ‘Inclusief’ or ‘Optioneel’ … so, what to do … !?

So are you always showing the most recent article on the landing page then? I’m trying to find out how you determine which article appears on the landing page, you need to know what to check for to find out which conditional to use.

Edit: I may have an idea, but I think it can only work if the sort order of the articles in the side menu is the same as the sort order in your article tag in the main content.

@GugUser: ‘info’ is a section.

Edit again: I think I found it! What is your article tag to display the article on the landing page?

Last edited by els (2010-07-20 17:47:28)

Offline

#27 2010-07-20 19:21:53

RedFox
Member
From: Netherlands
Registered: 2005-03-25
Posts: 809
Website

Re: How to highlight article title ... !?

The article tag > <txp:article limit="1" form="singleplus" sort="position asc" />

I’m using sort=“position asc” because of stm_article_order … so I can sort the articles as I wish … and that could change by the day!

Offline

#28 2010-07-20 19:27:42

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

Re: How to highlight article title ... !?

Code edited to replace category1 (d’oh!) with category

OK, I’m not 100% certain it will work, but could you give this a try?

<txp:category_list categories="inclusief,optioneel" break="">
   <h4><txp:category title="1" /></h4>
   <txp:if_individual_article>
      <txp:article_custom section="info" category='<txp:category />' sort="position asc" wraptag="ol" class="titles">
         <li<txp:if_article_id> class="active"</txp:if_article_id>><txp:permlink><txp:title /></txp:permlink></li>
      </txp:article_custom>
   <txp:else />
      <txp:article_custom section="info" category='<txp:category />' sort="position asc" wraptag="ol" class="titles">
         <li<txp:if_article_id id='<txp:article_custom section="info" limit="1" sort="position asc"><txp:article_id /></txp:article_custom>'> class="active"</txp:if_article_id>><txp:permlink><txp:title /></txp:permlink></li>
      </txp:article_custom>
   </txp:if_individual_article>
</txp:category_list>

I’m not sure if the txp:article_custom tag inside the id attribute can be replaced by <txp:article limit="1" sort="position asc">, you could try that as well.

Last edited by els (2010-07-20 20:11:57)

Offline

#29 2010-07-20 19:40:27

RedFox
Member
From: Netherlands
Registered: 2005-03-25
Posts: 809
Website

Re: How to highlight article title ... !?

And the results are:

“Tag foutmelding <txp:category1 title=“1” /> -> Textpattern Notice: Artikel tags kunnen niet buiten hun eigen context gebruikt worden on line 2175” (2x)

With <txp:article limit="1" sort="position asc"> the results are:

“Tag foutmelding <txp:category1 title=“1” /> -> Textpattern Notice: Artikel tags kunnen niet buiten hun eigen context gebruikt worden on line 2175” (2x)

With the same visual context >

So … it works! You’re great … only we have tag errors and there are empty <h4>‘s!

Last edited by RedFox (2010-07-20 19:41:16)

Offline

#30 2010-07-20 19:43:18

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

Re: How to highlight article title ... !?

Ah of course. Sorry! One minute please…

D’oh! The category1 was a left-over from an earlier experiment… Try changing it to <txp:category>.

Last edited by els (2010-07-20 19:44:44)

Offline

#31 2010-07-20 19:46:35

RedFox
Member
From: Netherlands
Registered: 2005-03-25
Posts: 809
Website

Re: How to highlight article title ... !?

“Sorry” … !? You’re doing a great job … please, you’re my saviour … don’t be sorry. Btw … you’re responding time is very fast … je lijkt ‘de overtoom’ wel … ;-)

Offline

#32 2010-07-20 19:48:14

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

Re: How to highlight article title ... !?

:) Did you notice I added something to my previous post?

Offline

#33 2010-07-20 20:04:41

RedFox
Member
From: Netherlands
Registered: 2005-03-25
Posts: 809
Website

Re: How to highlight article title ... !?

Eh … well … <txp:category /> did the trick … ;-)

And with this >

… it’s perfect!

Thank you so much. It sure is an intelligent peace of code … :)

<txp:category_list categories="inclusief,optioneel" break="">
   <h4><txp:category /></h4>
   <txp:if_individual_article>
      <txp:article_custom section="info" category='<txp:category />' sort="position asc" wraptag="ol" class="titles">
         <li<txp:if_article_id> class="active"</txp:if_article_id>><txp:permlink><txp:title /></txp:permlink></li>
      </txp:article_custom>
   <txp:else />
      <txp:article_custom section="info" category='<txp:category />' sort="position asc" wraptag="ol" class="titles">
         <li<txp:if_article_id id='<txp:article limit="1" sort="position asc"><txp:article_id /></txp:article_custom>'> class="active"</txp:if_article_id>><txp:permlink><txp:title /></txp:permlink></li>
      </txp:article_custom>
   </txp:if_individual_article>
</txp:category_list>

Last edited by RedFox (2010-07-20 20:06:56)

Offline

#34 2010-07-20 20:08:59

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

Re: How to highlight article title ... !?

RedFox wrote:

And with this >

… it’s perfect!

Hey, it should be the other way around: section and category names should be all lowercase, titles can have capitals. And then use <txp:category title="1" />.

Last edited by els (2010-07-20 20:09:53)

Offline

#35 2010-07-20 20:11:10

RedFox
Member
From: Netherlands
Registered: 2005-03-25
Posts: 809
Website

Re: How to highlight article title ... !?

I’ve tried, but it doesn’t work … or am I missing something here?

[edit]
With <txp:category title="1" /> it’s ok … :) … thanks again!

Last edited by RedFox (2010-07-20 20:16:11)

Offline

#36 2010-07-20 20:18:02

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

Re: How to highlight article title ... !?

Sorry, I shouldn’t keep editing my posts ;)

Offline

Board footer

Powered by FluxBB