• Resolved mw108

    (@mw108)


    I’m using Elementor Pro and want to display an image via a custom shortcode as displayed here: https://docs.elementor.com/article/449-dynamic-shortcode

    https://i.stack.imgur.com/dTKU8.jpg

    But it isn’t working. There is simply nothing displayed. Neither in the editor, nor in the frontend. Also not if I remove the brackets [ ... ] around the shortcode and try brand_banner only.

    It does not produce any DOM output in the frontend, just an empty elementor-widget-wrap div:

    <div class="elementor-element elementor-element-4f1547ad elementor-column elementor-col-50 elementor-inner-column" data-id="4f1547ad" data-element_type="column">
    	<div class="elementor-column-wrap  elementor-element-populated">
    		<div class="elementor-widget-wrap">
    		</div>
    	</div>
    </div>

    However, if I use a simple text editor widget and put the shortcode in, it works as expected:

    https://i.stack.imgur.com/uBf16.jpg

    DOM:

    <div class="elementor-element elementor-element-37728dd elementor-widget elementor-widget-text-editor" data-id="37728dd" data-element_type="widget" data-widget_type="text-editor.default">
    	<div class="elementor-widget-container">
    		<div class="elementor-text-editor elementor-clearfix">
    			<img src="https://some.domain.com/wp-content/uploads/banner-a.jpg"></div>
    		</div>
    	</div>
    </div>

    This is the code for the shortcode:

    public function shortcode_brand_banner( $atts )
    {
    	$brand = $this->getRandomBrandFromPool();
    	// Return the rendered image HTML.
    	return ( types_render_field( 'image-brand-banner', [ 'post_id' => $brand->post->ID ] ) );
    }

    I thought maybe it is because it doesn’t expect HTML, but rather an image URL. So I changed the code to this, but it doesn’t work either:

    public function shortcode_brand_banner( $atts )
    {
    	$brand = $this->getRandomBrandFromPool();
    	// Only return image URL like "https://some.domain.com/wp-content/uploads/banner-a.jpg"
    	$image = get_post_meta( $brand->post->ID, 'wpcf-image-brand-banner' )[ 0 ];
    	return ( $image );
    }

    What is the problem here? Is this a bug in Elementor Pro? What kind of output does the Widget expect?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Since you are using Elementor Pro, please submit a ticket through my.elementor.com and a technical support representative will be able to help you.

    Thread Starter mw108

    (@mw108)

    Yes, thats what I did, twice. And they refuse to help. They say I should open a ticket on Github.

    First response from “Cesar”:
    I'm afraid we can't provide support for custom code. [...] You can also post this inquiry on our GitHub project page, maybe one of our developers will have some insights into this.

    Second response from “Kai”:

    I suggest that you also post this to our Github page so you can be answered by our developers who have more expertise on this subject.
    
    To post on our Github Repository, you can follow this guide: https://github.com/pojome/elementor/blob/master/.github/CONTRIBUTING.md

    And if you follow the link to the Github page, it clearly says: Please DO NOT open issues for general support questions […] To receive free support for Elementor we have the following channels: […] Support forums on www.ads-software.com and If you have purchased Elementor Pro, you are entitled for personal support […].

    But unfortunately there is no “personal support”, because the “personal support” refuses to help. They are like “*shrug* Not our soup!”

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Image Widget Dynamic Shortcode: No output’ is closed to new replies.