Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
Custom field as for an image ID
is it possible to have an custom form for a image ID
This is what I have right now and its returning a 500 Error
<txp:thumbnail id="<txp:custom_field name="Thumbnail1" />" />
Ohh ya in the custom field I have the ID of the image such as 7
Last edited by silent7 (2007-07-22 19:17:52)
Offline
Re: Custom field as for an image ID
Hi,
It’s not allowed to use directly TXP tags into tags.
Assuming you use it into a form, try this :
<txp:thumbnail id="<txp:php> global $thisarticle; echo custom_field(array( 'name'=>'Thumbnail1', ));</txp:php>" />
Last edited by Pat64 (2007-07-22 19:56:21)
Patrick.
Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.
Offline
Re: Custom field as for an image ID
Ahh no dice. Same 500 error
Offline
Re: Custom field as for an image ID
well I take out the code and it works. and have the <txp:thumbnail id="17" />
in the custom field
but If I put the <txp:thumbnail id="<txp:custom_field name="Thumbnail1" />" />
it wont work, I get the 500, I have all the PHP support turned on too.
Offline
Re: Custom field as for an image ID
Um, well you can’t use <txp:php> directly inside another TXP tag either, but this should work:
<txp:php>
echo thumbnail(array('id' => custom_field(array('name' => 'Thumbnail1'))));
</txp:php>
Offline
Re: Custom field as for an image ID
ahh its not working, I’ll just do it the regular way and put the whole txp:thumnail tag in the custom field and not just the ID
Offline
Re: Custom field as for an image ID
Well, or if you don’t feel yourself comfortable around the php, you can just use a one plugin: asy_wondertag which allows you to put tags inside tags, or otherhands tags as attributes.
Install asy_wondertag, and then use it, like this:
<txp:asy_wondertag><txp:thumbnail id="<txp:custom_field name="Thumbnail1" />" /></txp:asy_wondertag>
Last edited by Gocom (2007-07-22 20:34:56)
Offline
Re: Custom field as for an image ID
Is there a reason you are not using article image?
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: Custom field as for an image ID
yes I have 2 rows of 3 thumbnails each all of which are being shown on one page as a portfolio presentation. I just wanted to make it simpler to do and update with just having to put the ID of the image number for each project in one of the 6 fields I have marked as thumbnails in the custom fields. Not having to put the whole txp tag in there also that way if I wanted to make the lightbox plugin work and re purpose the ID which was in the custom field already for the larger image link, later on.
Offline
Re: Custom field as for an image ID
would expanding the article image possibilities help?
Last edited by colak (2007-07-23 09:54:46)
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: Custom field as for an image ID
:) :)
The best way is to use one of these :
<txp:ruud> (...) all you need here (...) </txp:ruud> <txp:mary> (...) all you need here (...) </txp:mary> <txp:wet> (...) all you need here (...) </txp:wet> <txp:senser> (...) all you need here (...) </txp:senser>
Work (very) fine for me!
:) :)
Patrick.
Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.
Offline
Re: Custom field as for an image ID
Several solutions have already been posted. If those give a HTTP 500 error, then I’d recommend looking at the error logs to find what causes that error.
Offline
Pages: 1