-
AuthorPosts
-
September 13, 2021 at 10:17 am #1320688
Hello,
i created an extraction of various subcategories as a list as you can see here
And if you select one of the single categories the extraction is correctly filtered.
I would like to have also the relative permalink so when i hit ORTAGGI Q&A the link would appear such as https://srgl.it/inorto/domanderisposte/#ortaggi-qaIs that possible? If yes how?
Thank you in advanceSeptember 14, 2021 at 6:59 am #1320845Hey SurigliaStudio,
Thank you for the inquiry.
This is possible, but you have to modify the enfold/config-templatebuilder/avia-shortcodes/magazine/magazine.js file. Look for this code around line 26.
current.addClass('active_sort');
And below, add this code.
window.location.hash = decodeURI(current[0].outerText).toLowerCase();
Please toggle or temporarily disable the Enfold > Performance > File Compression settings after doing the modification.
Best regards,
IsmaelSeptember 14, 2021 at 9:17 am #1320860Hello Ismael,
can I put the modified file in the child folder or it has to be in the enfold one?
ThanksSeptember 14, 2021 at 9:27 am #1320861Hello again. I tried to put it in the child folder and doesn’t work.
In the original folder it works but there is a little issueAs you can see here if you click on the filters you see the # filled with %20 instead of spaces. I need to have a talking url, like this
Plus if i just copy the genereted url once i clicked on a filter es.
and paste in a new window the filter is not triggered as should be. So I find myself in the regular page with a strange url.
Any hint?
Thank you in advance.September 15, 2021 at 12:01 pm #1321023Hi,
Unfortunately, you will not be able to override this in the child theme without editing the shortcode file directly. You have to add the following snippet in the functions.php file to create a new shortcode path in the child theme, copy the magazine.php file and modify the script path in the extra_assets function.
// https://kriesi.at/documentation/enfold/intro-to-layout-builder/#add-elements-to-alb
To convert the %20 characters to a hyphen, try to replace the previous code using the following snippet.
window.location.hash = decodeURI(current[0].outerText).toLowerCase().replace("%20", "-");
Best regards,
IsmaelSeptember 16, 2021 at 6:07 pm #1321271Hello Ismael,
I tried what you said but i have some difficulty.After i added the new “shortcodes” folder into my child theme and added the function in the child theme should I recreate the path of the magazine folder completely?
ex. mytheme/config-templatebuilder/avia-shortcodes/magazine/
and put in this folder both, the php and the js files?
After this on the php i should change the path line on the php for the js like this?
wp_enqueue_script( ‘avia-module-magazine’, AviaBuilder::$path[‘pluginUrlRoot’] . ‘shortcodes/config-templatebuilder/avia-shortcodes/magazine/magazine.js’, array( ‘avia-shortcodes’ ), false, true );
?What am I missing?
September 17, 2021 at 6:52 am #1321319Hi,
Thank you for the update.
You have to place the magazine/magazine.php file inside the shortcodes folder within the child theme directory. That is the new avia-shortcodes folder. So the new folder structure would be yourchildtheme/shortcodes/magazine/*(magazine shortcode files including php, js etc). And yes, you have to adjust the script path in the wp_enqueue_script function.
Best regards,
Ismael -
AuthorPosts
- You must be logged in to reply to this topic.