Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
can a custom field hold an image?
I would like to have some articles have an image added to a custom field called gallery_pix.
I would then like to output a thumbnail of the image from ALL articles that have an image in gallery_pix with their permalink to other areas of my site i.e. the footer formPossible?
I see no mention of custom_fields and images in the docs.
I have tried adding images ids and image paths but to no avail.:
<txp:if_custom_field name="gallery_pix"> <txp:custom_field name="gallery_pix" /> </txp:if_custom_field>
produces no output
…. texted postive
Offline
Re: can a custom field hold an image?
Your code should output the data put in the field.
The <txp:images/>
tag can take a list of image ids. So put an image id in the custom field or a comma separated list of image ids and use something like:
<txp:if_custom_field name="gallery_pix">
<txp:images id='<txp:custom_field name="gallery_pix" />' form="image-form" />
</txp:if_custom_field>
Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker
Offline
Re: can a custom field hold an image?
MattD wrote #288864:
Your code should output the data put in the field.
The
<txp:images/>
tag can take a list of image ids. So put an image id in the custom field or a comma separated list of image ids and use something like:
<txp:if_custom_field name="gallery_pix">...
thanks. seems to work if i use the full path name to the image. inserting the id: “139” doesn’t work … nothing is outputted.
Any way to link to the permalink article that contains that image rather to an IMAGE?
…. texted postive
Offline
Re: can a custom field hold an image?
update . i deleted the gallery_pix custom field and created pix and populated it with an ID and it works fine. Thanks! I just need to find a way to capture the permalink to the ARTICLE in which the image appears. At the moment the permalink is to the image. i.e. http://mysite.net/images/139.jpg
Last edited by bici (2015-03-09 00:50:21)
…. texted postive
Offline
Re: can a custom field hold an image?
What code are you using now? That’ll help us tell you what to change.
Assuming you want the permlink of the article around an image your image-form would be something like
<txp:permlink><img src="<txp:image_url thumbnail="1" />" /></txp:permlink>
Last edited by MattD (2015-03-09 01:41:07)
Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker
Offline
Re: can a custom field hold an image?
I am trying t get these thumbnails images with a permalink to the arrticle to appear in my footer which applies to all my site:
in my misc. form FOOTER i have this code:
<txp:if_custom_field name="pixie"> <txp:images id='<txp:custom_field name="pixie" />' form="pixie_form" /> <txp:thumbnail link="1" /></txp:images> <txp:else /> <p>TEST for output, nada.</p> </txp:if_custom_field>
in my misc. pixie_form I have:
<txp:permlink><img src="<txp:image_url thumbnail="1" />" /></txp:permlink>
I have images ID in three articles
i am very close to getting it to work.
Update: When i am on a particular category page then one image appears. If i am in a different category page then a different image appears. I would like the three images to appear in the footer no matter which section page I am on and to link to the ARTICLE/CATEGORY which contains the image. so close
Last edited by bici (2015-03-09 02:39:52)
…. texted postive
Offline
Re: can a custom field hold an image?
You’ll need to use a article_custom
tag to pull the article data you want into your footer.
Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker
Offline
Re: can a custom field hold an image?
MattD wrote #288869:
You’ll need to use a
article_custom
tag to pull the article data you want into your footer.
Thanks! it’s now working as i wanted. i just have a bit of css styling issues on the thumbnails but otherwise it works.
…. texted postive
Offline
#9 2015-03-09 09:14:23
- candyman
- Member
- From: Italy
- Registered: 2006-08-08
- Posts: 684
Re: can a custom field hold an image?
Hello bici, can you post a screenshot of your custom admin interface?
Many thanks.
Offline
Re: can a custom field hold an image?
candyman wrote #288882:
Hello bici, can you post a screenshot of your custom admin interface?
Many thanks.
Yes would be pleased to post. What do mean by my custom admin interface? I am using the classic one with my forms and pages etc. Let me know.
…. texted postive
Offline
#11 2015-03-10 12:31:44
- candyman
- Member
- From: Italy
- Registered: 2006-08-08
- Posts: 684
Re: can a custom field hold an image?
Ops, i didn’t understand.
I thought that the thumbnails would appear inside the admin interface… :P
Offline
Re: can a custom field hold an image?
candyman wrote #288919:
Ops, i didn’t understand.
I thought that the thumbnails would appear inside the admin interface… :P
the tom_image_grid plugin provides you the option to view images as a grid in your admin-panel area.
…. texted postive
Offline
Pages: 1