Jul 23 2019 03:45 AM
I'm trying to create a navigation node through code using either REST directly or PNP that is just a heading without a hyperlink, but am unable to.
Does anyone have a code sample for just creating Headings to navigation elements?
Jul 25 2019 12:24 AM - edited Jul 30 2019 08:22 AM
Hi Mark,
I have been struggling with this too in the past. The only workaround I know about is passing "javascript:return false;" as the URL for you navigation node. This effectively doesn't take user's to another location when navigation node is clicked, but the "hand icon" still appears when hovering over the node (this is not the case with a "real" Heading)
Server-side this was controlled by setting property bag values on the SPNavigationNode (navigationNode.Properties["BlankUrl"] = "True"), but setting these is not available through remote API's.
Hope this helps
Jul 30 2019 07:59 AM
Thanks Paul! This is unfortunate. I'll try your workaround to see if it still works!
Jul 30 2019 08:37 AM - edited Jul 30 2019 08:38 AM
Please note the TechCommunity text editor encoded the URL you should use, I'm unable to find out how to let it render properly but there should be a colon ( : ) between "javascript" and "return true;"