How to change the link URL in a custom widget

Posted by AM on 13-Feb-2020 23:14

I have a custom module called Business with the fields:

  • Title
  • Related Committee (which is related data from another custom module)

From the Business list view widget I want to change the link to be a specific URL like:

/UrlOfRelatedCommittee/UrlOfBusinessItem

Another example: /committee-a/business-topic-a

I'm using Sitefinity 12.1 and MVC.

I've managed to get the URL of the related committee using @item.Fields.RelatedCommittee.DefaultUrl in a Widget Template.  I just don't know how to get the URL of the Business item without it being the full URL (I just need the "business-topic-a") part.

Or maybe there's a better way to do this altogether.  Thank you.

All Replies

Posted by jread on 26-Feb-2020 16:03

Can you explain a little further what you are trying to accomplish, not sure we have the full picture here.  What is the need for getting the base URL of the 'Business'?

This thread is closed