Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #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_toggle

    I 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 regards

    #1426683

    Hey 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,
    Ismael

    #1426690

    Thanks 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
    Xavier

    #1426761

    Hi,

    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,
    Ismael

    #1426764

    Hi 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
    Xavier

    #1427094

    Hi,

    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,
    Ismael

    #1427131

    Hi 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.
    #1427196

    Hi,

    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,
    Ismael

    #1427540

    Hi 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
    Xavier

    #1427546

    Hi,

    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,
    Ismael

    #1427615

    Sure, thanks, Ismael,

    Please find the access data in the private field

    Let me know if you need anything else

    Best regards
    Xavier

    #1427709

    Hi,
    Thank you for your patience and for the login, I examined your custom toggle element and found that the element had no toggles:
    Enfold_Support_4042.jpeg
    so based on one of your screenshots I added two toggles:
    Enfold_Support_4044.jpeg
    and now on the frontend they are showing:
    Enfold_Support_4046.jpeg
    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,
    Mike

    #1427829

    Hi 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
    Xavier

    #1427845

    Hi,
    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

Viewing 14 posts - 1 through 14 (of 14 total)
  • The topic ‘Customised Toggle element doesn’t show’ is closed to new replies.