0

How do I add custom HTML into a menu? I wish to add this code as a menu item.

<form action="/your-server-side-code" method="POST">
  <script
    src="https://checkout.stripe.com/checkout.js" class="stripe-button"
    data-key="pk_test_xxxxxxxxxxxxxxxxxx"
    data-amount="999"
    data-name="xxxxxxxxxxxxxxx LLC"
    data-description="Widget"
    data-image="https://stripe.com/img/documentation/checkout/marketplace.png"
    data-locale="auto">
  </script>
</form>

It will show up as a button. I tried to select a Menu Item Type, but couldn't find anything that lets you enter HTML.

Joomla 3.8.2.

1 Answer 1

1

One way to do this is to find a menu extension (e.g. RokNavMenu) that lets you specify a Joomla module as the menu item.

You can then add the code to a Custom HTML module using Sourcerer or similar so that the code is not deleted when you save the module.

RokNavMenu: https://extensions.joomla.org/extensions/extension/structure-a-navigation/menu-systems/roknavmenu

Regular Labs Sourcerer: https://extensions.joomla.org/extensions/extension/core-enhancements/coding-a-scripts-integration/sourcerer

1
  • Possibly modules anywhere could do this too
    – Eoin
    Mar 3, 2018 at 11:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.