This is searchable archive of our old support forums, which operated from 2012 - 2016. To find out how to get support for your current theme, please visit our support page.

Upload option type (Layout Builder)

  • Creator
    Topic
  • #3549
    ekimiya
    Member

    Hi there,

    i’d like help, I have a problem developping a new builder element with an image uploader.

    I have an upload type in my element :
    array(
    ‘id’ => ‘sloganimage’,
    ‘name’ => __( ‘Setup Image Slogan’, TB_GETTEXT_DOMAIN),
    ‘desc’ => __( ‘Select your image’, TB_GETTEXT_DOMAIN),
    ‘type’ => ‘upload’
    ),

    it works fine, the problem appear when I add another element in my layout… The first element works fine, but when I upload an image in the second one, the image is uploaded to the first one…

    Indeed, the two elements have the same ID in the form… Don’t know how to deal with it.

    Someone may help please ?

    Thanks guys !

Viewing 2 replies - 1 through 2 (of 2 total)
  • Author
    Replies
  • #3571
    Jason Bobich
    Keymaster

    Hello,

    Thank you for pointing this out. This is a bug in the theme I’ve got fixed for the next update. If you’d like to fix yourself, this is how you can do it. —

    Open this file:

    On line 145, find this:

    $output .= '<input id="' . $id . '" class="image-url upload' . $class . '" type="text" name="'.$name.'" value="' . $value['url'] . '" />' . "n";

    And change it to this:

    $output .= '<input id="' . uniqid( $id.'_' ) . '" class="image-url upload' . $class . '" type="text" name="'.$name.'" value="' . $value['url'] . '" />' . "n";

    Let me know if this temporary fix does not work for you.

    #3573
    ekimiya
    Member

    Thanks mate ! 🙂

Viewing 2 replies - 1 through 2 (of 2 total)
  • The forum ‘Alyeska Responsive WordPress Theme’ is closed to new topics and replies.