Tagged: add_more, image, repeatable, upload
- This topic has 5 replies, 3 voices, and was last updated 7 years, 10 months ago by
quethenoo.
-
AuthorPosts
-
-
February 7, 2014 at 7:55 pm #1349
taishiziyiMemberI’m developing a slideshow plugin and have incorporated piklist into the plugin itself because of the huge amount of time and code it can save me. I have, however, run into a problem:
What I would like to do is create a group of repeatable meta boxes where the group contains two fields – an image upload field (that uses the media uploader) and a text field to add a url that the image will link to.
However, when making a file upload field that uses the media uploader, the add_more option seems to automatically turn off. This seems to be – from what I have discovered – because the media upload field allows you to upload multiple images. The issue I have is that I don’t see a good way to add a text field that relates to a specific image that was uploaded in order to give it a URL to link to.
Is there something that I am overlooking? Or another way to accomplish what I an looking to do? I know that I could add a field to the media meta for a user to input a URL there after they click to choose the image from the media manager, but I would rather do it the other way. Any suggestions?
-
February 8, 2014 at 8:38 pm #1350
SteveKeymaster@taishiziyi– Can you send us the code you are using to create this field?
-
February 8, 2014 at 8:51 pm #1351
taishiziyiMemberSure. Here you go (I anonymized some of it for placeholders here, but nothing material has been changed):
/* Title: Slideshow Post Type: plugin_name Order: 0 */ piklist( 'field', array( 'type' => 'group', 'field' => 'slides_info', 'add_more' => true, 'label' => 'Slide Images', 'description' => 'Add the slides for the slideshow. You can add as many slides as you want, and they can be drag-and-dropped into the order that you would like them to appear.', 'fields' => array( array( 'type' => 'file', 'field' => 'slide_image', 'scope' => 'post_meta', 'label' => __( 'Add/Edit Image', 'plugin-text-domain' ), 'description' => __( 'Use the media uploader to add, select, or edit an image to use as a slide.', 'plugin-text-domain' ), 'options' => array( 'modal_title' => __( 'Add/Edit Image', 'plugin-text-domain' ), 'button' => __( 'Add/Edit', 'plugin-text-domain' ) ) ), array( 'type' => 'text', 'field' => 'slide_url', 'scope' => 'slide_image', 'label' => 'Image Link URL', 'description' => 'If the slide should have a link, enter the URL for the link here.' ), ), 'on_post_status' => array( 'value' => 'lock' ) )); -
February 13, 2014 at 12:38 pm #1397
taishiziyiMemberI know you guys are incredibly busy, but I was wondering if anyone had a chance to take a look and see what I might have been missing here?
Thanks for all your help!
-
February 13, 2014 at 5:13 pm #1399
SteveKeymaster@taishiziyi– This is something that we need to work on since it’s not 100% yet. We have some cool ideas for this type of field. Unfortunately, it may be a while before this is done.
-
March 21, 2014 at 8:02 am #1589
quethenooMemberHi Guys, any idea when this might be supported? It would in my humble opinion really make piklist even more killer, so many ways this feature would come in handy.
-
-
AuthorPosts
- You must be logged in to reply to this topic.