Viewing 28 posts - 1 through 28 (of 28 total)
  • Author
    Posts
  • #764934

    Hi
    I find that tip and I want to apply it in child theme to avoid overwrite changes after next update.
    I am not shure about proper way to make changes.
    Should I create in child theme folder empty folders config-templatebuilder where I will place avia-shortcodes files with changes?
    Thank you in advanced
    Krzysztof

    #764956

    Hey Krzysztof,

    Yes, you would basically recreate the parent structure in the child theme.

    Best regards,
    Jordan Shannon

    #765005

    Hi Jordan
    Thank you, but I find another issue:-)
    What I am going to do?
    I wan to change Icon list titles from H4 to H3 for SEO purpouse.
    I find file iconlist.php in \enfold\config-templatebuilder\avia-shortcodes\iconlist.php then I changed in that file
    old code

      $title_el = "h4";
                    $iconlist_title = "";
                    if($this->iconlist_styling == "av-iconlist-small")
                    {
    	                $title_el = "div";
    	                $iconlist_title = "_" . "small";
    	            }

    to

    $title_el = "h3";
                    $iconlist_title = "";
                    if($this->iconlist_styling == "av-iconlist-small")
                    {
    	                $title_el = "div";
    	                $iconlist_title = "_" . "small";
    	            }

    But I see that iconlist titles are still H4 How I can change it?
    BR
    Krzysztof

    • This reply was modified 7 years, 9 months ago by Krzysztof.
    #765116

    Hi,

    Please try clearing your cache a few times and reload the page.

    Best regards,
    Jordan Shannon

    #765616

    Hi
    I cleared cache several time and still see H4.
    Here is screenshot
    I have checked also with another browser and it is the same.
    I also make this changes directly in main theme but it is something wrong.
    Can you check again?
    BR
    Krzysztof

    #765619

    Hi,

    That is the correct file. Are you making sure the it is the correct file folder for the main theme. I have tested this on my system and it updates with no issue at all. If possible please provide ftp access so I can look into this.

    Best regards,
    Jordan Shannon

    #765641

    Hi
    Yes, please find in privat area. It looks like when I added to main theme it works, but when I try to change in child theme I made a mistake.
    BR
    Krzysztof

    #765651

    how do you garantee that the child-theme shortcode was taken?

    i hold the same structure when i want to replace a shortcode.
    So my subfolder is the same name (shortcodes) in Child-Theme folder and than i put in functions.php of child-theme the following:

    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;
    }
    #765661

    Hi,

    Yes, please try Guenni007’s above suggestion. Make sure you replicate the same structure as the parent theme.

    Best regards,
    Jordan Shannon

    #765707

    does that code work anymore? because allthough the the new shortcodes are seen in Dashboard Editor the changings have no influence any more – if i overwrite the original file it works as Krzysztof said

    i have installed on that testinstallation Enfold 4.0.3

    • This reply was modified 7 years, 9 months ago by Guenni007.
    #765982

    see here – this code above is in child-theme functions.php – and you see it is loaded to editor list! but there is no influence of h3 here.
    It stayes h4 till the original file is overwritten. (Click on image to zoom)

    #765988

    i solved this – download go ahead.

    • This reply was modified 7 years, 9 months ago by Guenni007.
    #766022

    I have added that code to functions.php of child-theme. But it doesn’t work.
    I’ve created 2 folders in enfold-child theme: config-templatebuilder/avia-shortcodes/ and here i placed iconlist.php file with changes
    It is right?
    BR
    Krzysztof

    #766129

    that is to complex the line in the code : array_unshift($paths, $template_url.'/shortcodes/');
    gives the folderstructure :

    just a folder “shortcodes” (or in case to replace a script “js” ). and in it the files – but as i described above since 4.0.3 this “half-worked”
    The new files are loaded to dashboard – appearance – editor. but the changings of those files has no influence.
    When i overwrite the original by the new one – changings take place. So i’m now a bit helpless too!

    • This reply was modified 7 years, 9 months ago by Guenni007.
    #766174

    so here are my icon-list and icon-box shortcodes : you can choose what title tag it has (h1 to h6)
    Download. it makes no sense to choose in a list the h1 (a h1 should be unique per page) so there is only h2 to h6 possible)

    but see : https://kriesi.at/support/topic/add-changes-in-config-templatebuilderavia-shortcodes-in-childtheme/#post-765982

    • This reply was modified 7 years, 9 months ago by Guenni007.
    #766202

    Hi
    Thank you
    Link for download is not proper, can you check?

    #766218

    Sorry : try again please Download
    and for the moment overwrite the original file in Enfold Folders

    see. Resultpage: https://webers-testseite.de/kokon/elements/icon-list/

    #767198

    Hi,

    I think having an “h1” option is not a bad idea. The user will have an option to add a single item in the icon list element and set the heading to “h1” if he chose to use that element as the page title. Anyway, thanks for the help as always.

    Best regards,
    Ismael

    #767337

    Hi

    Thank you for your help.
    Sorry but I am not sure what I need to do.
    I insert 2 files to enfold-child/config-templatebuilder/avia-shortcodes/here
    When I checked nothing is changed
    Whers is my mistake?

    Because I previous created a lot of pages now I don’t need to have choice I need only to change H4 to H3 on whole iconlist on the page.
    BR
    Krzysztof

    #767837

    Hey!

    We changed the “shortcodes” directory in the child theme.

    Regards,
    Ismael

    #767953

    in icon-box.php you could choose the h1 but in the list all listpoints get that h1 – so a multiple h1 on page.
    But it is easy to add this option as you know. just add in that array the h1 option

    "subtype" => array("H1"=>'h1',"H2"=>'h2',"H3"=>'h3',"H4"=>'h4',"H5"=>'h5',"H6"=>'h6')

    #767955

    on line 443 of icon-list.php there is the code:

    $title_el = "h4"; change it to $title_el = "h3";

    save the icon-list.php and upload it to your child-theme/shortcodes folder (on Enfold 4.0.3 the overwriting of shortcodes through child-theme files does not work as before – it is on 4.0.4. ok again) so put in child-theme functions.php :

    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;
    }

    but ! i don’t know if allready placed iconlist will change than to h4. Definitly new placed or edited will do.

    #767966

    Hi
    Thank you for explanation, how works great!
    Last question: should I copy whole oryginal file icon-list.php into child theme and make a changes in it?
    If in new version in the Future will be some changes in that files, this changes overwrite oryginal file?
    Thank you again!
    BR
    Krzysztof

    #767977

    yes that is the way – a copy to child-themes/shorcodes folder and than edit this copy.

    if they are in child-theme folder they will not be overwritten – but you are right if there are fundamental changings in a shortcode of an updated Enfold Parent Theme you won’t come into joy of these new features, because Enfold will than load the child-theme shortcode.
    But! usually there might be new shortcodes (as now Tab-Section) but very unlikely changings to existing shortcodes.

    • This reply was modified 7 years, 9 months ago by Guenni007.
    #767983

    Great
    Thank you again
    It was very helpfull!
    Krzysztof

    #769190

    Hi!

    in icon-box.php you could choose the h1 but in the list all listpoints get that h1 – so a multiple h1 on page.

    Yes, it’s true but you can also remove the other items in the list and leave a single item then use it as the page title.

    Best regards,
    Ismael

    #1464768

    Is this still working to use the custom files in the config template builder?

    function avia_include_shortcode_template($paths){
      $template_url = get_stylesheet_directory();
          array_unshift($paths, $template_url.'/shortcodes/');
      return $paths;
    }
    add_filter('avia_load_shortcodes', 'avia_include_shortcode_template', 15, 1);
    #1464785

    Hi,
    This is only for items in the /avia-shortcodes/ directory and you must add the code to your child theme and add a /shortcodes/ directory to your child theme, please see our documentation here. If the page doesn’t scroll automatically, scroll to Add Elements to ALB

    Best regards,
    Mike

Viewing 28 posts - 1 through 28 (of 28 total)
  • You must be logged in to reply to this topic.