Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#313 2009-04-26 12:56:21
Re: glz_custom_fields
grundgesetz wrote:
Therefore the term “content” is completely definable by the developer.
See xPattern :-)
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
#314 2009-04-26 17:22:35
Re: glz_custom_fields
grundgesetz wrote:
Therefore the term “content” is completely definable by the developer.
What a fantastic Idea ;) Maybe it’s time has come.
Offline
#315 2009-04-26 17:32:40
- azw
- Member
- Registered: 2007-01-29
- Posts: 279
Re: glz_custom_fields
We’re sliding OT, but… I’ll second or third the separation of definition of content from the basic CMS code. It would add a lot of flexibility, but it would take a lot of work for the TXP crew to implement that.
I’m working on a plugin that allows the site owner to enter a simple list of data (6 data fields, three of them select menus) It was based on the code for the list of links in txp_link.php, but has more features. I didn’t want to add this list of items to the articles table because I’d never be able to find my articles among the 1000+ list entries. It’d be great if TXP were to allow us to define what content is, and to have different definitions for different sections, with content storage in different tables.
Offline
#316 2009-04-26 18:12:55
- jpdupont
- Member
- Registered: 2004-10-01
- Posts: 752
Re: glz_custom_fields
grundgesetz a écrit:
That is what makes EE ingenious. I would really love that in txp.
Yes ! I use ExpressionEngine for a few sites and it’s awesome to be allowed to build my own article area fields
Offline
#317 2009-04-26 21:33:35
- grundgesetz
- Plugin Author
- From: Germany
- Registered: 2009-04-17
- Posts: 24
Re: glz_custom_fields
Sorry mrdale. hadn´t read your thread ;) (btw: not much to see yet, stef. but promising)
just wrote what i thought.
b2t: will have a look into the plugin as soon as 1.3
Offline
#318 2009-04-27 06:39:07
Re: glz_custom_fields
mlarino wrote:
<txp:glz_custom_fields_search_form searchby=“Type of Food, Prize range:checkbox, category, section” section=“Restaurants” />
It will show a slect box to choose “types of Food”
It wll show checkboxes with “Price ranges”
It will show checkboxes with all the “Categories”
It will only search in section “Restaurants”?
If Types of Food is of type select, yes.
Yes to everything except the last question. section and category attributes are used to set a default value if no value has been checked. If that cant be done, maybe I should use Location as a custom_field instead of category, right?
I use Categories for the Location of the restaurants (NY, Chicago, Florida, etc…) so would that create checkboxes for the 62 locations I have in categories? A selectbox would be ideal.
Sorry, you can only have checkboxes. If you want this functionality, a custom_field is what you need.
Can this be styled with CSS? Right now just displays the selectboxes vertically, and a simple “Search” button. Would like to be able to style it completely. for example: have an horizontal list and use an image for the “search” button.
Of course you can style the search form any way you like. This is why I’ve used the button element for the submit over input.
I have overlooked an id for the form, just added glz_custom_fields_search, it will become available as of the next release.
Offline
#319 2009-04-27 06:47:56
Re: glz_custom_fields
jelle wrote:
How about dependencies between custom fields? Say custom field #1 is a checkbox and #2 is a textfield. I’d like to be able to make #2 depend on the value of #1 to apear in the write screen. So when #1 is checked, #2 is shown. When #1 is unchecked, #2 is hidden (and cleared)
Yes, that sounds like a very good idea, but on the list of important features, this comes pretty low. If you want to have a stab at it, this is a good starting point. Sorry Jelle, maybe when we sort more of the issues with TXP integration and join it with sed_section_fields.
Offline
#320 2009-04-27 12:49:25
Re: glz_custom_fields
mlarino wrote:
I usually use this method to style select boxes and forms but if the first option is blank, it just doest work. I think that instead of beeing blank, that is where you can place the name of the Custom_field, instead of having the label above the selectbox.
Styling form elements such as selects, radio & checkbox inputs is not recommended. It’s fine for basic styles (border/background/color), but changing their appearance as shown in your link Manuel is not a good idea. Why would you want to do it in the first place?
The reason why the first option is blank is so that people can reset a custom field value. In the link that you’ve used as an example this situation is not accounted for. This seems to be a limitation of the JS you’re using. Even though I discourage this practice, if you must use it, please look for an alternative JS form styling script or have a go tweaking the one that you’re currently using so that it works with blank values as well.
Offline
#321 2009-04-27 12:54:05
Re: glz_custom_fields
azw wrote:
That’s a good question about blank select options. I’ve seen in other instances that they don’t validate with W3C’s validator. What’s a good way around that problem?
They do validate in both XHTML 1.0 Transitional & Strict. A
needs to be added if you’re particularly picky. I’ve just updated the code accordingly : ).
Offline
#322 2009-04-27 12:57:55
Re: glz_custom_fields
mlarino wrote:
What I am doing right now is changing this part of the code in the plugin
return "<select id=\"".glz_idify($id)."\" name=\"$name\" class=\"list\"$multi>".
($blank_first ? "<option value=\"\">CUSTOME_SET_NAME</option>" : '').
( $out ? join('', $out) : '').
"</select>";
If you absolutely must change it, it’s line 593:
case "select":
return array(
glz_selectInput($custom, $custom_id, $arr_custom_field_values, $custom_value, 1),
'glz_custom_select_field'
);
to
case "select":
return array(
glz_selectInput($custom, $custom_id, $arr_custom_field_values, $custom_value),
'glz_custom_select_field'
);
Offline
#323 2009-04-27 13:02:31
Re: glz_custom_fields
thermofunk wrote:
How can I link to a search result? It is not necessary to show the url in the browser every time I make a search, I just need to know the correct sintaxis to create the link…
You can’t currently link to a search result. Because it’s using POST rather than GET, you must go through the form. This is on the TODO list, it will be available in the next version of glz_custom_fields.
Thanks for bringing this up!
By the way, I’m having problems with rss_admin_show_adv_opts and your version of TXP. Since I installed this version I also see the following message in the bottom of the Write Tab: Warning: array_map() [function.array-map]: Argument #2 should be an array in /var/www/vhosts/neuquentur.gov.ar/httpdocs/textpattern/lib/txplib_misc.php(570) : eval()’d code on line 576
Make sure you use the absolutely latest version of my patched TXP 4.0.8.Make sure that publish.php contains these changes. If it’s still an issue, drop me an e-mail.
Offline
#324 2009-04-27 13:04:33
Re: glz_custom_fields
midmood wrote:
Hi everyone, in the admin > Extensions tab I have about five or six couple of line of error like the following: Notice: Undefined index: custom_set in /web/htdocs/www.leparole.net/home/violetab/textpattern/lib/txplib_misc.php(580) : eval()’d code on line 810
Make sure you have the right version of TXP 4.0.8 and glz_custom_fields v1.2. If it’s still an issue, disable all plugins that might be active. If this doesn’t help, get in touch : ).
Offline