Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#985 2012-03-26 08:16:21
Re: glz_custom_fields
Its well worth it Claire, takes txp to another level wet_haystack plugin can do searches in custom fields
Offline
#986 2012-03-26 08:50:21
Re: glz_custom_fields
tye a écrit:
Its well worth it Claire, takes txp to another level wet_haystack plugin can do searches in custom fields
Okay, I’ll explain a little bit more.
My searches would be performed on custom fields only, somehow like in the beginnings of glz_custom_fieds. More exactly, it would look like this:- show custom fieds on front-end like they are shown on back-end
- let the user making his choices
- select relevant articles with smd_if
(Still 25 pages to read)
Offline
#987 2012-03-26 09:41:34
Re: glz_custom_fields
CeBe wrote:
show custom fieds on front-end like they are shown on back-end
Not wishing to fiddle Gerhard out of cash here — I’m not a massive user of this plugin so don’t take my word as gospel — but I don’t know if the plugin has a tag to output the names of the custom fields. You might have to resort to looking at the prefs table for custom_n_set
entries and iterate over them. Same applies to rendering input elements: <txp:custom_field name="whatever" />
will render the contents, but not an input tag. Whether the plugin has the ability to render widgets for the various types of input control (or whether you can write a script that hooks into the plugin to do it) I don’t know. I’ve done this kind of ‘widget rendering’ thing in smd_bio v0.40 so if glz_cf doesn’t do it and you need to resort to PHP, you can always go look there for some copy/paste love :-)
select relevant articles with smd_if
That may be slow, depending on the number of articles that you are iterating over. I’d be tempted to use smd_query for this. Sanitize the input using that plugin’s filtering capabilities (or do it manually with a lick of PHP) and then throw the sanitized $_POST
params at the plugin to do its stuff and return a list of matching articles.
It’s not as simple as iterating over <txp:article_custom>
, especially if you have checkboxes, because you probably have to construct the query based on which items have user data in them. And HTML will omit checkbox data from the incoming stream, which may complicate things. But it’s doable, you have more control over the type of matches and is much faster as the site grows: I’ve seen it done on estate agent websites where people can do custom searches on price ranges, location, etc.
Last edited by Bloke (2012-03-26 09:42:54)
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
#988 2012-03-26 14:19:04
Re: glz_custom_fields
Bloke a écrit:
smd_bio […] you can always go look there for some copy/paste love :-)
…
I’d be tempted to use smd_query for this.
Thanks a lot for your precious (as usual) advices!
Offline
#989 2012-04-14 14:58:08
- masa
- Member
- From: Asturias, Spain
- Registered: 2005-11-25
- Posts: 1,091
Re: glz_custom_fields
I haven’t done much website work lately and I have a couple of quick questions…
- I have version 1.3. Is that the current one?
- What happens to the content of my current fields when I change them to e.g. text area?
Offline
#990 2012-05-04 15:23:13
- gfdesign
- Member
- From: Argentina
- Registered: 2009-04-20
- Posts: 401
Re: glz_custom_fields
I’d like to know how apply the plugin hak_tinymce in an especific textarea created with glz_custom_fields.
I use “custom-12” for this textarea element.
Does anyone know how to do ?
Thanks a lot
Offline
#991 2012-05-04 15:30:03
Re: glz_custom_fields
gfdesign wrote:
I’d like to know how apply the plugin hak_tinymce in an especific textarea created with glz_custom_fields.
In the setting of hak_tinymce add this to the “Callback functions:” textarea:
settings.body.mode = "exact";
settings.body.elements = "custom-12,custom-13,custom-14,custom-15";
More info here
Offline
#992 2012-05-04 16:25:05
- gfdesign
- Member
- From: Argentina
- Registered: 2009-04-20
- Posts: 401
Re: glz_custom_fields
Thanks a lot. It works for me :)
Offline
#993 2012-05-28 21:09:26
- gfdesign
- Member
- From: Argentina
- Registered: 2009-04-20
- Posts: 401
Re: glz_custom_fields
Hi again.
One question, how do I do to customize the output when I display a Multi-Select custom field?
Currently, the output is:
organge|red|yelow
I’d like be something like this:
<div class="organe"><div>
<div class="red"><div>
<div class="yellow"><div>
Any idea?
Thanks
Last edited by gfdesign (2012-05-29 00:02:44)
Offline
#994 2012-05-29 07:18:54
Re: glz_custom_fields
If you mean, how can you use the output of a glz_custom multi-select, you can use rah_repeat, e.g. something like this:
<txp:rah_repeat delimiter="|" value='<txp:custom_field name="my-custom-field" />'>
<div class="<txp:rah_repeat_value />">
…
</div>
</txp:rah_repeat>
TXP Builders – finely-crafted code, design and txp
Offline
#995 2012-05-31 00:26:19
- gfdesign
- Member
- From: Argentina
- Registered: 2009-04-20
- Posts: 401
Re: glz_custom_fields
Thanks a lot. It’s exactly I was looking for.
Best regards
Offline
#996 2012-06-02 22:14:23
- frickinmuck
- Member
- Registered: 2008-05-01
- Posts: 118
Re: glz_custom_fields
I’ve duplicated a site onto another server so I can redevelop some areas. One thing I’m having problems with is, I can’t update the paths for my glz custom scripts, so they won’t work on the development server. This is a problem for some of the areas I’m working on. Any ideas?
I should clarify, I can update it in PHP MyAdmin, but I’d prefer to be able to do so via the glz_custom_fields page. Is there no way to do this?
Last edited by frickinmuck (2012-06-02 22:21:50)
The AI does not hate you, nor does it love you, but you are made out of atoms which it can use for something else.
Offline