1

How can I add a hyperlink in an error message in Joomla4?

I used hyperlinks in enqueueMessage text in joomla 3.x without any problems.

Now I'm using Joomla 4.x and it removes the hyperlink -- it removes the href=* part inside the html tag.

JFactory::getApplication()->enqueueMessage(
    'Something is wrong <a href = \'/index.php?option=com_hccxmlbeheer&view=nieuwaccount\'>klik to fix</a>'
);

Generates:

Something is wrong <a>klik to fix</a>

How can I stop enqueueMessage() stripping the href attribute from my html text?

1
  • Your code doesn't work for me in J3. Filter doesn't handle spaces around attributes well. You should report the issue to Filter repository github.com/joomla-framework/filter. In the meantime you can remove the spaces from your code.
    – Sharky
    Aug 24, 2021 at 6:33

0

Your Answer

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

Browse other questions tagged or ask your own question.