New to Visual Composer Development


#1

Hey all :slight_smile:

After a lot of deliberation I’ve decided that some of my future themes will be run off Visual Composer, now I’m pretty happy with where I’m at with the development process of it all.

Just one question really for all you VC aficionados, how are you going about making repeatable fields. For example the default Accordion block, I’m picking through the source of it, but I’d be lying if I said I was 100% with it yet.

In short, if you use VC, have you made any custom blocks with repeatable stuff, if yes, how did you go about it? :slight_smile:

Thanks all!

Tom


#2

Hi Tom!

I usually do it creating a simple container shortcode/module. Then, I just create a normal module that can be inside of this container only.

It’s usually really easier than create a custom view, like Tabs does.

Kind Regards.


#3

Ahh, that’s a great idea, simple is always best, thanks mate :slight_smile:


#4

You’re welcome.

Let me know if you have any question about it!

Kind Regards.

(Oh gosh, I’m replying forum threads like support tickets - looks like is time to rest a bit hehehe)


#6

Nested shortcodes is still a problem with VC because we can’t get informations about “parent shortcode” (vc container) from “child shortcode”… .So we can create do something like:

Parent Shortcode - Fancy List with param: type
Fancy List Item - we can’t get param type from container Fancy List


#8

Your solution is interesting. Well, but as you wrote - there are still problems, still nested shortcodes are not supported as they should be, with such a top seller module, author should create solution for this because I wrote to him about nested shortcodes over year ago.


#9

Example Gist below for what I use for nesting on new theme I’ve been working on, maybe will help.

I keep the shortcodes separate just so they work when VC is not enabled.

There are a few things that can be done for the passing of params to nested shortcode, if you’d like I can get a example of those up as well.


#11
PremiumLayers said
webcreations907 said

Example Gist below for what I use for nesting on new theme I’ve been working on, maybe will help.

I keep the shortcodes separate just so they work when VC is not enabled.

There are a few things that can be done for the passing of params to nested shortcode, if you’d like I can get a example of those up as well.

I think there’s an easier way to check against that, just add a function in functions.php file to check if vc_map function exists, and if the answer is positive, include all files of vc_templates folder of the theme. This way you won’t have to check it with each shortcode.

Yeah I do that, I just meant that if the user disables VC plugin I still want the shortcode to work and not have it rely on VC for outputting it the shortcode content. :slight_smile:


#12

Thanks for the answers everyone, looking through this now :smiley:


#13

Hi everyone, I ran across this thread while searching for a solution to mapping a container with VC’s mapping feature. I’m not a developer like you guys so this stuff isn’t exactly obvious to me, but I’m not exactly an amateur either. I guess I fall into the “dangerous” category.

So I’ve been mapping out all the theme short code in VC and I came across a few elements that that use containers to style the nested content. i.e.

[sc_container_withstyle] [sc_elements] Content [/sc_elements] [/sc_container_withstyle]
</ br>
I dove into the VC knowledge base and found some code that I think is used to create custom nested containers, but there are a couple of things I don’t understand…

https://wpbakery.atlassian.net/wiki/pages/viewpage.action?pageId=524362

One, where the heck does this code go? Does it go into functions.php?

Two, I see that I would need to replace areas such as:

“base” => “your_gallery”,

with “base” => “my_shortcode”,

but what about stuff like “my-text-domain” where it doesn’t reference it at all in the example above it?

Any help would be greatly appreciated. Like I said, I’m not a developer, but I do catch-on quickly.