Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
<txp:if_article_category> not recognising category
<txp:if_article_category name="promise">
<txp:article_custom limit=99999 form="MTS_article_list" sort="id asc" category="promise" />
</txp:if_article_category>
Having problems with the code above not generating list of links with the above category when category is nested child of another category
This category “promise” should be a child category of “wat” category. But when i use this setup for ordering categories, it doesn’t out put the child category for some reason.
If i remove the child category from it’s parent the code then works.
What am i doing wrong?
Using Textpattern versie: 4.0.6 (r2805)
I think, therefore I AM, … … er … I think :-?
Offline
Re: <txp:if_article_category> not recognising category
EDIT ^^ It has nothing to do with nesting child categories. It looks like a bug. It has to do with the assigned categories not working correctly.
I removed the assigned category from select number 2 and placed it in select number 1 and it works again???? pfffff
Last edited by Timid&friendly (2009-02-07 12:12:33)
I think, therefore I AM, … … er … I think :-?
Offline
#3 2009-02-07 13:01:02
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: <txp:if_article_category> not recognising category
if_article_category needs an individual article context, so it has to be in an article form, or in if_individual_article tags. Could that be the problem?
Edit: or did you need if_category instead?
Last edited by els (2009-02-07 13:02:15)
Offline
Re: <txp:if_article_category> not recognising category
Els, as ever a big thx.
This issue was purely an error somewhere in the system and/or the database. By undoing and reassigning the categories the problem was solved. I have had this before am i the only one?
And yes I did try the if_category tag first but this is the one i need. Thx for covering all possibilities.
I think, therefore I AM, … … er … I think :-?
Offline
#5 2009-02-07 16:55:09
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: <txp:if_article_category> not recognising category
Timid&friendly wrote:
By undoing and reassigning the categories the problem was solved. I have had this before am i the only one?
Did you change the category name in between?
BTW, you seem to make a lot of promises:
<txp:if_article_category name="promise">
<txp:article_custom limit=99999
;)
Offline
Re: <txp:if_article_category> not recognising category
Ok i had another go. This my code …
<txp:if_article_category name="embrace">
<txp:if_custom_field name="Aanverwante_links_volgorde">
<txp:asy_wondertag>
<txp:article_custom limit=99999 form="MTS_article_list" sort="<txp:custom_field name="Aanverwante_links_volgorde" /> asc" category="embrace" />
</txp:asy_wondertag>
</txp:if_custom_field>
</txp:if_article_category>
- .. This the error*
tag_error <txp:article_custom limit=99999 form="MTS_article_list" sort="9999 asc" category="embrace" /> -> Textpattern Warning: Unknown column '9999' in 'order clause'
select *, unix_timestamp(Posted) as uPosted from l10n_txp_nl_nl where 1=1 and Status = 4 and Posted <= now() and (Category1 IN ('embrace') or Category2 IN ('embrace')) order by 9999 asc limit 0, 99999 on line 117
Can you see what is wrong?
I think, therefore I AM, … … er … I think :-?
Offline
Re: <txp:if_article_category> not recognising category
If you are using 4.07, you need to enclose this call in double quotes:
<txp:article_custom limit=99999
Should be like this:
<txp:article_custom limit="99999"
Offline
Re: <txp:if_article_category> not recognising category
sort="9999 asc"
Your “Aanverwante_links_volgorde” custom field is returning 9999, is that right? There is no column named “9999”.
Offline
#9 2009-02-08 00:31:47
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: <txp:if_article_category> not recognising category
maniqui wrote:
sort="9999 asc"
Your “Aanverwante_links_volgorde” custom field is returning 9999, is that right? There is no column named “9999”.
Aah! Why didn’t I see that? You need sort="custom_1"
(or whatever number “Aanverwante_links_volgorde” has).
Offline
Re: <txp:if_article_category> not recognising category
If i have understood you correctly then i should change
sort="<txp:custom_field name="Aanverwante_links_volgorde" /> asc"
to the following
sort="<txp:custom_field name="custom_3" /> asc"
because
I get the following error, again sugesting that for some reason my it’s not parsing the custom attribute value correctly?
tag_error <txp:article_custom limit=99999 form="MTS_article_list" sort=" asc" category="embrace" /> -> Textpattern Warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'asc limit 0, 99999' at line 1
select *, unix_timestamp(Posted) as uPosted from l10n_txp_nl_nl where 1=1 and Status = 4 and Posted <= now() and (Category1 IN ('embrace') or Category2 IN ('embrace')) order by asc limit 0, 99999 on line 117
I don’t understand why that would work anyway. Custom_3_set is not called “custom_3” but is called “Aanverwante_links_volgorde”? I am confused.
Jstubbs
thx for the heads up. I am using 4.0.6 still is it all right to use <txp:article_custom limit=99999 ...
?
Last edited by Timid&friendly (2009-02-08 11:03:07)
I think, therefore I AM, … … er … I think :-?
Offline
Re: <txp:if_article_category> not recognising category
Timid&friendly wrote:
If i have understood you correctly then i should change
sort="<txp:custom_field name="Aanverwante_links_volgorde" /> asc"
to the following
sort="<txp:custom_field name="custom_3" /> asc"
Both versions will not work as the use of tags as attributes of other tags requires one of these three choices:
- Textpattern CMS 4.0.7+
- asy_wondertag for Textpattern 4.0.6 and below
- a little bit of PHP to splice tag results into attribute values for Textpattern 4.0.6 and below
Offline
Re: <txp:if_article_category> not recognising category
David, try this:
sort="custom_3 asc"
. Should work.
Offline