Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1192189

    Hi, is there a place with a thorough documentation for developing ALB elements?
    (with more than https://kriesi.at/documentation/enfold/intro-to-layout-builder/#add-elements-to-alb )

    I tried looking at the existing elements but I feel like they are not built in a consistent way and there are a few options and relationships I do not understand. So I was wondering if there is a more extensive resource.

    #1192730

    Hey lxbdr,

    This is the only documentation that we have available. You can ask here, we or our devs will try to help you :)

    Best regards,
    Victoria

    #1194060

    Hi Victoria,
    thank you, so here are my first few questions:

    1) When inserting an image using a "type" => "image" control, how can I fetch the attachment id instead of an image url so I can output an image with a srcset?

    [
    					'name' => __('Choose Image', 'avia_framework'),
    					'desc' => __('Either upload a new, or choose an existing image from your media library', 'avia_framework'),
    					'id' => 'content_img',
    					'type' => 'image',
    					'title' => __('Insert Image', 'avia_framework'),
    					'button' => __('Insert', 'avia_framework'),
    				],

    2) When using a template to insert a field, how can I overwrite attributes e.g. the id ? E.g. I would like to get my_link instead of link which is provided by the template linkpicker_toggle

    [
    					'id' => 'contact_link',
    					'type' => 'template',
    					'template_id' => 'linkpicker_toggle',
    					'subtypes' => array('no', 'manually', 'single'),
    				],

    3) How can I add an type tiny_mce field with a different id than content? Issue: When I add a tiny_mce field with a different id I can work with it set styles and the content is saved but when I reopen the popup element the content is turned into escaped html inside the visual tab.

    array(
    					'name' => __('Features', 'tfk'),
    					'desc' => __('Enter some content here', 'avia_framework'),
    					'id' => 'features',
    					'type' => 'tiny_mce',
    					'std' => __('Toggle Content goes here', 'avia_framework'),
    				),
    #1195359

    Hi,

    Thank you for the update.

    1.) That is the default output of the WordPress media uploader, so we can’t alter it without changing the core functions. If you want to retrieve the image id from its URL, try the custom function provided in the following page.

    // https://pippinsplugins.com/retrieve-attachment-id-from-image-url/

    You can also try this one:

    // https://developer.wordpress.org/reference/functions/attachment_url_to_postid/

    2.) You can add the target_id parameter to change the default linkpicker_toggle id.

    'target_id'		=> 'new_target'
    

    You can then fetch the $new_target to get the link once the attributes are extracted.

    3.) Can you give us a link to the page with the custom element or a screenshot of the issue?

    Best regards,
    Ismael

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.