Document Type as Data Container but don't need URL
Hi,
I need to create some document types and use them without "template" but only as node with data into the content and without URL. How to do this?
Thank you.
first question is why does the URL bother you at all? You can just don't use it.
Umbraco automatically adds the URLs to wach node. If you really want to remove it then maybe its one possible solution to use a custom URL provider that overwrites the URL for the documenta types and set them to String.Empty vor something else what fits.
Herr is a tutorial in how to do it:http://24days.in/umbraco/2014/urlprovider-and-contentfinder/
I don't want URL on that nodes because are only data container like document info or other info, that is a customer has some documents, but that documents must be no accessibile by URL. They are only a containers.
my way with this was to handle the container nodes Outsider if the Website structure. With this they get an URL but can't be visited by it.
In your Website root you can add a property where you store the root of your data nodes. If you need access to one of it you can get the node with the ID stored in the property and then query/access them as needed.
Dave is correct - a document type without a template will always effectively act as if it doesn't have a URL.
Another option is to have a template that does a Response.Redirect(Mode.Content.Parent.Url) so it redirects to the parent node. Thus if it is visited you will end up on the parent page.
Another solution is to implement custom 404 error handling. I believe this package, Umbraco Page Not Found Manager, could be used or at least steer you in the right direction.
What bothers me is the design of umbraco. They have no built-in way to represent entities besides using document types as definitions and Content as instances.
And yes, I have built a custom section, even used the recommended ORM PetaPoco and my several of my entities were built with 0-to-many relationships. But I had to begrudgingly trudge through creating a UI, after searching examples and analyzing them, for the backoffice to handle the CRUD. It's an excessively laborious process compared to just creating a Document Type.
At the same time I might just not be "getting" it.
"What bothers me is the design of umbraco. They have no built-in way
to represent entities besides using document types as definitions and
Content as instances."
There are at least two packages that have property editors that let you create multiple items as part of the page, as an alternative to using child document types.
In my current solution I use Archetype, but from my perspective it is a solution for creating complex properties (data types) which you can use within a Document Type.
Nested Content is the same basic idea but it allows you to usee Document Types to as properties of other Document Types.
Neither of these provide Biago with a "data source' model that isn't implicitly linked to his Content model.
Yes, using Petapoco and Entities, you lost the fast customization of document type by UI.
Have you some example on how to have build ORM + entities ( document type ) and custom section?
thx.
I do have an example but there are so many moving parts I can't just gist I'm going to have to move my repository from a private bitbucket to my public github account... in the meantime, these are the 2 examples I based my work on:
Document Type as Data Container but don't need URL
Hi,
I need to create some document types and use them without "template" but only as node with data into the content and without URL. How to do this? Thank you.
Hi Biagio,
first question is why does the URL bother you at all? You can just don't use it.
Umbraco automatically adds the URLs to wach node. If you really want to remove it then maybe its one possible solution to use a custom URL provider that overwrites the URL for the documenta types and set them to String.Empty vor something else what fits. Herr is a tutorial in how to do it:http://24days.in/umbraco/2014/urlprovider-and-contentfinder/
Regards David
Hi,
I don't want URL on that nodes because are only data container like document info or other info, that is a customer has some documents, but that documents must be no accessibile by URL. They are only a containers.
Hi Biago,
my way with this was to handle the container nodes Outsider if the Website structure. With this they get an URL but can't be visited by it.
In your Website root you can add a property where you store the root of your data nodes. If you need access to one of it you can get the node with the ID stored in the property and then query/access them as needed.
Regards David
Uhm..I don't like as solution...I think that it's better to have a node like a datastore...
Any headway with this? My current solution involves using a custom section but it's a lot of work to maintain.
I also don't see the problem in "data containers" having a URL. As long that they don't have a template they will return an 404 page.
Dave
Dave is correct - a document type without a template will always effectively act as if it doesn't have a URL.
Another option is to have a template that does a
Response.Redirect(Mode.Content.Parent.Url)
so it redirects to the parent node. Thus if it is visited you will end up on the parent page.I like this last method, because is more controllabe and better for SEO.
Another solution is to implement custom 404 error handling. I believe this package, Umbraco Page Not Found Manager, could be used or at least steer you in the right direction.
What bothers me is the design of umbraco. They have no built-in way to represent entities besides using document types as definitions and Content as instances.
And yes, I have built a custom section, even used the recommended ORM PetaPoco and my several of my entities were built with 0-to-many relationships. But I had to begrudgingly trudge through creating a UI, after searching examples and analyzing them, for the backoffice to handle the CRUD. It's an excessively laborious process compared to just creating a Document Type.
At the same time I might just not be "getting" it.
There are at least two packages that have property editors that let you create multiple items as part of the page, as an alternative to using child document types.
There are Archetype and Nested Content:
https://our.umbraco.org/projects/backoffice-extensions/archetype/
https://our.umbraco.org/projects/backoffice-extensions/nested-content/
In my current solution I use Archetype, but from my perspective it is a solution for creating complex properties (data types) which you can use within a Document Type.
Nested Content is the same basic idea but it allows you to usee Document Types to as properties of other Document Types.
Neither of these provide Biago with a "data source' model that isn't implicitly linked to his Content model.
Yes, using Petapoco and Entities, you lost the fast customization of document type by UI. Have you some example on how to have build ORM + entities ( document type ) and custom section? thx.
I do have an example but there are so many moving parts I can't just gist I'm going to have to move my repository from a private bitbucket to my public github account... in the meantime, these are the 2 examples I based my work on:
Umbraco Uk Festival Custom sections code
UkFest-AngularJS-Demo
And probably the quickest way to get this working is to try this:
UI-O-Matic allows you to auto generate an integrated crud UI in Umbraco for a db table based on a petapoco poco.
is working on a reply...