Mura - Find menuTitle or URL with contentID

Find menuTitle or URL with a contentID in Mura.

You may find yourself trying to determine the URL or MenuTitle for a particular page within Mura, and all you have or know for sure is the contentID. This need may arise when trying to create a permanent link to the page and you don't want to rely on the URL set in the site admin. This can be changed on a whim or with some rationale by some self anointed SEO guru, thus breaking your link. It's best to reference the page by the contentID and not use the given permanent link as it is not SEO friendly. Just plug in your contentID in the code below.

view plain print about
1<a href="#$.getBean('content').loadBy(contentID='47B793CC-110A-FD5C-A804655CD920CF89',siteID=event.getValue('siteID')).getURL()#">My Link with the SEO friendly URL assigned in the Mura Admin</a>
Let it be known that you can reference any method in the contentBean, such as getURLTitle(), getMenuTitle(), getTitle(), getParentID() and so on. See http://documentation.blueriver.com/mura/5/components/ under Content for contentBean methods. Content.contentBean

Related Blog Entries

Comments (Comment Moderation is enabled. Your comment will not appear until approved.)
BlogCFC was created by Raymond Camden. This blog is running version 5.9.7. Contact Blog Owner