How to get a navigationtitle of a systempage

Something I rarely use, but now I’m in that situation:
I have a page-type, defined as isSystemPage. I can easily do a event.buildLink( page="mySystemPage" ) to get the correct link. But how do I get the navigationtitle of this page? Is there some simple trick or do I need to do somework with getting the data from the db?


Got it.

SiteTreeService has a proper function:

	public query function getPage(
		  string  id
		, string  slug
		, string  systemPage
		, boolean includeTrash = false
		, array   selectFields = []
		, boolean useCache     = true
		, numeric version      = 0
		, boolean getLatest    = false
		, boolean allowDrafts  = $getRequestContext().showNonLiveContent()
		, string  site         = ""
		, array   bypassTenants = []

Which basically allows to get a page by id, slug or systemPage name.

1 Like