Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#37 2007-10-11 12:22:37

ringhio
New Member
Registered: 2007-09-10
Posts: 6

Re: glz_custom_fields

We have a strange problem using the plugin: it works on a default page but not on another page.

Homepage (works)
Section: default
Template: default

<txp:glz_custom_fields_search_form results_page=“default” searchby=“Data” />
<txp:glz_custom_fields_article limit=“5” no_results=“no_results” />

OtherPage (doesn’t work)
Section: uscite
Template: contenitore

<txp:glz_custom_fields_search_form results_page=“uscite” searchby=“Data” />
<txp:glz_custom_fields_article limit=“5” no_results=“no_results” />

For short I’ve copied default template on contenitore template and changed results_page to the right value (section name, from documentation) but if I browse section uscite I’m redirected on no_results page while there are articles with custom_fileld (Data) filled right.

What’s wrong?

Offline

#38 2007-10-25 00:37:30

redbot
Plugin Author
Registered: 2006-02-14
Posts: 1,410

Re: glz_custom_fields

Hi Gerhard,
Just a suggestion for your next release: the plugin won’t work correctly with a php version prior to 5 (no page will be displayed if containing the glz_custom_fields_search_form or glz_custom_fields_article tags)
In particular the problem seems to be caused by the php 5 function “array_combine”.
I’ve fixed it adding:

function array_combine($keys, $values)
{
    $result = array();
    foreach(array_map(null, $keys, $values) as $pair)
        $result[$pair[0]]=$pair[1];
    return $result;
}

in the plugin code (the snippet is borrowed from the php online manual).
Hope it helps.
Cheers

Last edited by redbot (2007-10-25 00:41:57)

Offline

#39 2007-10-25 08:32:39

jelle
Member
Registered: 2006-06-07
Posts: 165

Re: glz_custom_fields

Wow, amazing plugin. I offer my services for a dutch translation.

Offline

#40 2007-10-26 00:11:34

redbot
Plugin Author
Registered: 2006-02-14
Posts: 1,410

Re: glz_custom_fields

ringhio wrote:

We have a strange problem using the plugin: it works on a default page but not on another page.

I can confirm it.

Offline

#41 2007-10-26 01:48:40

Logoleptic
Plugin Author
From: Kansas, USA
Registered: 2004-02-29
Posts: 482

Re: glz_custom_fields

Hmm. The ‘only on default page’ issue could be a huge problem for a project that I was going to use this on. Is anyone other than ringhio and redbot experiencing this? Does this problem only occur with some of the plugin’s tags, or all of them?

Thanks in advance for the info.

Offline

#42 2007-10-26 09:17:01

redbot
Plugin Author
Registered: 2006-02-14
Posts: 1,410

Re: glz_custom_fields

Logoleptic wrote:

Hmm. The ‘only on default page’ issue could be a huge problem for a project that I was going to use this on. Is anyone other than ringhio and redbot experiencing this? Does this problem only occur with some of the plugin’s tags, or all of them?

Hi Logoleptic ,
I didn’t have the time to investigate further so I don’t know if the problem can be easily fixed with a slight modification of the plugin code (I tend to think so).
As for your question, the plugin uses only two tags which must be used together (one for the search form and the other for the results) but if if you don’t need to use them the plugin will work quite well.
That’s all for now, I’m in your exact same situation with a project I’m working on at night so should I come to a temporary solution later I’ll let you know immediatly.

Offline

#43 2007-10-26 16:40:52

Logoleptic
Plugin Author
From: Kansas, USA
Registered: 2004-02-29
Posts: 482

Re: glz_custom_fields

redbot wrote

As for your question, the plugin uses only two tags which must be used together (one for the search form and the other for the results) but if if you don’t need to use them the plugin will work quite well.

Thanks for the follow-up redbot. If I’m understanding this earlier post properly, the plugin can still work together with the built-in <txp:if_custom_field> tag for the first ten custom fields. Is this correct? If so, I might not have a problem after all.

Offline

#44 2007-10-26 23:34:51

redbot
Plugin Author
Registered: 2006-02-14
Posts: 1,410

Re: glz_custom_fields

Logoleptic wrote:
If I’m understanding this earlier post properly, the plugin can still work together with the built-in <txp:if_custom_field> tag for the first ten custom fields. Is this correct? If so, I might not have a problem after all.

Yes you are right, if you don’t need a search functionality you don’t need to use these tags, and in this case the plugin is working great.

Offline

#45 2007-10-27 13:00:11

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

Re: glz_custom_fields

Having a small problem using the plugin. What I am trying to do is have my custom field called “Country” (a list of countries) display in a form used by mem_moderation:

The form:

<div class="submit_label">Title</div>
<txp:mod_title_input />
<div class="submit_label">Category</div>
<txp:mod_category1_select />
<div class="submit_label">Another Category</div>
<txp:mod_category2_select />
<div class="submit_label">Country</div>
<txp:custom_field name="Country" />
<div class="submit_label">A brief introduction for your classified</div>
<txp:mod_excerpt_input />
<div class="submit_label">Body</div>
<txp:mod_body_input />
<div class="submit_label">Notes for the Moderator (optional)</div>
<txp:mod_note_input />
<!-- this will put the submitting username in to custom field 1 -->
<input type="hidden" name="custom_1" value='<txp:mem_profile var="name" />' />
<div><txp:mod_submit /></div>

In the page, I see this error notice from TXP:

Tag error: <txp:custom_field name=“Country” /> -> Textpattern Notice: Article tags cannot be used outside an article context on line 1887

And the country field is not displayed. Its a select drop down box.

Perhaps I am missing something simple here?

Last edited by jstubbs (2007-10-27 13:01:32)

Offline

#46 2007-10-27 14:58:26

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

Re: glz_custom_fields

Basically, in case its not clear, what I want is to be able to have users to be to input data into an email or mem_moderation form on a page. The data should be from a custom field, and most likely, a drop-down select box.

Offline

#47 2007-10-29 18:44:24

Logoleptic
Plugin Author
From: Kansas, USA
Registered: 2004-02-29
Posts: 482

Re: glz_custom_fields

redbot wrote:

Yes you are right, if you don’t need a search functionality you don’t need to use these tags, and in this case the plugin is working great.

Thanks for the clarification, redbot.

Offline

#48 2007-10-29 18:54:58

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,090
Website GitHub Mastodon Twitter

Re: glz_custom_fields

By the way shouldn’t this thread move to the Author Support forum?


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

Board footer

Powered by FluxBB