5 posts
  • 4 Years of Membership
  • Collector Level 1
  • Exclusive Author
  • Mongolia
sodbileg
says

How can I add my own shortcode ( e.g. Testimonials ) like built-in elements on Visual Composer? For example, the built-in Accordion element has “Add accordion section” link below. I want my added shortcode be like that.

I tried extending The WPBakery_VC_Accordion and WPBakery_VC_Accordion_Tab classes with no luck.

583 posts PremiumLayers.com
  • Affiliate Level 2
  • Author Level 11
  • Beta Tester
  • Collector Level 3
+6 more
PremiumLayers
says

Tried contacting support, asked them to quote me basically with ANY price as I needed such an example really urgent and the one provided in the documentation does not work at all. It took me around 1 week of going back and forth with the support staff, could never even get to the actual plugin author to ask my questions. This is a pity as it’s a really good plugin, wish support was a little better than this.

16 posts
  • Trendsetter
  • Author Level 5
  • Exclusive Author
  • Affiliate Level 2
+2 more
ThemeDsgn
says

Hi, is there any tutorials for creating this custom element? I need to create custom tabs element, tried extending the built-in tabs, but no luck. Thanks in advance.

974 posts Rock 'N' Roll
  • Elite Author
  • Author Level 8
  • 4 Years of Membership
  • Most Wanted Winner
+5 more
LSVRthemes
says

Check out this. It works for me.

1763 posts How's the surf doing?
  • Power Elite Author
  • Trendsetter
  • Top Monthly Author
  • Community Superstar
+10 more
tommusrhodus
says

Hey everyone :)

Here’s some gists of my own blocks:

1. This example is just really simple, the main shortcode is simple enough to not need any options or globals applied, it simply wraps the innner shortcodes.

https://gist.github.com/tommusrhodus/0e9932214e8bf81ad1b9

2. This is a much more complex block, both the wrapper and nested shortcodes have options applied to them, furthermore they require globals to collect additional data and render it outside of the $content.

https://gist.github.com/tommusrhodus/698122d1fe22a2489bae

Hope that helps even a bit :)

583 posts PremiumLayers.com
  • Affiliate Level 2
  • Author Level 11
  • Beta Tester
  • Collector Level 3
+6 more
PremiumLayers
says

Tom, you are the man! Really appreciate you sharing the code, it’s a life-saver. Haven’t tried it in action yet, just one question – does it also solve the 2 icons appearing in the visual composer shortcodes list – one for the wrapper and for the inner shortcode? I had such issue previously and while I could figure out how to make the nested shortcodes work, that part was never solved.

1763 posts How's the surf doing?
  • Power Elite Author
  • Trendsetter
  • Top Monthly Author
  • Community Superstar
+10 more
tommusrhodus
says

does it also solve the 2 icons appearing in the visual composer shortcodes list

Yeah, my Gists above cover that, only the wrapper element is selectable from the main area, and then only the content element is selectable when you click on the wrapper.

On this Gist: https://gist.github.com/tommusrhodus/698122d1fe22a2489bae

See line 167 (as_parent) and 198 (as_child).

Cheers!

16 posts
  • Trendsetter
  • Author Level 5
  • Exclusive Author
  • Affiliate Level 2
+2 more
ThemeDsgn
says

Awesome, thank you very much everyone. :)

583 posts PremiumLayers.com
  • Affiliate Level 2
  • Author Level 11
  • Beta Tester
  • Collector Level 3
+6 more
PremiumLayers
says


does it also solve the 2 icons appearing in the visual composer shortcodes list

Yeah, my Gists above cover that, only the wrapper element is selectable from the main area, and then only the content element is selectable when you click on the wrapper.

On this Gist: https://gist.github.com/tommusrhodus/698122d1fe22a2489bae

See line 167 (as_parent) and 198 (as_child).

Cheers!

Thanks so much, really appreciate it!

1763 posts How's the surf doing?
  • Power Elite Author
  • Trendsetter
  • Top Monthly Author
  • Community Superstar
+10 more
tommusrhodus
says

Thanks so much, really appreciate it!

No problem!

by
by
by
by
by
by