Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-03-18 23:21:38

pepebe
Member
From: Mannheim, Germany
Registered: 2005-02-07
Posts: 74

Txp acts suddenly strange

Good evening fellow txp adicts,

midnight is near and so I should expect strange things to happen (some say the place where I live is haunted…).

I have just started txp admin and had a look upon what has been working a few days ago.

The how has been pondered upon here lately: <link>http://forum.textpattern.com/viewtopic.php?id=15222</link>

This is in my template:
<code>
<ul class=“navlist”>
<txp:article_custom sortby=“Section” sortdir=“asc” form=“Linklist_with_class_prop” />
</ul>
</code>

This is the corresponding form:
<code>
<li class=”<txp:section />”><txp:section title=“1” link=“1” /></li>
</code>

What I should get is a neat list like this:
<code>
<ul class=“navlist”>
<li class=“Section 1”><a href=“Section 1.html/”>Section 1</a></li>
<li class=“Section 2”><a href=“Section 2.html/”>Section 2</a></li>
<li class=“Section 3”><a href=“Section 3.html/”>Section 3</a></li>
</ul>
</code>

But what I get is N-O-T-H-I-N-G.

As far as I can remember, I haven’t changed anything. So what happend?

Perhaps I’m allready a bit tired, but I can’t see a problem with the code…

Anyone out there, who can tell me what could be ging on?

Regards,

pepebe

Last edited by pepebe (2006-03-18 23:23:09)

Offline

#2 2006-03-18 23:34:34

Jeremie
Member
From: Provence, France
Registered: 2004-08-11
Posts: 1,578
Website

Re: Txp acts suddenly strange

Try the debug mode, look at what is been parsed and how/where/when.

Offline

#3 2006-03-19 00:36:20

pepebe
Member
From: Mannheim, Germany
Registered: 2005-02-07
Posts: 74

Re: Txp acts suddenly strange

Debug mode? Great thing!!!

The divine debug showed me, that txp included only those sections in it’s result, that had “live” articles (status=‘4’) included. Someday last week, I had changed the production status of all my dummy articles from “live” to “sticky” (status=‘5’). Failed to notice, that there was a problem. Stupid thing.

What I dont understand, is why <code><txp:section /></code> ignores sections that only have “sticky” articles (a common technique in the creation of static pages).

Anyway,

thanks for your help Jeremie!!!

Regards,

pepebe

Last edited by pepebe (2006-03-19 00:37:30)

Offline

#4 2006-03-19 01:09:58

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: Txp acts suddenly strange

pebebe, I wouldnt say that is <txp:section /> the one ignoring sections with sticky articles.

I suggest you to try the following:

<code><ul class=“navlist”>
<txp:article_custom status=“sticky” sortby=“Section” sortdir=“asc” form=“Linklist_with_class_prop” />
</ul></code>
Notices the status="sticky" attribute.

Tell us if that worked.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#5 2006-03-19 10:06:25

pepebe
Member
From: Mannheim, Germany
Registered: 2005-02-07
Posts: 74

Re: Txp acts suddenly strange

Thanks maniqui!

I have included “status=‘sticky’” and finally it worked nearly as intended.

Unfortunately in one section I had two articles set to sticky, so one section showed up 2 times. Had to change the form a little bit and it worked.

Thanks to Stuart (aka thebombsite) this was very easy. He recommended lately to use the if_different tag, but I lacked the wisdom to follow his suggestions…

To sum up, here is the latest version of my linklist

The page template:

<code>
<div class=“navcontainer”>
<ul class=“navlist”>
<txp:article_custom status=“sticky” form=“Linklist_with_class_prop” sortby=“Section” sortdir=“asc” />
</ul>
</code>

The form:

“Linklist_with_class_prop”

<code>
<txp:if_different>
<li class=”<txp:section />”><txp:section title=“1” link=“1”/></li>
</txp:if_different>
</code>

Regards

pepebe

Last edited by pepebe (2006-03-19 11:38:19)

Offline

Board footer

Powered by FluxBB