Problem with shortcode in Additional Content

Home Forums Pro Support Problem with shortcode in Additional Content

Viewing 15 posts - 1 through 15 (of 33 total)
  • Author
    Posts
  • #68517
    Luca NappiniLuca Nappini
    Participant

    If I insert a shortcode in Additional Content, on the frontend the content in shortcode is insert without css style, it is like shortcode lose its css style. How I can solve this problem?

    Let me know

    #68549
    Peter FeatherstonePeter Featherstone
    Participant

    Hey Luca,

    As per the Forum Guidelines https://responsive.menu/forums/topic/forum-guidelines/ please provide your site URL and steps for me to check and recreate.

    Unfortunately, a shortcode is just a shortcode so my plugin can’t change the output. Have you tried outputting the shortcode somewhere else on your site to confirm that my plugin is affecting it in any way?

    Peter

    #68548
    Luca NappiniLuca Nappini
    Participant

    Yes, I try to put shortcode inside the page and inside the page the shortcode work perfectly, but if I insert the shortcode on the Additional Content area, the shortcode look to lose its css data.

    For example see this image http://www.macroweb.it/images/Problem-shotcode-in-additional-content.jpg (Additional Content is the grey area to right of menu”).

    Try you go to this page https://macroweb3.quadroweb.it/test-shortcode-in-responsive-menu-pro/:

    inside the page I inserted a shortcode and on the same time I inserted the shortcode on the Additiona Content (see Menu > Studio > Contatti): in the page the items are showed correctly but in the Additional Content the items lose css data.

    Let me know

    #68547
    Peter FeatherstonePeter Featherstone
    Participant

    Hi there,

    I can only assume that the content needs a container class of some kind or has some rules in the CSS that need a specific structure.

    Have you spoken to your web developer about this as looking through that, there is way too much code for me to be able to make sense of.

    Your web developer would have a far better understanding of how that section of HTML and CSS is supposed to work for you.

    Peter

    #68546
    Luca NappiniLuca Nappini
    Participant

    I’m a developer and I need to solve this problem with you.

    The problem is that ther’is a CSS conflict with responsive menu pro css file: for example, if in the shortcode is present paragraf tag “p”, the paragraf have css setted on responsive menu pro, and not in their css file. The same for “a” tag, padding, margin ecc.

    When a shortcode is insert on Additional Content area, some items lose the css setted on their proper css file and have the css setted on responsive menu pro css file. So, items inserted on Additional Content area, lose theis css file reference.

    Let mek now I can solve this conflict

    Thanks

    #68545
    Peter FeatherstonePeter Featherstone
    Participant

    Hey Luca,

    The additional content CSS does not touch links etc.

    I am looking at your HTML and it is very weird. What is in that shortcode? For example, you have the output of my menu in there twice. Are you using my plugin shortcode or something similar inside the plugin itself?

    Please search your HTML and you will see that you have the #responsive-menu-pro element on your page twice and also the additional content section is outside of one of the menus which is not correct.

    Basically, there is something very wrong about how the HTML is output on your page and I think that is the reason. You can confirm all of these errors (and there are a lot) below:

    https://validator.w3.org/nu/?doc=https%3A%2F%2Fmacroweb3.quadroweb.it%2Fcontatti-studio-tecnico-macroweb-arezzo%2F

    Please advise

    PEter

    #68544
    Peter FeatherstonePeter Featherstone
    Participant

    Hey Luca,

    I just checked and below is literally the only CSS that my plugin adds for the Additional Content section:

    #responsive-menu-pro-container #responsive-menu-pro-additional-content{
       padding: 25px 5%;
    }
    #responsive-menu-pro-container #responsive-menu-pro-additional-content {
       color: {{ options.menu_additional_content_colour }};
    }

    Peter

    #68543
    Luca NappiniLuca Nappini
    Participant

    I try to explain better:
    I insert in Additional Content area a easy shortcode [templatera id=”4814″].
    In this shortcode is present some Visual Composer (WPBackery) code and is the Visual Composer items that lose their css in Additional Content area.
    If the same shortcode [templatera id=”4814″] is inserted on a page, the code work perfectly.

    P.S.
    I know that in html is 2 #responsive-menu-pro but the first have “display:none” css rule so is not present on frontend.
    That structure of menu on my website appear complicated but is quite easy: the all menu you see is created on Additional Content, so in the white left part (30%) is replicated #responsive-menu-pro, in the right grey part (70%) is inserted the shortcodes.

    #68542
    Peter FeatherstonePeter Featherstone
    Participant

    Hi Luca,

    Your problem is what I explained previously.

    Your second #responsive-menu-pro element is inside the Additional Content container. It should not be in there and if it is then you will have all these problems. I’m not sure how you even managed to get it in there.

    You should also not have 2 of the same elements on the same page. An ID is meant to be unique and now you have 2 of every ID so it is not going to work. Putting display: none on the first one doesn’t matter, the HTML is still invalid.

    You need to fix the issues above otherwise it will not work.

    Hope that helps

    Peter

    #68541
    Luca NappiniLuca Nappini
    Participant

    Ok, I try follow your suggestion,
    now the second #responsive-menu-pro is became “#menu-2” and ther’is only the item “contatti” on the menu but the problem is the same and is not solve.

    Try to check.

    #68540
    Peter FeatherstonePeter Featherstone
    Participant

    Hi Luca,

    Unfortunately your site is unavailable at the moment so I can’t look at it.

    I think you are going to need to read through the CSS and the HTML output of the one both inside and outside my plugin to make sure all are in place.

    If there are any differences try removing them one by one using the Inspector Tools until you find the cause.

    Hope that helps

    Peter

    #68539
    Luca NappiniLuca Nappini
    Participant

    Sorry, now the website is available,
    check https://macroweb3.quadroweb.it/test-shortcode-in-responsive-menu-pro/

    #68538
    Peter FeatherstonePeter Featherstone
    Participant

    Hi Luca,

    I’m struggling to know what I can suggest here.

    You need to go through the CSS and HTML and see where my plugin is overwriting yours because I can’t see my plugin doing that anywhere.

    All I can see is that your two containers for your circles have different Ids and there are no styles for the second. For example one is #mpc_circle_icons-785aaaebd05c0f0 and the other is #mpc_circle_icons-885aaaebd016cee.

    You really need to speak to the developer of this website because I don’t think this is because of my plugin.

    Peter

    #68537
    Peter FeatherstonePeter Featherstone
    Participant

    Hi Luca,

    In fact that is the exact issue. As soon as I change the ID of the container inside my plugin from #mpc_circle_icons-785aaaebd05c0f0 to #mpc_circle_icons-885aaaebd016cee it works fine.

    As before, this is not an issue with my plugin.

    Peter

    #68536
    Luca NappiniLuca Nappini
    Participant

    Peter, I find the problem, please follow me:

    the problem is not related directly with shortcode, the problem was generated when I insert in Additional Content area the Visual Composer code (now renamed WPBackery) or other plug-in similar. if I insert in a worpress page a Visual Composer code, the code work perfectly, but if I insert the Visual Composer code in Additional Content area some css are lose and some are ovverride. See this simple example:

    This is a simple Visual Composer code (a simple tab element):

    
    [vc_row][vc_column][vc_tta_tabs][vc_tta_section title="Scheda 1" tab_id="1521186528560-f58361c0-20f3"][vc_column_text]
    
    I am text block. Click edit button to change this text. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.
    
    [/vc_column_text][/vc_tta_section][vc_tta_section title="Scheda 2" tab_id="1521186528582-a08f3e7e-4e64"][/vc_tta_section][/vc_tta_tabs][/vc_column][/vc_row]
    

    If this code is inserted on page I have this css related to “a” element:

    
    .wpb-js-composer .vc_tta.vc_general .vc_tta-tab>a {
        padding: 14px 20px;
        display: block;
        box-sizing: border-box;
        border: solid transparent;
        position: relative;
        text-decoration: none;
    }
    

    But, If this code is inserted on Additional Content area I have this css related to “a” element:

    
    .wpb-js-composer .vc_tta.vc_general .vc_tta-tab>a {
        display: block !important;
        border: solid transparent !important;
        position: relative !important;
        text-decoration: none !important;
    }
    * so "padding: 14px 20px;" and "box-sizing: border-box;" are cut off...
    

    So, Visual Composer tab have some css rules different in a wordpress page and in Addition content area and this differences cause the problem.

    Also, following your suggestion, I try to take off some rules to css related to Additional Content area, for example this below:

    
    #responsive-menu-pro-container #responsive-menu-pro-additional-content {
        color: rgba(224, 137, 137, 1);
    }
    
    #responsive-menu-pro-container, #responsive-menu-pro-container:before, #responsive-menu-pro-container:after, #responsive-menu-pro-container *, #responsive-menu-pro-container *:before, #responsive-menu-pro-container *:after {
        box-sizing: border-box;
        margin: 0;
        padding: 0;
    }
    

    Without the rules upon, some problem are solve, for example I can have a correct tab code.

    So, problem is with Visual Composer (and other plug-in related like Massive plug-in) compatibility with Additional Content area.

    At the same time if a shortcode have Visual Composer elements, and I insert the shortcode in Aditional Content area, I have the same css problems.

Viewing 15 posts - 1 through 15 (of 33 total)
  • The topic ‘Problem with shortcode in Additional Content’ is closed to new replies.