Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#817 2011-03-15 05:52:07
- dreamer
- Member
- Registered: 2007-06-08
- Posts: 242
Re: glz_custom_fields
uli wrote:
align the boxes next to the name
Have a look at this post and also at the reply of alanfluff.
Unfortunately, that doesn’t seem to do anything at all.
Last edited by dreamer (2011-03-15 05:52:27)
Offline
#818 2011-03-15 06:07:51
Re: glz_custom_fields
Just try something like:
custom_field_group .glz_custom_checkbox_field span input{width:30px;}
change the width value until it suits, or try width: auto; again
Offline
#819 2011-03-15 10:18:22
Offline
#820 2011-03-16 14:43:41
Re: glz_custom_fields
hi
first of all thank your for that plug-in. got it running on plenty projects..
and today i saw the datepicker function and i want to implement it into another one :)
but i have one question:
in the extensions tab: Date format: wouldnt it be possible to put the the values in by myself? im askin because of the separators.
(ok ok, i could hack those via jquery or something) just askin if this wouldnt be possible as well.
like you have a text field and put this in manually..
like dd-mm-yy, dd.mm.yyyy, mm***dd***yyyy (just playing with the constalation of the separators..)
or another thought:
make it a textfield and lets put in the value like in <txp:posted *format=""* />
strftime()
would that be possible, or am i nuts..? cause that would also make my next question needless..
cause i also want those weekdays.. cant they also be put into the custom field..?
just askin for a feature ill need once in a lifetime, but it would be geil..
tell me what you think..
Last edited by jens31 (2011-03-16 14:45:11)
Offline
#821 2011-03-19 03:43:10
Re: glz_custom_fields
Hi all.
Here is a little hack for the plugin:
// evals a PHP script and displays output right under the custom field label
function glz_custom_script($script, $custom, $custom_id, $custom_value) {
// hack starts
global $prefs;
// test if $script is an absolute path (i.e. /home/path/to/script/).
$abs_path = strcmp(substr($script, 0, 1),'/') === 0 ? true : false;
// if it's not an absolute path, then it's a relative path (i.e. just the script name,
if (!$abs_path) {
// then, recreate the full path by appending the value of custom_scripts_path (i.e. /
$script = rtrim($prefs['custom_scripts_path'],'/') . '/' . $script;
}
// hack ends
if ( is_file($script) ) {
include_once($script);
$custom_function = basename($script, ".php");
...
Look for the correct line (the one defining glz_custom_script
function) and edit the first line so the code lookslike the above snippet.
This mod will let you use both relative or full path when specifyng the filesystem path to a glz_custom_field custom script. So you could put just the custom script name, like “my_image.php” instead of the full path (“/home/path/to/my_image.php”), making it easier to deploy or share a DB with other dev.
Gerhard, do you think it could be possible to pass the custom field’s name to the custom script function? I mean, as now, that you pass the $custom_id
and/or $custom_value
. Having the custom field name would open the possibility to write more reusable custom scripts .
Offline
#822 2011-03-25 15:31:28
- element
- Member
- Registered: 2009-11-18
- Posts: 99
Re: glz_custom_fields
Question: I’m using glz_custom_field (obviously) and I need to use if_custom_field for a field > 10. What is the solution?
Offline
#823 2011-03-25 16:22:20
Re: glz_custom_fields
If you’re using the latest version of Textpattern, txp:if_custom_field should work fine.
Offline
#824 2011-03-25 17:45:11
- element
- Member
- Registered: 2009-11-18
- Posts: 99
Re: glz_custom_fields
Using TXP 4.2.0, and it doesn’t work.
Offline
#825 2011-03-25 20:07:22
Re: glz_custom_fields
I have a new feature request for the plugin and would love to know if it might be helpful to others or easy to implement:
Add a custom field option that allows an article to be associated with other articles in the site. I’m thinking of a pull down menu (or multi-select menu) that lists article titles from a specified section (or sections). Then, in the article form, the custom field would output as permlinked title(s) to the corresponding article(s). This would be helpful to me because it would avoid typos/user errors and, as a designer, I would have control over where the links show up in the layout of the article (versus just writing links with textile in the body or excerpt)
Maybe I am the only one interested it in this… thought I’d throw it out there to see if anyone else likes the idea.
I initially thought about it in this thread.
Offline
#826 2011-03-25 20:20:51
- redbot
- Plugin Author
- Registered: 2006-02-14
- Posts: 1,410
Re: glz_custom_fields
photonomad wrote:
Add a custom field option that allows an article to be associated with other articles in the site. I’m thinking of a pull down menu (or multi-select menu)…
Hi,
it should already be easily doable with a custom script.
Choose a CF and set “type” to “custom script” then modify the sample script which comes with the plugin (usually in the “script” folder).
You may want to read the instructions since I don’t remember well how it works now.
Offline
#827 2011-03-25 20:24:20
Re: glz_custom_fields
oh thanks redbot! I’d forgotten about that — cool!
Offline
#828 2011-03-26 03:15:40
Re: glz_custom_fields
@element What is your exact code? What error are you seeing? Can you see a tag trace, or does the page just fail to load?
I was vague by saying “the latest version”, but if_custom_field is definitely supported for unlimited custom fields in TXP 4.2.0.
From the HISTORY file:
* Developer: Core support for unlimited custom fields (thanks: Gerhard Lazu)
Offline