Hey all ![]()
I’m trying to use the simple menu field type in a custom module to create a customisable link. I’m having trouble when it comes to handling the different types of menu items. For example the URL Link returns the value of the field to
linkUrl
, but if the menu item is a Page link with URL parameter the
linkUrl
returns
null
and I can’t see any other fields on the object that I can use to get the url of the page.
This is what I’m working with:
<a href="{{ module.button.link[0].linkUrl }}{{ module.button.link[0].linkParams }}" class="{{ module.button.type }} button--block">
{{ module.button.link[0] }}
</a>
Ideally what I need to be able to do is change the href of the link to URL defined in the menu item, regardless of the type of the menu item. Any idea how I can acheive this? I’m thinking that I must be missing something…