Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#49 2007-05-15 13:44:05
- masa
- Member
- From: Asturias, Spain
- Registered: 2005-11-25
- Posts: 1,091
Re: drop down lists for custom fields
Very impressive! :-)
Offline
Re: drop down lists for custom fields
gerhard wrote:
Did I mention that all is working as well?
I still have to sort out callbacks for having the extra custom fields display on article etc, but we are getting there ; ).
Sorry to jump on it, I’ve kinda lost track of this thread for the past month.
It’s working as a plugin?! Where do you live, so we can kiss the ground where you walk? :-)
Offline
Re: drop down lists for custom fields
Jeremie wrote:
Sorry to jump on it, I’ve kinda lost track of this thread for the past month.
I too have missed a lot on this thread… It does look very impressive!!!
gerhard wrote:
What I would like to ask the hard-core devs (Mary, Alex, Sencer etc.), is what would the best approach be:…
Maybe you should write to robert (wet) regarding this. A recent announcement by zem indicated that he will join the core team.
A couple of questions from my end:)…
- is the plugin flexible enough so as to allow for textfields as we have now?
- What happens with backwards compatibility? ie for those of us who were hand writing the textfields in the passed couple of years plus…
Last edited by colak (2007-05-15 15:28:14)
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: drop down lists for custom fields
I see more than 10 custom fields… have you moved the custom fields to a separate table <articleID><customID><value> or are you modifying the textpattern table to have more custom field columns?
Offline
Re: drop down lists for custom fields
Hi guys,
sorry for not having popped in for a few days but things were really manic – aren’t they always…
Jeremie wrote:
It’s working as a plugin?! Where do you live, so we can kiss the ground where you walk? :-)
It is indeed my dear friend : ). Well, we’re releasing the new Astute sub this weekend in my town, so I really want to release “my most advanced TXP plugin yet” at the same time. Hold your kisses for Sunday, ok? :D
colak wrote:
Maybe you should write to robert (wet) regarding this. A recent announcement by zem indicated that he will join the core team.
A couple of questions from my end:)… * is the plugin flexible enough so as to allow for textfields as we have now? * What happens with backwards compatibility? ie for those of us who were hand writing the textfields in the passed couple of years plus…
Yannis, actually I started this whole plugin after having talked to Robert. I’ll be releasing an alpha version for the core devs to take a look through it, have a play and see if they can spot any biggies with it before releasing to the community. I don’t really want to be mean with the rest of you guys, but it has taken a considerable amount of time to figure out a lot of things for this plugin, I wouldn’t have done it in the first place if a dear friend of mine wouldn’t have really needed it for a project of his. I mean yes, I kept saying here on the forums that I will write it for a while now, but as you well know, it’s a pain to get everything working hack-free, backwards compatible and all that. It’s still not finished, a few niggles to go, but we’re almost there ; ).
The plugin works in the following way:
- there is a custom fields table(yes, the plugin sorts it out all) with 2 columns, Name and Value. Name is the custom field name (e.g. Price) and value holds the value this field can take (e.g. list of counties, ZIPs, price ranges, bedrooms, you name it).
- when adding a new custom field, add a new value in txp_prefs (there’s a “smart” functions that checks the next available number – you woulnd’t like to have custom_173, would you? : ) ), set the type of the custom field in the html column in txp_prefs (input, select, textarea, checkbox, radio – I think that’s it).
- also, when adding a new custom field create a new column in textpattern table and also add all values that have been set in the textarea (each value goes on a separate line) in the custom_fields table
Everything else is pretty straightforward. The stage where I’m at now is having some callbacks modify the txp interface for article so that old custom fields are silently removed/disabled (I’m still to decide on the best approach for that) and insert our new ones. Also, I have to call the right functions when editing or deleting articles… Obviously, all is working fine on my end because, well, I have a big big plugin written which basically includes all the functions that have to be called for a normal TXP install. The good friend that I was mentioning about is Randy, you might know him from the forums. He’s the one you have to really thank for getting me into doing this ; ).
Well chaps, if there is anything else you would like to know, do let me know. I’ll try to do my best to have it finished this weekend, but events have this stubborn way of going against one’s will, proportional to the importance of the matter at hand…
Offline
#54 2007-06-20 09:50:15
- kevinmcdougall
- Member
- Registered: 2007-02-08
- Posts: 55
Re: drop down lists for custom fields
Gerhard (or anyone else who might know!)
Has there been any progress on the plugin? Or perhaps there’s a tutorial somewhere which demonstrates how to tweak TXP to achieve this?
Any help on this would be greatly appreciated.
Offline
Re: drop down lists for custom fields
just chiming in to see the progress of this plugin too
Offline
#56 2007-06-26 15:59:22
- anoke
- Archived Plugin Author
- Registered: 2006-04-15
- Posts: 152
Re: drop down lists for custom fields
BTW, does such plugin has to have an editor? Of any sort? What is the minimum?
“This week I have been mostly..” learning jQuery and digging up old tweaks’n‘hacks. I made a test plugin to re-organise menus and it removes and changes stuff quite nicely. I can’t see why it couldn’t reformat the default 10 custom fields too..
- When chickens are cold, they roost in trees; when ducks are cold, they plunge into water -
Offline
Re: drop down lists for custom fields
Hi guys, I haven’t been able to pay much attention to this thread lately, sorry. Right now I’m travelling, back home I’m in the process of moving house, not to mention all the other projects I’m currently working on. I have been chipping in Levi’s TextCommerce as well, so you can imagine…
Anyways, the only thing that the plugin doesn’t do is have the extra custom fields show up in the write tab. You might think that this is easily done through JS – and maybe it is easily done – but in the time that I had to poke around, I got the impression that it’s quiet difficult since TXP’s in-built functions are hard-coded to 10 custom fields. I’ve suggested a simple, 1 line fix for this, but it didn’t make it in the source apparently… All that is required is that line being replaced with
$custom_fields_num = count(preg_grep("(^custom_\d+_set$)", array_keys($prefs)));
while ($i < $custom_fields_num) {...
Anyways, as soon as I’ll get some time, I’ll look into it. Let me know if any of you have ideas on how to approach this. Robert was suggesting dom_attach()
, second one being plain jQuery. I think I will look more closely into that jQuery option…
Offline
#58 2007-07-04 11:06:01
- anoke
- Archived Plugin Author
- Registered: 2006-04-15
- Posts: 152
Re: drop down lists for custom fields
gerhard: when you’re back, drop me an email? It’s easy^2 with jQuery.
- When chickens are cold, they roost in trees; when ducks are cold, they plunge into water -
Offline
Re: drop down lists for custom fields
gerhard,
I can’t thank you enough for trudging through the development of this plugin. I also can’t tell you how badly I need to use it. :) Please let us know the moment there’s something we can try out.
Oh, and that one line hack… I’m no fan of hacks, but this is a cool enough feature, I’d do it. Especially if I get to play with it sooner.
Oh, and if there’s anything I can do to help, don’t hesitate to ask. I’m no programmer, but I get Textpattern and I’d love to help (maybe I can beta test and write documentation).
Again, thanks a ton!
Offline
#60 2007-07-13 09:31:26
- M_i
- Member
- Registered: 2006-03-05
- Posts: 122
Re: drop down lists for custom fields
good grief, this is looking gorgeous! can’t wait to play with it!
- iris (who started the topic way back when…)
Offline