Forums / General / Making an object non-URL addressable

Making an object non-URL addressable

Author Message

Deane Barker

Tuesday 19 June 2007 1:39:14 pm

Is there any way to make an object non-URL addressable.

By default, every object in eZ publish gets a URL. What if I don't want a certain object or object class to have a URL? What if the object only exists to be listed under another object on another URL?

Example --

Comments on a blog post. I never want anyone to be able to bring a comment up all by itself under its own URL. They should only appear with the parent object (the post itself).

Łukasz Serwatka

Tuesday 19 June 2007 11:27:42 pm

You can remove read permission for that objects, then fetch them in blog/article template with "list" fetch function where one of parameters will be hash( ... 'limitation', array() ... ). Of course create and edit permission are required for new comment posting.

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Xavier Dutoit

Tuesday 19 June 2007 11:35:41 pm

Hi,

Otherwise, I'd suggest to modify the view full of the object, so it's a redirect to its parent + #id

I put ids on these post (#n{nodeid} so you can redirect directly to them

X+

http://www.sydesy.com

Łukasz Serwatka

Tuesday 19 June 2007 11:48:01 pm

Following Xavier's suggestion you can find useful this contrib:
http://ez.no/community/contribs/template_plugins/redirect_operators

It is a bit old, so some tuning might be required, but allows you redirect to another URL directly from template.

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Xavier Dutoit

Thursday 21 June 2007 1:53:56 pm

Yes, that's one of the so useful one that it's activated by default on all my install... almost forgot that is isn't part of the default.

X+

http://www.sydesy.com