Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#916 2011-09-01 19:33:48

ploinkr
Member
From: Montreal
Registered: 2007-12-06
Posts: 83

Re: glz_custom_fields

Hi, just wondering: I’m using the Date Picker for certain fields; can that be used to sort articles by the date entered (and not just numerically?) Doesn’t seem to work so far… Thanks!

Offline

#917 2011-09-07 18:32:16

ploinkr
Member
From: Montreal
Registered: 2007-12-06
Posts: 83

Re: glz_custom_fields

Anyone…? Gerhard? Would me most grateful…
Thanks,
B.

Offline

#918 2011-09-07 18:42:31

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

Re: glz_custom_fields

Try this way:
Plugins > glz_cf > Options <click> Date Picker > Date format > yyyy-mm-dd

That’s the only way I see offhand.


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

Offline

#919 2011-09-07 19:18:26

ploinkr
Member
From: Montreal
Registered: 2007-12-06
Posts: 83

Re: glz_custom_fields

Thanks so much Uli, going to try that (seems obvious now!)

- yep, working – thanks a lot! :-)

Last edited by ploinkr (2011-09-07 22:16:17)

Offline

#920 2011-09-07 19:34:32

joebaich
Member
From: DC Metro Area and elsewhere
Registered: 2006-09-24
Posts: 507
Website

Re: glz_custom_fields

I am faced with the same requirement to sort by the glz_cf Date picker date and can use the yyyy-mm-dd format to select the date but I also want to display the date in the article in the dd-mm-yyyy format. The only way I can see of doing that is to have two date fields, one in each format. Is there a better way?

Last edited by joebaich (2011-09-07 19:48:03)

Offline

#921 2011-09-07 21:04:26

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

Re: glz_custom_fields

joebaich wrote:

Is there a better way?

Hmmm …

aam_split_cf and sed_packed_custom_fields come to mind.


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

Offline

#922 2011-09-07 21:59:51

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 5,182
Website GitHub

Re: glz_custom_fields

I am faced with the same requirement to sort by the glz_cf Date picker date and can use the yyyy-mm-dd format to select the date but I also want to display the date in the article in the dd-mm-yyyy format.

Easier still: use the “yyyy-mm-dd” format for sorting and a php snippet to display it in another format. Something like:

<txp:php>
  $orig_date = custom_field(array('name'=>'custom-field-name'));
  echo date("d-m-Y", strtotime($orig_date));
</txp:php>

Further information about php date formats here.


TXP Builders – finely-crafted code, design and txp

Offline

#923 2011-09-07 22:10:43

joebaich
Member
From: DC Metro Area and elsewhere
Registered: 2006-09-24
Posts: 507
Website

Re: glz_custom_fields

jakob wrote:

Easier still: use the “yyyy-mm-dd” format for sorting and a php snippet to display it in another format.

Ausgezeichnet, Jakob! Works like a charm.

Offline

#924 2011-09-08 10:31:48

merz1
Member
From: Hamburg
Registered: 2006-05-04
Posts: 994
Website

Re: glz_custom_fields

Jakob Nice snippet. Filed for future use in my open Textpattern library

Maybe also good to add as example to the custom field documentation. Or another place where we collect txp:php snippets!?


Get all online mentions of Textpattern via OPML subscription: TXP Info Sources: Textpattern RSS feeds as dynamic OPML

Offline

#925 2011-09-08 16:42:53

ploinkr
Member
From: Montreal
Registered: 2007-12-06
Posts: 83

Re: glz_custom_fields

Ok, put it in textpattern.js – seems to be working :-)

Newbie question again… :-/
Where would I put the script to hide the extra Body textarea?
Many thanks,
Ben.

Last edited by ploinkr (2011-09-08 17:05:04)

Offline

#926 2011-09-08 17:21:54

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

Re: glz_custom_fields

@Ploinkr: I have bot_wtc, and I used that to insert the script.

Offline

#927 2011-09-08 19:38:48

ploinkr
Member
From: Montreal
Registered: 2007-12-06
Posts: 83

Re: glz_custom_fields

Thank you John – I didn’t know about that plugin, will check it out :-)

Offline

#928 2011-09-09 04:50:25

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

Re: glz_custom_fields

I’ve reported a bug:
on multi-select, if last option is checked, then first (empty) option gets checked on reload (and some related thoughts on single selects, multi-selects and having a first empty option)

A quick summary of the bug: if user selects the last option in the multi-select, and saves the article, then, on page reload, this first empty option is also selected. Problem is, if the user saves the article again, without noticing this, both the empty option and the last option get saved into the database.

This affects v1.2.4 and v1.3.0, and find it a bit rare that it went under the radar till now.
Can anyone confirm you can replicate this bug on your installs?

I’ve provided a possible fix.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#929 2011-09-09 13:47:40

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

Re: glz_custom_fields

maniqui wrote:

Can anyone confirm you can replicate this bug on your installs?

Yup, confirmed (1.3.0). And discovered that a multiselect doesn’t accept 0 as a value ;) (No complaint, Gerhard, happens probably only on a bugchase)

(Edited to add version)

Last edited by uli (2011-09-09 13:52:03)


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

Offline

#930 2011-09-09 16:08:38

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

Re: glz_custom_fields

Hi Uli. Thanks for confirming the bug.

And discovered that a multiselect doesn’t accept 0 as a value.

Not sure if I understood. As value for which parameter?


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

Board footer

Powered by FluxBB