Maybe I've missed something obvious... but I can't seem to find anything obvious about this.
I've got a node in the root called 'Widgets' where I can put some type of pages (image slider for example). Which are then shown for example through a contentpicker on my startpage (through RenderTemplate) or on other subpages to my site.
But I don't want those widget pages to be browsable by their own! Only when I render them through RenderTemplate!
Anyone have any idea how to accomplish this easily?
As far as I've understood, if they have a template they get an url - so thats the 'problem' I presume.
One workaround is to have a default template for the widgets and within that template (or controller) you have a redirect - maybe back to the home page of the site.
A bit clunky but it works.
Another possible option is to have the UmbracoRedirect property on the Widget and set this to the home page so that Umbraco handles the redirect. For this to be easily managed on an ongoing basis it would be ideal to add an event handler to automatically set the redirect each time a new Widget is created.
That wouldn't work since the template is what I render through RenderTemplate() to show my template...
And for a UmbracoRedirect property on the widget to work, I would be able to know if the template is rendered through RenderTemplate() or through direct browsing... which isn't possible as far as I have understood, or have I missed something?
Making page (widget) not visitable/surfable
Maybe I've missed something obvious... but I can't seem to find anything obvious about this.
I've got a node in the root called 'Widgets' where I can put some type of pages (image slider for example). Which are then shown for example through a contentpicker on my startpage (through RenderTemplate) or on other subpages to my site.
But I don't want those widget pages to be browsable by their own! Only when I render them through RenderTemplate!
Anyone have any idea how to accomplish this easily?
As far as I've understood, if they have a template they get an url - so thats the 'problem' I presume.
Hey Alexander
One workaround is to have a default template for the widgets and within that template (or controller) you have a redirect - maybe back to the home page of the site.
A bit clunky but it works.
Another possible option is to have the UmbracoRedirect property on the Widget and set this to the home page so that Umbraco handles the redirect. For this to be easily managed on an ongoing basis it would be ideal to add an event handler to automatically set the redirect each time a new Widget is created.
Hope this helps.
Nigel
Hmm...
That wouldn't work since the template is what I render through RenderTemplate() to show my template...
And for a UmbracoRedirect property on the widget to work, I would be able to know if the template is rendered through RenderTemplate() or through direct browsing... which isn't possible as far as I have understood, or have I missed something?
is working on a reply...