Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

  1. Index
  2. » Archives
  3. » drop down lists for custom fields

#16 2006-03-22 18:59:07

duchamp
Member
From: Patagonia
Registered: 2005-02-03
Posts: 222
Website

Re: drop down lists for custom fields

Updated

Now it’s fully working.
If you want the three options in a row change the last piece of the function to this:

<code> return join($out); }</code>

I think it could work.

Anyway, the markup it’s no right, I need to parse the <code><p> and </p> tags</code> to open and close the options … just a detail.

Last edited by duchamp (2006-03-22 19:01:50)

Offline

#17 2006-03-22 20:37:13

Inspired
Plugin Author
From: Kiev, Ukraine
Registered: 2005-01-28
Posts: 87
Website

Re: drop down lists for custom fields

Here’s a quick proof-of-concept test plugin to convert custom field inputs into editable selects, as i mentioned above – download ied_editable_select – check it out and tell me what you think. Enable it and have a look at custom_1

(well, anyway, it is in fact more simple to make radio buttons or checkboxes of it, just get inspired)


Plugin Composer — admin plugin to write your own plugins

Offline

#18 2006-03-22 21:18:12

duchamp
Member
From: Patagonia
Registered: 2005-02-03
Posts: 222
Website

Re: drop down lists for custom fields

Thanks! it works ok
Just a few details:

1) the Path to arrow images could be changed (maybe saving the three images into the images folder)

2) there’s something wrong with the DIV with Overflow ‘cause it has an horizontal scrollbar, but its just a question of pixeles …

Offline

#19 2006-03-22 23:20:59

Inspired
Plugin Author
From: Kiev, Ukraine
Registered: 2005-01-28
Posts: 87
Website

Re: drop down lists for custom fields

ok, Alex, download the plugin again – i’ve included the images into the plugin’s body.


Plugin Composer — admin plugin to write your own plugins

Offline

#20 2006-04-05 21:10:38

marios
Archived Plugin Author
Registered: 2005-03-12
Posts: 1,253

Re: drop down lists for custom fields

I liked the solution , allthough not as good as the real thing, but this could be good, if you just want to give some option quickly, with out much time,
The background hover for the options didn’t work well in Safari, so I made some small modifications on the CSS, to make it look more real.(I’ve no Idea though how it looks in windows)
You can replace the CSS with this one, the options drop down now extends to the full width of the dropdown box and is in em;
<code> .selectBoxArrow{ margin-top:1px; float:left; position:absolute; right:1px; } .selectBoxInput{ border:0px; padding-left:1px; height:18px;
width:12.5em; position:absolute; top:0px; left:0px; }

.selectBox{ border:1px solid #7f9db9; height:20px;
width:12.5em;

} .selectBoxOptionContainer{ position:absolute; border:1px solid #7f9db9; height:100px;
width:12.5em; background-color:#eee; left:-1px; top:18px; visibility:hidden; overflow:auto; } .selectBoxAnOption{ font-family:arial; font-size:10px; cursor:default; margin:1px; overflow:hidden; white-space:nowrap;
display:block;color:#333;
background-color: #eee; }

.selectBoxAnOption:hover {
background-color: #bbb !important;
color:#333;
display:block;}</code>


⌃ ⇧ < ⌃ ⇧ >

Offline

#21 2006-04-05 21:44:32

Inspired
Plugin Author
From: Kiev, Ukraine
Registered: 2005-01-28
Posts: 87
Website

Re: drop down lists for custom fields

Thanks marios, I’ve updated the plugin with your css, it worked well for me.
Indeed the plugin is a quick one, I have in mind ideas for making something closer to a real thing out of it, but got no time at the moment.


Plugin Composer — admin plugin to write your own plugins

Offline

#22 2006-04-05 23:37:55

marios
Archived Plugin Author
Registered: 2005-03-12
Posts: 1,253

Re: drop down lists for custom fields

time is a rare thing nowadays,btw.:The problem starts with text resizing,I might take a look again to fine tune the CSS a little more and have the height values in Ems as well, so it doesn’t scale out of proportion.

regards, marios


⌃ ⇧ < ⌃ ⇧ >

Offline

#23 2006-04-06 00:04:43

Inspired
Plugin Author
From: Kiev, Ukraine
Registered: 2005-01-28
Posts: 87
Website

Re: drop down lists for custom fields

OK, you can send me to email when you’re done with it.


Plugin Composer — admin plugin to write your own plugins

Offline

#24 2006-05-05 07:53:06

gerhard
Plugin Author
From: London, UK
Registered: 2005-06-29
Posts: 409
Website

Re: drop down lists for custom fields

Sorry guys, but I didn’t have time for the forum lately. I got an e-mail from Alex yesterday enquiring about this > custom_advanced.jpg . Since time is not on my side – again – I will just share the modded files (they are semi-commented). Will join the chat later on – promise : ).

