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

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 14:59:36
Script start
Timing: Jan 18 2025 14:59:36
Module start 'layout'
Timing: Jan 18 2025 14:59:36
Module start 'content'
Timing: Jan 18 2025 14:59:36
Module end 'content'
Timing: Jan 18 2025 14:59:36
Script end

Main resources:

Total runtime0.0148 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0047 587.9141152.6250
Module start 'layout' 0.00470.0028 740.539139.4609
Module start 'content' 0.00750.0055 780.000093.3047
Module end 'content' 0.01300.0018 873.304738.3047
Script end 0.0148  911.6094 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002717.8978140.0002
Check MTime0.00117.3609140.0001
Mysql Total
Database connection0.00074.723010.0007
Mysqli_queries0.002315.573230.0008
Looping result0.00000.080310.0000
Template Total0.001510.110.0015
Template load0.00085.262810.0008
Template processing0.00074.838710.0007
Override
Cache load0.00063.786510.0006
General
dbfile0.00074.421080.0001
String conversion0.00000.049840.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs