Before you ask please READ THIS

User Submitted Works

edited April 2013 in Beach Please Posts: 14
I would like my members to be able to upload their own images to the Works list page. I'm using Gravity Forms and can easily upload featured images, titles, content etc with no problem at all.

However, what I was hoping to get some advice about:

- How to upload a standard text field so it populates the "Works Detail" custom fields eg: Subtitle, Internet Address..

- How I add a "Work" post with just 1 image? Your documentations explains that you need to first upload a Featured Image, then scroll down to "Work Media - Add images" and upload another image. This means I have to upload a duplicate copy of the image as I can't access the Media Library.

Any advice would be hugely appreciated!

cheers
Andrew

Comments

  • AirAir
    Posts: 10,970
    Hello there.
    digirum said: How to upload a standard text field so it populates the "Works Detail" custom fields eg: Subtitle, Internet Address..
    I don't have any knowledge about Gravity Forms, but All this fields are for real custom fields but with _ which makes them hidden. You can see all names of these fields in \advance\meta.php in function apollo13_metaboxes_cpt_work(). There you can see code like

    array(
    'name' => __be( 'Subtitle' ),
    'desc' => '',
    'id' => 'subtitle',
    'default' => '',
    'type' => 'input'
    ),
    It is field for subtitle. Important here is subtitle. If you will add custom field with name _subtitle you will achieve same effect:-)
    If you need any more details please ask :-)
    digirum said: How I add a "Work" post with just 1 image? Your documentations explains that you need to first upload a Featured Image, then scroll down to "Work Media - Add images" and upload another image. This means I have to upload a duplicate copy of the image as I can't access the Media Library.
    You don't have to upload it again:-) Just go to "Work Media - Add images" click "Show" on first item, select image, and then button upload and you can select it from Media Library :-)

    With regards.

  • Posts: 14
    Brilliant! Thanks so much for your detailed response. It worked a treat!

    ---
    Do you have a feature request area :-)
    Automatically add the featured image to the first media slot in the "Work Media - Add Images" group.
    ---

    I know I might be pushing my luck, but here I go. I'm trying to implement a way for members to upload content to the "Works" post type. With your help, so far I've managed to get all custom fields, descriptions, featured image etc loading perfectly.

    The only thing I'm having difficulty with now is adding images or videos to 'Work Media - Add Images" group from the front-end. No matter what I do, I just can't get it to work.

    Do you have any more advice you could give me, a starting point, or even point me in the direction of a few key php files. Anything will help :-)

    Btw, loving the new theme. It's so slick!

    cheers
    Andrew
  • AirAir
    edited April 2013 Posts: 10,970
    digirum said: Do you have a feature request area :-)
    Automatically add the featured image to the first media slot in the "Work Media - Add Images" group.
    We don't but every topic can question and also request ;-)
    Your request is:
    1. Not easy :-)
    2. Not everybody will like it
    BUT I will check what can be done, and if it is possible we will add option to settings to enable it:-)
    digirum said:
    Do you have any more advice you could give me, a starting point, or even point me in the direction of a few key php files. Anything will help :-)
    These elements are also custom fields. I will show you how are they constructed

    TOTAL NUMBER OF ITEMS - IMPORTANT!
    _image_count=>7


    HERE ARE NAME AND VALUES FOR SINGLE ITEM

    image or video IMPORTANT
    _image_or_video_1=>post_image_1

    attachment id of image
    _post_image_id_1=>778

    link to image
    _post_image_1=>http://ccc.com/wordpress/wp-content/uploads/2013/03/swir.jpg

    custom link
    _post_image_link_1=>http://ccx.cp

    BG color
    _bg_color_1
    And so on :-) all possible id you have in same file but in function apollo13_metaboxes_cpt_images()
    Important thing is to add _NUMBER on fields of each new item like here _post_image_id_1=>778

    You can go to file single-work.php and change almost last line of file:
    //var_dump($custom = get_post_custom($post->ID));
    to:
    var_dump($custom = get_post_custom($post->ID));
    Now on ready work you could see exactly what are values of each field. For better view
    check source of this page(CTRL +U in Firefox and Chrome) .

    If you need more details please come back and ask :-)
    digirum said: Btw, loving the new theme. It's so slick!
    Thanks a lot! Don't forget to rate us on ThemeForest - it helps us a lot!

    With regards.
    Post edited by Air on
  • Posts: 14
    Thanks for the help! Heading over to ThemeForest to give a high rating.
  • AirAir
    Posts: 10,970
    Nice:-) and thanks:-)
  • Posts: 14
    Hi Air

    I'm still having trouble to make this work. I can only seem to get a single image added. Not any more than that. I's also a little confused about the exact names and values to use.

    I'm using the following info in my form:

    [Radio Box 1]
    name=_image_or_video_1
    value=Image

    [Upload Image 1]
    name=post_image_1
    value=(attached image link)

    To add more image upload forms I'm just changing 1 to 2,3,4 etc...

    However this doesn't seem to work. Only 1st image is uploaded.

    Do I need a hidden field to specify _image_count or something similar?

    Sorry to still annoy you with these questions.

    cheers
    Andrew
  • AirAir
    Posts: 10,970
    digirum said:
    Do I need a hidden field to specify _image_count or something similar?
    I think I explained that earlier :-) Yes you need.
    digirum said: name=post_image_1
    remember to start every name with "_".

    With regards.
  • Posts: 14
    Thanks Air. I've got it working now.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion