Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-02-07 11:52:05

Timid&friendly
Member
From: The Netherlands
Registered: 2006-05-28
Posts: 252
Website

<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

#2 2009-02-07 11:57:47

Timid&friendly
Member
From: The Netherlands
Registered: 2006-05-28
Posts: 252
Website

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

#4 2009-02-07 16:36:28

Timid&friendly
Member
From: The Netherlands
Registered: 2006-05-28
Posts: 252
Website

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

#6 2009-02-07 20:35:30

Timid&friendly
Member
From: The Netherlands
Registered: 2006-05-28
Posts: 252
Website

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

#7 2009-02-07 20:42:36

jstubbs
Member
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

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

#8 2009-02-07 21:18:15

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

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”.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

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

#10 2009-02-08 10:42:33

Timid&friendly
Member
From: The Netherlands
Registered: 2006-05-28
Posts: 252
Website

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

#11 2009-02-08 11:17:12

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,376
Website GitHub Mastodon

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:

Offline

#12 2009-02-08 11:49:53

jstubbs
Member
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: <txp:if_article_category> not recognising category

David, try this:

sort="custom_3 asc". Should work.

Offline

Board footer

Powered by FluxBB