Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
How do I Add custom fields to images?
Hello,
I’ve a website where I’m using images as individual products. Now I’m asked to convert this site into ecommerce website.
Problem is there’s lots of information that needs to be stored for each product(image in this case). By default Textpattern’s Image tab provides very few fields to store data. I need a lot more than that.
I wish to know if there’s anyway I can store more than just caption & alt. I’ve had success in past to add an extra field(cost field) to images by modifying some library files.
I wish to know if I can do similar thing again.
Plan is to make some way to easily convert existing website in ecommerce by adding some additional fields to images & then using the jCart for cart & checkout mechanism.
I’d love to hear what you think about this, I’m totally out of ideas right now.
Offline
Re: How do I Add custom fields to images?
Hi Vineet,
I think you will be better use articles instead of images,
as Images and files are media, and an article is the main body with the content.
Adding image/s to an article can be done super easily nowadays, using 2 cool plugins: bot_image_upload and abl_droploader
But, if you are still looking to add custom fields in the image editing page,
then you can just use JS to create fake fields, you can add how many fields you want and in any type.
After that, you simply save all the content from them as array into the caption textarea, and then use rah_repeat to split that array in your website and play with the content how you like to.
By doing that, you do not modify any TXP file, and do not need to deal with database.
I’m doing it to create custom UI fields in the write tab, take a look at my TXP tip: http://txptips.com/create-your-own-custom-ui-in-the-write-tab
Offline
Offline
Pages: 1