-
AuthorPosts
-
November 29, 2023 at 10:24 am #1426678
Hello,
In Enfold-child, I copied-pasted toggles.php, then changed the class name as well as the shortcode:
avia_sc_toggle by my_toogle$this->config[‘shortcode’] = ‘av_toggle_container’;
av_toggle_container by my_toggle_container$this->config[‘shortcode_nested’] = array( ‘av_toggle’ );
av_toggle by my_toggleI did that by replacing the texts in all the file.
When I edit the page from the dashboard, update then click on view, all seems to work well, the component is correctly displayed.
BUT when I go directly to the url, the component is not showed.Is there something I missed ?
I did the same with testimonials.php and buttons_fullwidth.php, and for this two component all’s working fine.Thanks in advance for your help.
Best regardsNovember 29, 2023 at 10:43 am #1426683Hey xaviero7,
Thank you for the inquiry.
Why did you replace the name of the toggle shortcode? If you intend to override an element or shortcode in the child theme, you should create a folder called “shortcodes”, copy the shortcode files inside that folder, and then add this code to the functions.php file.
add_filter('avia_load_shortcodes', 'avia_include_shortcode_template', 15, 1); function avia_include_shortcode_template($paths) { $template_url = get_stylesheet_directory(); array_unshift($paths, $template_url.'/shortcodes/'); return $paths; }
For more info, please check the documentation below.
// https://kriesi.at/documentation/enfold/intro-to-layout-builder/#add-elements-to-alb
Best regards,
IsmaelNovember 29, 2023 at 11:27 am #1426690Thanks for your quick answer Ismael,
I did add this part of code in the functions.php located i the Enfold-Child shortcodes folder.
I wanted to change the name of the toggle shortcode because I need to keep the toggle component for other uses.
This new my-toggle element, displayed in the avia-builder is very specific, hence the changes I made.This works fine with Testimonial.php or buttons_fullwidth.php, so I wonder why this doesn’t work as expected with toggle.php
best regards
XavierNovember 30, 2023 at 4:50 am #1426761Hi,
Thank you for the update.
Please provide the content of the modified toggles.php file using pastebin.com. We would like to test it on our end.
I did add this part of code in the functions.php located i the Enfold-Child shortcodes folder.
The functions.php file should be located in the root directory of the child theme folder, not inside the shortcodes folder.
Best regards,
IsmaelNovember 30, 2023 at 6:22 am #1426764Hi Ismael,
Thank you for your answer.
Please find the customised toggle.php link below (as well as the password).Yes, the functions.php is correctly located at the root of the child theme folder
Best regards
XavierDecember 4, 2023 at 4:37 am #1427094Hi,
Thank you for the info.
The new shortcode or builder element is working correctly on our end. Did you place the toggles.php file inside the toggles folder? Please check the screenshot in the private field.
Best regards,
IsmaelDecember 4, 2023 at 1:33 pm #1427131Hi Ismael,
Thank you for this following up.
Actually, togglesDownloadXILS.php is put in the enfold-child/shortcodes folder and I kept toggles.php in the avia-shortcodes/toggles folder.
See the screenshot (in the private content)As I told you, updating and viewing the page from the WP dashboard is working fine, but when I want to directly access the url of the page, there is no toggleXILS (see screenshot2, from dashboard, screenshot3 from the url)
I’m sure it’s something I missed, but can’t find it.Thanks in advance for your help.
Best regards
Xavier- This reply was modified 11 months, 4 weeks ago by xaviero7.
December 5, 2023 at 7:50 am #1427196Hi,
Thank you for the screenshots.
The shortcode works fine on our end. Please try to delete the NoModif and Not Used versions of the shortcode file because these files might be overriding the file that you’re trying to edit.
Best regards,
IsmaelDecember 8, 2023 at 9:43 am #1427540Hi Ismael,
I understand but on our server, these NoModif and Not Used versions of the shortcake files wasn’t uploaded (sorry, I gave you a screenshot of the image I have on my computer). See below the screenshot of the server side.
So I’m still puzzled.
Best regards
XavierDecember 8, 2023 at 10:50 am #1427546Hi,
Thank you for the screenshot.
We may need to access your server in order to check the issue further. Please create a staging or development version of the site and post the S/FTP details in the private field.
Best regards,
IsmaelDecember 9, 2023 at 9:56 am #1427615Sure, thanks, Ismael,
Please find the access data in the private field
Let me know if you need anything else
Best regards
XavierDecember 10, 2023 at 6:32 pm #1427709Hi,
Thank you for your patience and for the login, I examined your custom toggle element and found that the element had no toggles:
so based on one of your screenshots I added two toggles:
and now on the frontend they are showing:
I logged out and checked again and it still shows, please check and adjust to suit.
I noticed that your custom toggle is using pre v5.6.8 code so when it is closed it leaves a gap, so you will want to use the latest version as the base for your customized element to fix this.Best regards,
MikeDecember 12, 2023 at 6:36 am #1427829Hi Mike,
Thank you for testing !
I’m a bit confused because there was a time that I did add toggles.
Anyway, after updating Enfold to the latest version my issue seems to be gone.But I also found a mistake in my modified component:
I forgot to change the following line:
$toggle_atts[‘custom_id’] = ‘toggle-id-‘ . avia_sc_toggle::$toggle_id++;This means that there was a confusion when using both custom and original toggle component.
I fixed this and all seems to work fine.Thanks again Mike and Ismael for helping me fixing this issue.
Best regards
XavierDecember 12, 2023 at 11:39 am #1427845Hi,
Glad we were able to help, if you have any further questions please create a new thread and we will gladly try to help you. Thank you for using Enfold.Best regards,
Mike -
AuthorPosts
- The topic ‘Customised Toggle element doesn’t show’ is closed to new replies.