Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#793 2011-02-15 16:20:28
Re: glz_custom_fields
Apart from that, I really wanted to thank Gerhard once again for his precious work, that help set TXP as a better enviroment for client sites!
+1
Offline
#794 2011-02-15 17:09:47
Re: glz_custom_fields
gerhard wrote:
What other content types would you want custom fields for? The script content type is super flexible, that would be the starting point for creating shared custom field types.
What I had in mind was allowing custom fields for images, files, links, and comments. I don’t have any particular use-cases for link and file custom fields, but I can definitely imagine the utility of custom fields for images and comments.
I don’t know what you have in mind, or what’s in store for TXP 5.x. If custom content-types are on the horizon, then perhaps custom fields for the other content types would be moot.
Offline
#795 2011-02-24 22:00:35
Re: glz_custom_fields
I am trying to sort the display of a custom article and had used sort=“custom_13” as the ‘13’ was the position of the custom field on the ‘Extensions’ tab within the admin side of the TXP-driven site. I’ve set up a custom field as a text input field and then used numbers (1,2,3,4 …) in each article to control the order in which articles are displayed.
I am guessing that the sort=“custom_13” is where I am going wrong, but I don’t know how else to call that particular custom field.
Any ideas?
Offline
#796 2011-02-25 09:25:35
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
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
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,315
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
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
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
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
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
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