Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#85 2008-01-01 17:59:56
- redbot
- Plugin Author
- Registered: 2006-02-14
- Posts: 1,410
Re: glz_custom_fields
Logoleptic wrote
Can anyone tell me how the $thisarticle array gets populated? That seems to be the source of this particular problem, and if I knew how it works I might be able to figure out a work-around.
The $thisarticle array gets populated only with values untill custom field 10.
With version 1.0 there will be two new tags: glz_custom_field and glz_if_custom_field tags which can handle fields beyond 10 (see first post).
While v 1.0 comes out I’ve been using php to retrieve the contents of custom fields above 10:
<txp:php>
$id= $thisarticle['thisid'];
$custom_11_value = safe_field('custom_11', 'textpattern', "ID = $id");
echo $custom_11_value;
</txp:php>
I hope these informations can be of some use.
Offline
#86 2008-01-02 02:03:37
- Logoleptic
- Plugin Author
- From: Kansas, USA
- Registered: 2004-02-29
- Posts: 482
Re: glz_custom_fields
redbot wrote:
If you think well about it you can see you never need to use the offset attribute ‘cause you never need to know the value of a single checkbox. You only need to know if it is checked or not so this is not a problem (I hope I was clear enough)
If offset is omitted from the conditional tag, it will default to 0. In your example, you’d only be comparing “blue” to the first item in the list. If the “blue” checkbox was the third in a set of three, and if “orange” was also checked, then the text in your example would never appear.
That said, you’ve inspired me to plan for some changes in the next release. It will become possible to test a specified value against every item in the list, not just a single selected value. With that change, the conditional tag will be usable in the way you described (for custom fields up to 10). Details are here, including an important forward-compatibility note. I hope to get this update released over the weekend.
I hope these informations can be of some use.
Yes, I think that will help. The way things look right now, though, Gerhard will probably release v1.0 before I get around to updating my plugin for the extra custom fields. I’m likely to be pretty busy for the next several weeks.
Offline
#87 2008-01-02 02:15:28
- redbot
- Plugin Author
- Registered: 2006-02-14
- Posts: 1,410
Re: glz_custom_fields
Oops, Sorry! In post #84 I was totally wrong though with the update you recently announced in the aam_split_custom_field thread it should work the way I intended. Thanks!
Offline
#88 2008-01-04 16:28:46
- redbot
- Plugin Author
- Registered: 2006-02-14
- Posts: 1,410
Re: glz_custom_fields
Oops sorry again Adam, I totally missed your latest post. I’m glad I (unintentionally) inspired a very useful change in the next release.
One last thing. You can make your plugin (and glz_custom_fields) work immediatly beyond custom field 10 with a little hack.
You simply have to change the 10 custom fields limit in function getCustomFields() in publish.php. given that the $thisarticle array retrieves custom fields names through this function.
Offline
Re: glz_custom_fields
Thanks redbot for your quick php fix for custom fields above 10 that will work great until 1.0 comes out.
I tried to change the custom fields limit in publish.php, but that didn’t seem to work…
Thanks again!
Offline
#90 2008-01-11 20:12:33
- redbot
- Plugin Author
- Registered: 2006-02-14
- Posts: 1,410
Re: glz_custom_fields
visualpeople wrote:
I tried to change the custom fields limit in publish.php, but that didn’t seem to work…
Strange. I confirm it works for me. To be clearer around line 1016 in publish.php I just replaced
for ($i=1; $i<=10; $i++) {
with
for ($i=1; $i<=20; $i++) {
Offline
Re: glz_custom_fields
Logoleptic.
Thanks for the bug report (and fix) relating to upm_file_popper.
Worked like a charm.
Cheers!
—
Tom
Offline
#92 2008-01-16 18:13:33
- Logoleptic
- Plugin Author
- From: Kansas, USA
- Registered: 2004-02-29
- Posts: 482
Re: glz_custom_fields
renobird wrote:
Logoleptic.
Thanks for the bug report (and fix) relating to upm_file_popper.
Worked like a charm.
I’m glad you found it helpful. :-)
Offline
#93 2008-01-21 06:25:08
- shi
- Member
- Registered: 2005-12-09
- Posts: 34
Re: glz_custom_fields
Hello everyone,
I’ve read in this thread that it’s possible to use attributes of <txp:article_custom /> with this plugin, but I have a problem to make it work. I want to use different section. Am I doing something wrong?
<txp:glz_custom_fields_article section=“some-section” form=“some-form” />
The second thing I wanted to ask is: Can I forbid this plugin to sort values of a custom field by name?
I have a custom field with radio buttons: Mon, Tue, Wed, Thu, Fri, Sat, Sun and I don’t want them sorted by alphabet order, but the plugin sorts them out automaticly.
Offline
#94 2008-01-21 11:09:32
- redbot
- Plugin Author
- Registered: 2006-02-14
- Posts: 1,410
Re: glz_custom_fields
shi wrote:
I’ve read in this thread that it’s possible to use attributes of <txp:article_custom /> with this plugin, but I have a problem to make it work. I want to use different section. Am I doing something wrong?
It’s not clear what you are trying to accomplish. Maybe you have read that you can use <txp:custom_field /> instead?. For your question simply use <txp:article_custom section=“some-section” form=“some-form” />
The second thing I wanted to ask is: Can I forbid this plugin to sort values of a custom field by name?
I have a custom field with radio buttons: Mon, Tue, Wed, Thu, Fri, Sat, Sun and I don’t want them sorted by alphabet order, but the plugin sorts them out automaticly.
Unfortunately no. This question has already been answered before. I think the only solution is to rename your fields as “1-mon”, “2-tue” and so on.
Last edited by redbot (2008-01-23 15:03:39)
Offline
#95 2008-01-22 14:01:31
- shi
- Member
- Registered: 2005-12-09
- Posts: 34
Re: glz_custom_fields
redbot wrote:
It’s not clear what you are trying to accomplish. Maybe you have read that you can use instead?. For your question simply use
Thanks for response, sorry if I was confusing… What I’m trying to do, is to use glz_custom_fields on a multilingual website. I want to output same articles (with custom fields) on a different section/language, so I guess I need to use 2 different code snippets. The code you provided doesn’t help because I need to target results trough dropdown selection list.
All my articles with custom fields are written in section “products”. I have used: <txp:glz_custom_fields_article form=“some-form” /> and that worked fine on that section.
But, is it possible to get same results (output) when I’m looking the website from different section/language?
The logical way to me, seemed to add the attribute section=“products” to the above code, but I don’t get any results. Maybe I misunderstood that glz_custom_fields can use that attribute.
Any help on this?
Unfortunately no. This question has already been answered before. I think the only solution is to rename your fields as “1-mon”, “2-thu” and so on.
I think I’m gonna use 7 different custom fields with 1 radio button for each :)
Offline
#96 2008-01-22 17:06:54
- redbot
- Plugin Author
- Registered: 2006-02-14
- Posts: 1,410
Re: glz_custom_fields
shi,
sorry, today I must be dumber than ever because I still have some problems to understand what you mean…
Anyway keep in mind that the <txp:glz_custom_fields_article /> tag accepts the same attributes of the <txp:article /> tag so it can’t accept a “section” attribute.
Also consider that the <txp:glz_custom_fields_article /> tag is meant to show the results of a search performed by the <txp:glz_custom_fields_search_form /> tag (in which you can set a “results_page” attribute to specify which section you want your results to appear).
I have not enough informations to suggest a solution to your problem. Are you using the Multi-Lingual Publishing Pack (in this case I can’t help cause I never used it)?
Is the “products” section used by both languages? Maybe you could create two “products” sections (one for each language).
As for your second question why create 7 custom fields with 1 radio button for each when you can use one custom field with 7 radio buttons?
Offline