Viewing 18 posts - 1 through 18 (of 18 total)
  • Author
    Posts
  • #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, 5 months ago by giaco_he.
    #1225507

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

    #1225644

    Hey 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!

    #1225863

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

    #1225894

    Hi Victoria,

    thank you, this almost works. The only problem is that the last tab is cut off at the end: https://ibb.co/9vQm2rc

    #1226088

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

    #1226106

    Hi 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/ ?

    #1226487

    Hi giaco_he,

    It gets cut off here too:
    Image 2020-06-29 at 16.50.34.png

    It is built to use mostly icons or smaller words and in German words can get pretty long and so the issue arises.
    Best regards,
    Victoria

    #1226491

    Hi 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

    #1227460

    Hi,

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

    #1227493

    Hi 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

    #1228344

    Hi,

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

    #1228393

    Hi,

    thank you, I’ll try it!

    Is it update-proof or will it be overwritten with every update?

    Best regards,
    Giacomo

    #1228396

    Hi,

    As long as you are operating within a child theme then it will be update proof.

    Best regards,
    Jordan Shannon

    #1228399

    Hi,

    is this true for JS files too? I thought this only works for template/php files..

    Thanks

    #1228440

    Hi,

    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 Shannon

    #1230128

    Hi 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, 4 months ago by giaco_he.
    #1230891

    Hi,

    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-1224986

    Best regards,
    Ismael

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