-
AuthorPosts
-
June 22, 2020 at 12:18 pm #1224574
Hey everyone,
we use tab sections on a lot of pages e.g. https://edley.de/it-und-programmieren/
(ALLE IT PROGRAMMIEREN WEBENTWICKLUNG)When viewing the page on a smartphone, those tabs sometimes are added in a new row (like this https://ibb.co/hdZBfvB) instead of being aligned horizontally.
I already found several hits regarding this topic. Sometimes the tab script seems to calculate the min-width incorrectly. Is there a basic or better way to fix this besides using the suggested workarounds? (setting a min-width for the specific page)
Thanks! :)
- This topic was modified 4 years, 6 months ago by giaco_he.
June 25, 2020 at 2:25 pm #1225507Hey giaco_he,
Here is the code you can put in Enfold > General Styling > Quick Css, if it does not work, put into themes/enfold/css/custom.css
.js_active .av-tab-section-tab-title-container { min-width: 460px !important; }
If you need further assistance please let us know.
Best regards,
VictoriaJune 25, 2020 at 6:52 pm #1225644Hey Victoria,
I tried both (Custom CSS and themes/enfold/css/custom.css), but unfortunately it only works on some pages. Examples:
On this page it works: https://edley.de/it-und-programmieren/
On this page it doesn’t: https://edley.de/business/Any other ideas?
Thank you!
June 26, 2020 at 3:16 pm #1225863Hi giaco_he,
Here is the code you can put in Enfold > General Styling > Quick Css, if it does not work, put into themes/enfold/css/custom.css
.js_active #top.page-id-35 .av-tab-section-tab-title-container { min-width: 460px !important; } .js_active #top.page-id-27 .av-tab-section-tab-title-container { min-width: 660px !important; }
If you need further assistance please let us know.
Best regards,
VictoriaJune 26, 2020 at 3:54 pm #1225894Hi Victoria,
thank you, this almost works. The only problem is that the last tab is cut off at the end: https://ibb.co/9vQm2rc
June 27, 2020 at 5:19 pm #1226088Hi giaco_he,
It’s shown there to display that there are more tabs to follow, it can be tapped on like that.
What do you think a better solution would be?
Best regards,
VictoriaJune 27, 2020 at 7:08 pm #1226106Hi Victoria,
but there are no more tabs to follow – “MARKETING” is the last one.
A better solution would be to not cut the word off. It works on the page https://edley.de/it-und-programmieren/
(screenshot: https://ibb.co/202xdtr)Why doesn’t it work on https://edley.de/business/ ?
June 29, 2020 at 3:51 pm #1226487June 29, 2020 at 4:06 pm #1226491Hi Victoria,
thank you very much. Yes I get that.
The difference is that in your example the tab that is cut off is inactive. Inactive tabs can and should be cut off.
But active tabs should not be cut off. So how can I fix this? (https://ibb.co/9vQm2rc)Thanks
July 2, 2020 at 12:31 pm #1227460Hi,
Thank you for the screenshot.
If necessary, we can decrease the size of the font to make the title fully visible on smaller screens.
Add this css code in the Quick CSS field or the child theme’s style.css file.
@media only screen and (max-width: 767px) { #top .av-section-tab-title .av-inner-tab-title { margin-bottom: 13px; font-size: 11px; } }
Please make sure to toggle the Performance > File Compression settings, and remove the browser cache after adding the code.
Best regards,
IsmaelJuly 2, 2020 at 1:44 pm #1227493Hi Ismael,
thank you. Decreasing the size of the font seems like a cheap workaround (especially for a Premium Theme) and it also impairs the UX.
I want to fix the actual problem. In case the problem is still not clear, here’s a screenshot that hopefully removes all uncertainties about what the actual problem is: https://ibb.co/ZHV1dcR (red = problem; green = solution)
Thanks
July 6, 2020 at 6:59 pm #1228344Hi,
Thank you for the update.
If decreasing the font size is not an option, we can then instead modify the themes\enfold\config-templatebuilder\avia-shortcodes\tab_section\tab_section.js file directly and include an additional 20px to the minimum width of the title container.
Look for this code around line 84:
tab_wrap.css('min-width', min_width);
Replace it with:
tab_wrap.css('min-width', min_width + 20);
This is almost the same as using the css code that Victoria suggested above.
Please don’t forget to toggle the Performance > File Compression settings after adding the code.
Best regards,
IsmaelJuly 6, 2020 at 11:52 pm #1228393Hi,
thank you, I’ll try it!
Is it update-proof or will it be overwritten with every update?
Best regards,
GiacomoJuly 7, 2020 at 12:00 am #1228396Hi,
As long as you are operating within a child theme then it will be update proof.
Best regards,
Jordan ShannonJuly 7, 2020 at 12:04 am #1228399Hi,
is this true for JS files too? I thought this only works for template/php files..
Thanks
July 7, 2020 at 1:02 am #1228440Hi,
It works for JS as well. The JS files will have to be moved into the child theme with the same file structure as the parent.
Best regards,
Jordan ShannonJuly 13, 2020 at 11:08 pm #1230128Hi Jordan,
I tried using the exact same folder structure, but replacing the .js files didn’t work. I also found some references where someone was asking this, where they had to implement extra code into the functions.php..
Is this behavior (simple replacing) a new Enfold feature? I found nothing in the docs or forum that would suggest this. Hope you can help.Best regards,
Giacomo- This reply was modified 4 years, 5 months ago by giaco_he.
July 16, 2020 at 12:01 pm #1230891Hi,
Thank you for the update.
You have to create a new path for the shortcodes in the child theme directory by using the “avia_load_shortcodes” filter. Please check the documentation for more info:
// https://kriesi.at/documentation/enfold/intro-to-layout-builder/#add-elements-to-alb
After adding the “shortcodes” folder or path, create a duplicate of the enfold\config-templatebuilder\avia-shortcodes\tab_section folder inside the new shortcodes path, then edit the tab_section.php file. Inside the file, look for the extra_assets function and adjust the script URL so that it points to the new path in the child theme directory.
function extra_assets() { //load css wp_enqueue_style( 'avia-module-tabsection', AviaBuilder::$path['pluginUrlRoot'] . 'avia-shortcodes/tab_section/tab_section.css', array( 'avia-layout' ), false ); //load js wp_enqueue_script( 'avia-module-tabsection', AviaBuilder::$path['pluginUrlRoot'] . 'avia-shortcodes/tab_section/tab_section.js', array( 'avia-shortcodes' ), false, true ); }
Related threads:
// https://kriesi.at/support/topic/how-to-make-the-submenu-sticky-on-mobile/#post-1225113
// https://kriesi.at/support/topic/issues-in-adding-custom-code-to-postslider-php-in-child-theme/#post-1230323
// https://kriesi.at/support/topic/content-slider-column-amount/#post-1224986Best regards,
Ismael -
AuthorPosts
- You must be logged in to reply to this topic.