Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
same form outputting differently from one page to another
The simplest way to describe this problem is probably through illustration:
countries page: http://12bakers.com/sheladia/countries#Haiti
category page: http://12bakers.com/sheladia/category/Haiti/
Those two pages are drawing on the same articles, but on the countries page, it correctly prints the 3 sections: Agriculture, Transportation, Water Resources, and a total of 5 articles.
On the category page, it prints the Water Resources section twice (bad!), though still correctly printing a total of five articles. Why would that section be split/repeated?
The form I’m using to produce this (on the category page) is:
<blockquote><code><txp:if_different><txp:category2 /></txp:if_different>
<txp:if_different><h3><txp:section link=“1” title=“1” /></h3></txp:if_different>
<txp:permlink><txp:title /></txp:permlink></code></blockquote>
The form for the countries page is essentially the same:
<blockquote><code><txp:if_different><h3 id=”<txp:category2 />”><txp:category2 link=“y” title=“1” /></h3></txp:if_different>
<txp:if_different><h4><txp:section link=“1” title=“1” /></h4></txp:if_different>
<txp:permlink><txp:title /></txp:permlink></code></blockquote>
They really should produce the same thing.
I have tried taking the exact contents of the countries form and replaced the category form with it.. but Water Resources still repeats. Is there something unique about being on a category page that would cause this? (Same problem with Egypt and some others…)
I updated to the very latest 4.0 revision of Textpattern (rev 1810), though I also tried an older copy of Textpattern. No difference. Am currently with the rev1810.
I am quite stuck. :-/ Any ideas would be much appreciated.
textpattern.org :: find and share Textpattern resources
docs.textpattern.io :: Textpattern user documentation
Offline
#2 2006-09-12 06:08:01
- zem
- Developer Emeritus

- From: Melbourne, Australia
- Registered: 2004-04-08
- Posts: 2,579
Re: same form outputting differently from one page to another
Does one of the articles have Override Form set?
Take a look at the tag trace. You should be able to see each if_different call, and whether it evaluates to true or false. That might shed some light.
Alex
Offline
Re: same form outputting differently from one page to another
no Override Form..
Thanks for that suggestion Zem… I’ve never tried to view a tag trace before.
Well, this is what I got:
<blockquote><code><txp:if_category>
[<txp:if_category>: true]
<txp:category title=“1” />
<txp:article form=”@projectbycat” sortby=“Category2” sortdir=“asc” limit=“9999” />
[SQL (0.004034): select name from txp_section where on_frontpage != ‘1’]
[SQL (0.232556): select count(*) from textpattern where 1 and Status=‘4’ and Posted <= now() and ((Category1=‘haiti’) or (Category2=‘haiti’)) and Section != ‘about’ and Section != ‘projects’ and Section != ‘countries’]
[SQL (0.016984): select *, unix_timestamp(Posted) as uPosted from textpattern where 1 and Status=‘4’ and Posted <= now() and ((Category1=‘haiti’) or (Category2=‘haiti’)) and Section != ‘about’ and Section != ‘projects’ and Section != ‘countries’ order by Category2 asc limit 0, 9999]
[SQL (0.009883): select Form from txp_form where name=’@projectbycat’]
[Form: @projectbycat]
[article 44]
<txp:if_different>
[<txp:if_different>: true]
<txp:category2/>
</txp:if_different>
<txp:if_different>
[<txp:if_different>: true]
<txp:section link=“1” title=“1” />
[SQL (0.009322): select title from txp_section where name=‘sagri’]
</txp:if_different>
<txp:permlink>
<txp:title/>
</txp:permlink>
[article 97]
<txp:if_different>
[<txp:if_different>: true]
<txp:category2/>
[<txp:if_different>: false]
</txp:if_different>
<txp:if_different>
[<txp:if_different>: true]
<txp:section link=“1” title=“1” />
[SQL (0.008882): select title from txp_section where name=‘swater’]
</txp:if_different>
<txp:permlink>
<txp:title/>
</txp:permlink>
[article 211]
<txp:if_different>
[<txp:if_different>: true]
<txp:category2/>
[<txp:if_different>: false]
</txp:if_different>
<txp:if_different>
[<txp:if_different>: true]
<txp:section link=“1” title=“1” />
[SQL (0.000103): select title from txp_section where name=‘strans’]
</txp:if_different>
<txp:permlink>
<txp:title/>
</txp:permlink>
[article 212]
<txp:if_different>
[<txp:if_different>: true]
<txp:category2/>
[<txp:if_different>: false]
</txp:if_different>
<txp:if_different>
[<txp:if_different>: true]
<txp:section link=“1” title=“1” />
[<txp:if_different>: false]
</txp:if_different>
<txp:permlink>
<txp:title/>
</txp:permlink>
[article 246]
<txp:if_different>
[<txp:if_different>: true]
<txp:category2/>
[<txp:if_different>: false]
</txp:if_different>
<txp:if_different>
[<txp:if_different>: true]
<txp:section link=“1” title=“1” />
</txp:if_different>
<txp:permlink>
<txp:title/>
</txp:permlink>
</txp:if_category></code></blockquote>
so I see <code>select title from txp_section where name=‘swater’]</code> there once…. but why is Water Resources printing twice? article 97 and article 246…
textpattern.org :: find and share Textpattern resources
docs.textpattern.io :: Textpattern user documentation
Offline
#4 2006-09-12 07:37:07
- zem
- Developer Emeritus

- From: Melbourne, Australia
- Registered: 2004-04-08
- Posts: 2,579
Re: same form outputting differently from one page to another
why is Water Resources printing twice? article 97 and article 246…
There are two other articles between those.
Alex
Offline
Re: same form outputting differently from one page to another
Right.. the two Transportation articles.
But why does the same code that produces this double Water Resources output on this category page,
then comes through nicely with this: http://12bakers.com/sheladia/countries#Haiti and doesn’t break up/repeat Water Resources?
:-/
hmm… okay.. this might be a simple sorting issue, right? *goes to try that*
textpattern.org :: find and share Textpattern resources
docs.textpattern.io :: Textpattern user documentation
Offline
Re: same form outputting differently from one page to another
….
well don’t I feel terribly intelligent.
simply adding the word “Section” to the <code>sortby</code> in my article tag solved the whole thing very simply:
<blockquote><code><txp:article form=”@projectbycat” sortby=“Category2,Section” sortdir=“asc” limit=“9999” /></code></blockquote>
Thank you very much for the mind-bending :)
textpattern.org :: find and share Textpattern resources
docs.textpattern.io :: Textpattern user documentation
Offline