• Resolved rocketpig3

    (@rocketpig3)


    I am trying to display different HTML content fields based on the output of a calculated field.

    Inside this HTML content, I would like to place a Maxbutton. This is a button created with a shortcode as a part of the Maxbuttons plugin.

    1. When pasting the shortcode directly into the HTML contnet field, the button does not display.
    2. When using <?php echo do_shortcode(‘[maxbutton]’); ?>, the button does not display.
    3. When copying the HTML directly that is normally generated by the shortcode, the link and text display, but the button’s styling does not. So we just see a link and text rather than the actual button. This can be fixed by pasting the shortcode somewhere else inside the actual page where the form is displayed. If this is done, both buttons will display properly, for some reason.

    The button HTML generated by the shortcode looks like this:

    <a class="maxbutton-7 maxbutton maxbutton-button" target="_blank" rel="nofollow noopener" href="link">Button text</span></a>

    How can I display the button without having to paste it somewhere else on the page?

    Thanks.

    • This topic was modified 5 years, 3 months ago by rocketpig3.
    • This topic was modified 5 years, 3 months ago by rocketpig3.
Viewing 1 replies (of 1 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @rocketpig3

    I’m sorry, our plugin generates the form in the cliente side, so you cannot insert third party shortcodes, or blocks of PHP code, directly into the “HTML Content” fields.

    The alternative would be insert the button’s shortcode directly inside the page, and moving it into the form at runtime.

    For example, entering the following piece of code as the content of “HTML Content” field:

    
    <div class="button-here"></div>
    <script>jQuery('.maxbutton-7').appendTo('.button-here');</script>
    

    Best regards.

Viewing 1 replies (of 1 total)
  • The topic ‘Managing shortcode content in HTML content field’ is closed to new replies.