简体   繁体   中英

How to publish a Node but not create a link to it in Umbraco

I am trying to create a "Node Pointer" document type that allows the content manager to select one or more Nodes not located under the Home Node. This is basically so that they can select which controls to add to a page without having to create a ton of them under the page. My question is, how do I create that "Node Pointer" and publish it without a link to it being created?

Links are generated by your template, so you need to include some logic in your template to exclude those pages you don't want links to.

You can do it by checking the docTypes, or excluding items with no temlate, or use a property such as umbracoHaviHide.

Alternatively avoid creating nodes that are not pages, perhaps like so:
We often use a similar technique to create a collection of sidebar elements that are prefabricated outside the home branch, then re-used. They are re-used by selecting the desired components via a uComponents MultiNodeTreePicker which is a property on every page that should have selectable sidebar components. This way there are no nodes under the home branch that are not supposed to be pages, hence you don't have to do anything to excluded links to them.

Edit
The CMS will give every node a URL, this generally does not matter, because if there is no template associated with the node anyone visiting that url will get the 404 page. Older versions of umbraco will serve a blank page. (pre 4.5? ish? I think?)

You can't.

If you create a node in the content area, it will always have a url associated. You can either make sure the document type doesn't have a default template, if you don't want it to be navigable, or you can assign it a blank template.

Alternatively, you could create a new media type. Media nodes do not have urls associated to them by default.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM