Hi, we have used wpbakery in the previous and we have many custom made elements we want to move over to salient now as we want to use Salient as "back-office" as the functions and customizations is so much better then the normal wpbakery. Is it any way to to this easy? and still keep them when we upgrade. We do understand we need to use the child theme, but cant get it to work.
I found that before, it is how to replace your templates, not how to add a new one. I want to keep your templates, as they are great and thats why we are switching to salient, but we need to have the custom made templates we have from before in wpbakery and move them to salient.
Adding a custom element via a child theme can be handled by following the steps below.
Create directories in the child theme to hold the element maps (where you register the element and settings for it) and template files (where the element markup exists). For example,
salient-child/custom-elements/maps
salient-child/custom-elements/templates
For this example, we'll create a new element called "a_new_el".
In your child functions.php, add the following:
add_action('vc_before_init', 'nectar_wpbakery_blocks');
function nectar_wpbakery_blocks() {
vc_lean_map('a_new_el', null, get_stylesheet_directory() . '/custom-elements/maps/a_new_el.php');
// more maps can go here.
}
Now to connect the custom element to the template file, you can use the parameter "html_template" into your map file (custom-elements/maps/a_new_el.php) which will specify where to load the template file from for rendering on the frontend. An example of that would look like:
I been trying but I dont seem to get it to work, is it sure its the correct way? I am not a professional on this, but I would think I could follow the instructions. Thank you :)
Yes, the method has been tested. If you'd like to provide a temporary admin account, I'd be glad to take a look at your child theme to see if I can spot any issues.
Hi, we have used wpbakery in the previous and we have many custom made elements we want to move over to salient now as we want to use Salient as "back-office" as the functions and customizations is so much better then the normal wpbakery. Is it any way to to this easy? and still keep them when we upgrade. We do understand we need to use the child theme, but cant get it to work.
I cant find anything in the support files.
Hey Again,
This might help:http://themenectar.com/docs/salient/developer-docs/ .
Thanks
ThemeNectar Support Team
Hi Tahir,
I found that before, it is how to replace your templates, not how to add a new one. I want to keep your templates, as they are great and thats why we are switching to salient, but we need to have the custom made templates we have from before in wpbakery and move them to salient.
Escalating to the Developer so he may add in a further response.
Thanks
ThemeNectar Support Team
Thank you, much appricated!
Hey byggis!
Adding a custom element via a child theme can be handled by following the steps below.
Create directories in the child theme to hold the element maps (where you register the element and settings for it) and template files (where the element markup exists). For example,
For this example, we'll create a new element called "a_new_el".
In your child functions.php, add the following:
Inside the salient-child/custom-elements/maps/a_new_el.php file, you can use the WPBakery map parameters as you're used to: https://kb.wpbakery.com/docs/inner-api/vc_map/
Now to connect the custom element to the template file, you can use the parameter "html_template" into your map file (custom-elements/maps/a_new_el.php) which will specify where to load the template file from for rendering on the frontend. An example of that would look like:
After doing that, simple edit the custom-elements/templates/a_new_el.php file to control the output of the element
Hi ThemeNectar,
I been trying but I dont seem to get it to work, is it sure its the correct way? I am not a professional on this, but I would think I could follow the instructions. Thank you :)
Hey byggis,
Yes, the method has been tested. If you'd like to provide a temporary admin account, I'd be glad to take a look at your child theme to see if I can spot any issues.
Cheers