Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#796 2011-02-25 09:25:35

philwareham
Core designer
From: Haslemere, Surrey, UK
Registered: 2009-06-11
Posts: 3,565
Website GitHub Mastodon

Re: glz_custom_fields

@liamdempsey

I think you need to specify if you want the sort in ascending or descending order too, so for example…

sort="custom_13 asc"

Also, depending on how many articles you plan to have in your list, you may want to put a leading zero on your numbers. I think currently your priorities would go 1,10,11,2,3 etc. With a leading zero it would be 01,02,03,10,11.

Last edited by philwareham (2011-02-25 09:25:44)

Offline

#797 2011-02-25 12:37:19

liamdempsey
Member
From: Philadelphia, PA
Registered: 2009-09-16
Posts: 10
Website

Re: glz_custom_fields

@philwareham

Thanks for the advice and the quick reply! I tried adding both the ‘asc’ and the leading zero … alas to no avail. It’s still not ordering the display of the custom articles in the hoped for way.

Offline

#798 2011-02-25 12:41:56

philwareham
Core designer
From: Haslemere, Surrey, UK
Registered: 2009-06-11
Posts: 3,565
Website GitHub Mastodon

Re: glz_custom_fields

@liamdempsey

That’s strange, I use a similar method for article priority sorting on one of my site, as follows…

<txp:article_custom form="your_form" sort="custom_13 asc" section="your_section" limit="999" />

Offline

#799 2011-02-25 12:58:34

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,316

Re: glz_custom_fields

For much easier sorting than by adding numbers in form fields I’d recommend stm_article_order which comes with drag’n‘drop.


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#800 2011-02-25 13:02:41

alanfluff
Member
From: Ottawa, Canada
Registered: 2008-09-15
Posts: 222
Website

Re: glz_custom_fields

@liamdempsey

For simple sorts I also do what @philwareham does (just checked some source to be sure).

Can you see what the order is — for example if you re-save one of the Articles that is not found first, but with the Reset Time to now option ticked then re-load the page, does the order change? Another thing that’s tripped me up recently is the heavy caching in Chrome, if stuck I often now dump all cache from ano browser, Safari say, then try the weird thing there too.

Good luck, cheers, -Alan


At LAST I’ve cheerfully donated to the core devs at #TXP. I only wish I were able to give more. Thanks to the devs and ALL fellow TXPers. -A

Offline

#801 2011-02-25 16:52:03

liamdempsey
Member
From: Philadelphia, PA
Registered: 2009-09-16
Posts: 10
Website

Re: glz_custom_fields

@ philwareham –

Thanks for your continued efforts.

@ alanfluff –

I can’t quite figure out the display order. It’s not chronological, nor is it alphabetical. Per your recommendations, I cleared the cache and checked the site is different browsers. Still no luck.

Here’s the code I am using:

<txp:article_custom form=“news-listing” section=“news” on_home_page=“y” sort=“custom_13 asc” />

The ‘on_home_page’ allows me to limit which posts are displayed on the homepage of the site.

Thanks for your help. Much appreciated!

Offline

#802 2011-02-25 17:09:59

alanfluff
Member
From: Ottawa, Canada
Registered: 2008-09-15
Posts: 222
Website

Re: glz_custom_fields

Is it because, perhaps, article_custom defaults to only looking for 10 articles then it bails and the first 10 it looks for does not include the articles you expected? I may be wrong there, but quick test would be to add limit="999" to the article_custom tag.

Luck! Cheers, -Alan


At LAST I’ve cheerfully donated to the core devs at #TXP. I only wish I were able to give more. Thanks to the devs and ALL fellow TXPers. -A

Offline

#803 2011-02-25 17:34:39

liamdempsey
Member
From: Philadelphia, PA
Registered: 2009-09-16
Posts: 10
Website

Re: glz_custom_fields

@ alanfluff -

Good idea! I previously had a limit=“4” (which fit the design), but had since removed that. Based on your comment, I have added limit=“999”, but again, no luck.

Many thanks for your continued attention and assistance.

Offline

#804 2011-02-25 17:39:33

philwareham
Core designer
From: Haslemere, Surrey, UK
Registered: 2009-06-11
Posts: 3,565
Website GitHub Mastodon

Re: glz_custom_fields

Have you ruled out the linked form being the problem? Try this and see if you get any output…

<txp:article_custom section="news" on_home_page="y" sort="custom_13 asc" limit="999"><p>this works</p></txp:article_custom>

If you get a list of ‘this works’ output, then that means the form is where the problem is.

Last edited by philwareham (2011-02-25 17:42:07)

Offline

#805 2011-02-25 17:39:47

alanfluff
Member
From: Ottawa, Canada
Registered: 2008-09-15
Posts: 222
Website

Re: glz_custom_fields

Hmm, I had this noted down a while back to remind me how I fixed this once, dunno if it’s applicable here, hope so:

Best practice is that custom names may include letters (uppercase or lowercase), numbers and under_scores, but no spaces or other special characters.

Luck! Cheers, -Alan


At LAST I’ve cheerfully donated to the core devs at #TXP. I only wish I were able to give more. Thanks to the devs and ALL fellow TXPers. -A

Offline

#806 2011-02-25 17:55:32

liamdempsey
Member
From: Philadelphia, PA
Registered: 2009-09-16
Posts: 10
Website

Re: glz_custom_fields

@ philwareham -

I used the code as you suggested and got a list of ‘this works’ output.

However, my form is really, really simple: <p><txp:permlink><txp:title /></txp:permlink></p>

Do you still think that my form might be the problem?

@ alanfluff -

Cheers for that recommendation. I thought about that too, and per your recommendation changed ‘news-listing’ to ‘news_listing’. Still no dice!

Offline

#807 2011-02-25 18:13:39

alanfluff
Member
From: Ottawa, Canada
Registered: 2008-09-15
Posts: 222
Website

Re: glz_custom_fields

Remove some of the criteria from the article_custom for now, such as the on_home_page and if not that then also the section, whittling away complexity until the sort order is correct, then add back one at a time to see if that suggests anything?

A tough one! Luck, cheers, -Alan


At LAST I’ve cheerfully donated to the core devs at #TXP. I only wish I were able to give more. Thanks to the devs and ALL fellow TXPers. -A

Offline

#808 2011-02-25 18:25:28

philwareham
Core designer
From: Haslemere, Surrey, UK
Registered: 2009-06-11
Posts: 3,565
Website GitHub Mastodon

Re: glz_custom_fields

In your original post your code suggested it was linking to a form labelled as ‘news’ yet in your last message you state it is labelled ‘news-listing’ (or ‘news_listing’), is that the problem?

Offline

#809 2011-02-25 18:28:29

johnstephens
Plugin Author
From: Woodbridge, VA
Registered: 2008-06-01
Posts: 1,000
Website

Re: glz_custom_fields

Have you looked at the tag trace?

Offline

#810 2011-03-09 22:03:18

dreamer
Member
Registered: 2007-06-08
Posts: 242

Re: glz_custom_fields

I set up a custom field for colors. My client told me that the plugin only allows for them to check off up to 26 colors. So no matter if they check off more than 26 colors, they will still be limited to 26. Suggestions?

Offline

Board footer

Powered by FluxBB