textpattern/lib/txplib_forms.txt
textpattern/include/txp_article.txt

p.s.: an article on my blog is long overdue…

Offline

#25 2006-05-05 11:10:05

duchamp
Member
From: Patagonia
Registered: 2005-02-03
Posts: 222
Website

Re: drop down lists for custom fields

Hey! gerhard! Welcome back!
and thanks to share that files.

Offline

#26 2006-05-05 13:21:06

gerhard
Plugin Author
From: London, UK
Registered: 2005-06-29
Posts: 409
Website

Re: drop down lists for custom fields

duchamp wrote:

thanks to share that files.

Welcome ; ).

Offline

#27 2007-01-03 04:16:43

eric2007
Member
Registered: 2006-05-25
Posts: 18

Re: drop down lists for custom fields

This is just what I need. This function should definitely be included on the next TXP release.

How do you set it up on 4.0.4?

Last edited by eric2007 (2007-01-03 04:17:42)

Offline

#28 2007-01-03 10:13:41

gerhard
Plugin Author
From: London, UK
Registered: 2005-06-29
Posts: 409
Website

Re: drop down lists for custom fields

Hi guys,

long time no hear :).

My programming skills and the knowledge of the inner-workings of TXP went up a few notches since March and, if you would be interested, I could put together a plugin that would do just the things you’ve seen in that custom_advanced snapshot.

The way I’m thinking for the plugin to work
In custom field, specify the name like this Custom1*(radio):value1,value2,value3. The star on value2 tells the parser that it’s the value that should be selected.

The only way I can do this plugin is for a ransom. You decide how much that should be ;). I’ll leave you to it chaps.

eric2007 wrote:

How do you set it up on 4.0.4?

Eric, I don’t really know how much different TXP 4.0.4 is from 4.0.2 (or whichever version is that I originally created the hack for). Unless you have a decent command of PHP, I wouldn’t advise hacking txp_forms and txp_article. If you still want to have a go, back-up the originals before proceeding.

Last edited by gerhard (2007-01-03 10:17:14)

Offline

#29 2007-01-03 12:17:55

marios
Archived Plugin Author
Registered: 2005-03-12
Posts: 1,253

Re: drop down lists for custom fields

@gerhard.
definetely a nice thought out project.
Do you consider to combine that with configuration selects (between radio, pupup and input textarea ) in advanced prefs for publisher rights level below each custom fied prefs table row ?

regards, marios


⌃ ⇧ < ⌃ ⇧ >

Offline

#30 2007-01-03 13:30:01

gerhard
Plugin Author
From: London, UK
Registered: 2005-06-29
Posts: 409
Website

Re: drop down lists for custom fields

marios wrote:

Do you consider to combine that with configuration selects (between radio, pupup and input textarea) in advanced prefs for publisher rights level below each custom fied prefs table row ?

I am not 100% that I understand what you are asking, but if you mean setting the type of the custom field by clicking on a radio button rather than entering manually, then yes, it’s no biggie on my end.

Any more opinions in regards to this plugin?

Offline

  1. Index
  2. » Archives
  3. » drop down lists for custom fields

Board footer

Powered by FluxBB