Problem with shortcode in Additional Content

Home Forums Pro Support Problem with shortcode in Additional Content

Viewing 15 posts - 16 through 30 (of 33 total)
  • Author
    Posts
  • #68535
    Peter FeatherstonePeter Featherstone
    Participant

    Hey Luca,

    I’m glad you managed to find the cause.

    However, when I just changed the ID of the element in the page all of the styling worked for me so I’m not sure if that helps and if you can specify IDs in the shortcode or in Visual Composer at all.

    Peter

    #68534
    Luca NappiniLuca Nappini
    Participant

    Peter, when you have cange the ID you simple teke css code off the same element taht I inserted on the page and not on the Additional content area.

    The page you see is a Test page where the same shortcode is inserted on a html page and at same time on a Additional content area, to explain wath is the differences and to explain you taht in Additional content area I lose some css rules.

    The problem is not only my proplem but is a incompatibility beetwen Additional Content area and Visual Composer plug-in.

    Peter, Responsive Menu Pro is the best menu plug-in for worpress in my opinion (and not only for wordpress), but 99% of people work with Visual Composer in wordpress and in many plug-in (or shortcode), so if you solve this problem with Visual Composer, you have a new great function for Responsive Menu Pro. Please, take some time to check this incompatibility, try yourself to take some Visual composer item on Additional content area and see the problem.

    #68533
    Peter FeatherstonePeter Featherstone
    Participant

    Hey Luca,

    Thanks for the kind words in regards my plugin.

    However, I don’t think there is an incompatibility with Visual Composer. As you say lots of people use it and this is the first time I have seen this issue and it does seem very specific to your use case.

    The additional content field does not have the ability to take any CSS away, it is just not possible. The problem is that your CSS is referencing an ID that doesn’t exist any-more.

    If you can create the CSS with the correct ID or tell the shortcode which ID to use then it will work. As I said, simply changing the ID on the page you presented me brings all the CSS back and makes it work fine. You can try it in your browser using the Inspect Elements tool, just change the ID and it all works again.

    My plugin can’t take CSS rules away, that is impossible. The problem is the referencing of classes and IDs because these have changed between the elements on the page (but not because of my plugin). Potentially it is because you are trying to put 2 of the same element on the page at once (one on the page and one in the menu) so the shortcode is getting confused.

    It’s similar to my plugin and the reason why you can’t have more than one menu on the same page at once.

    Hope that helps

    Peter

    #68532
    Luca NappiniLuca Nappini
    Participant
    
    
    "...Potentially it is because you are trying to put 2 of the same element on the page at once (one on the page and one in the menu) so the shortcode is getting confused..."
    

    Exactly Peter, but the problem of 2 ID is another problem and was related only for the Test Page used to explain better you the problem with CSS. Forget this other problem about ID and think about Visual Composer elements on Additional Content area.

    Please, try in your page:
    1) create a new wordpress page with inside a Visual Composer items (for example a tab element)
    2) put the same Visual Composer items in the Additional Content area (or a shorcode with inside Visual Composer items)
    3) see in Additional Content area wath appen for Visual Composer items

    #68531
    Peter FeatherstonePeter Featherstone
    Participant

    Hi Luca,

    I’m not sure what more can be done here.

    What exactly do you propose the issue is so I can fix it. As far as I can see, putting something in the Additional Content field should have no effect on CSS or styling. The CSS my plugin adds for the Additional Content field is so minimal that it won’t affect any current page CSS. In addition there is no way for my plugin to change Visual Composers HTML or CSS output.

    I really don’t know what I can do about how Visual Composer outputs their HTML/CSS on the page but I am open to suggestions. Have you tried putting the same element inside another WordPress plugin that accepts shortcodes? WordPress own inbuilt widget for example or another plugin that allows shortcode output?

    Please advise

    Peter

    #68530
    Luca NappiniLuca Nappini
    Participant

    Peter please follow me and take your test:

    This below is a simple Visual Composer code for tab

    [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]

    so:
    1) take this code in Additional Content area;
    2) see wath appen in frontend (you see that the tab in Additional Content area, are not showed perfectly);
    3) try to cat off the css related to Additional Content area (for example “padding”, “margin”, “box-sizing” and color), so you can see that tab in Additional Content area, are showed perfectly (because have their proper css related).

    I think the problem was caused from “*” that you use on the css rules related to Additional Content.

    Try please

    #68529
    Peter FeatherstonePeter Featherstone
    Participant

    Hi Luca,

    So it seems the only issue is simply because of the box-sizing CSS attribute?

    If so, there isn’t anything I can do about that because it is needed for my plugin and if that is all it is then you can just overwrite this via Custom CSS.

    Please let me know

    Peter

    #68528
    Luca NappiniLuca Nappini
    Participant

    The problem was the use of “*” in Additional Content css rules (see below), so ALLpadding“, “margin” and “Box-sizing” in elements of Add. Cont. area are overwrited with this css rules:

    #responsive-menu-pro-container *, #responsive-menu-pro-container *:before, #responsive-menu-pro-container *:after {
        box-sizing: border-box;
        margin: 0;
        padding: 0;
    }

    So, you need to cut off “*” in css rules, insted of all elements inserted on Add, Cont. area have some visualization problem, because Padding, Margin and Box-sizing are overwrited from your rules.

    #68527
    Peter FeatherstonePeter Featherstone
    Participant

    Hey Luca,

    Ah ok I see, if that is all it is then that is a simple fix in the end.

    I don’t think anything needs to be done in regards Visual Composer integration, it just means people need to reset their CSS for the additional content section if it causes some issues because of padding, margins and the box-sizing.

    Thanks for the investigation and finding the cause.

    Peter

    #68526
    Luca NappiniLuca Nappini
    Participant

    it just means people need to reset their CSS for the additional content section if it causes some issues because of padding, margins and the box-sizing.

    Yes if you add 1-2 div only, but if you have hundreds of div (like in some code, for example in some Visual Composer items) is impossible to reset all div.

    So, you need to update the Responsive menu pro to solve “*” problem?

    #68525
    Peter FeatherstonePeter Featherstone
    Participant

    Hey Lucas,

    No you don’t. I don’t use any * in my style-sheets. You just need to reset the styles I created and that is all.

    #responsive-menu-pro #responsive-menu-pro-container {
       padding: 0;
       margin: 0;
       box-sizing: <your-choice>
    }

    You don’t need anything more than that.

    Peter

    #68524
    Luca NappiniLuca Nappini
    Participant

    Peter, like said previously, you use “*” in the style below and this cause all problem:

    @media screen and (max-width: 8000px)
    #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;
    }
    #68523
    Peter FeatherstonePeter Featherstone
    Participant

    Hey Luca,

    Are we talking about the container here or the additional content section?

    If you just want to update the additional content styles then just do the below to reset them, it doesn’t matter about the star

    #responsive-menu-pro #responsive-menu-pro-container #responsive-menu-additional-content *:before,
    #responsive-menu-pro #responsive-menu-pro-container #responsive-menu-additional-content *:after,
    #responsive-menu-pro #responsive-menu-pro-container #responsive-menu-additional-content * {
       padding: 0;
       margin: 0;
       box-sizing: <your-choice>
    }

    Peter

    #68522
    Luca NappiniLuca Nappini
    Participant

    Peter we can not reset in this way,
    because the style reset affect all div present in Addition Content.
    We need to remove all “*” present in your code, if not all style are affect to your “*”: for example the code “#responsive-menu-pro-container *” affect style of Container but also of Additional Content but also of all div inside Additional Content.

    #68521
    Peter FeatherstonePeter Featherstone
    Participant

    Hey Luca,

    Do you have any suggested solutions in this case that will work for your site but also keep my plugin working for everyone else?

    It seems that this is very specific to your site as it hasn’t been mentioned before so I wouldn’t like to make a fundamental change to my plugin based on that. If you can provide a solution that keeps everyone happy then I would be glad to look at it.

    Please advise

    Peter

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