Hide/Show nodes with Website Toolbar

Author Message

Nabil Imran

Tuesday 03 August 2010 2:14:58 am

Hello,

is there a way to enable the "hide/show node" functionality in the website toolbar (ezwt) ?

This would also include to make hidden objects visible to logged in users, but beeing marked as hidden (e.g. grey), the same it is in the site_admin siteaccess.

If this is not possible by configuration, how could I achieve this programmatically?

André R.

Tuesday 03 August 2010 2:28:31 am

It's not possible without some changes. Setting for showing / hiding hidden is global, and not a policy, thus if we add a 'hide', you won't get access to show it again unless you log in to admin interface (as you should for getting access to features like this, specifically meant for administration of site and content).

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Tero Auralinna

Tuesday 03 August 2010 2:31:33 am

I would use object states for hiding objects. Though you need to edit templates if you want to mark object with hidden state as grey for editors. Then you could set policies so that anonymous users can't read hidden objects but editor group are still able to see them.

NXC Finland - Open Source solutions, Internet marketing and web analytics
http://www.nxc.fi
http://www.auralinna.fi
http://twitter.com/teroauralinna

Nabil Imran

Tuesday 03 August 2010 8:42:46 am

Thank you for the replies. The object states are a great feature! It already works quite well.

One more question:

Is there any kind of hook mechanism that allows to call some extra php code, whenever the state of an object is changed?

I was thinking about something similar to the eZContentObjectEditHandler that is called, when objects are being edited.

I need this to syncronize some data in custom tables when objects are getting hidden

Tero Auralinna

Tuesday 03 August 2010 10:15:28 am

You can create workflow for state update. There is AvailableOperationList[]=content_updateobjectstate setting in workflow.ini which enables trigger for state change.

NXC Finland - Open Source solutions, Internet marketing and web analytics
http://www.nxc.fi
http://www.auralinna.fi
http://twitter.com/teroauralinna

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 02:08:53
Script start
Timing: Jan 18 2025 02:08:53
Module start 'layout'
Timing: Jan 18 2025 02:08:53
Module start 'content'
Timing: Jan 18 2025 02:08:54
Module end 'content'
Timing: Jan 18 2025 02:08:54
Script end

Main resources:

Total runtime0.7376 sec
Peak memory usage4,096.0000 KB
Database Queries65

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0069 589.0547152.6250
Module start 'layout' 0.00690.0029 741.679739.4453
Module start 'content' 0.00970.7264 781.1250598.6563
Module end 'content' 0.73610.0014 1,379.781316.1563
Script end 0.7376  1,395.9375 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00430.5807160.0003
Check MTime0.00200.2732160.0001
Mysql Total
Database connection0.00100.136410.0010
Mysqli_queries0.682292.4843650.0105
Looping result0.00070.0933630.0000
Template Total0.707996.020.3540
Template load0.00220.293320.0011
Template processing0.705795.677320.3529
Template load and register function0.00010.016410.0001
states
state_id_array0.00100.135310.0010
state_identifier_array0.00070.101620.0004
Override
Cache load0.00180.2443240.0001
Sytem overhead
Fetch class attribute can translate value0.00070.089330.0002
Fetch class attribute name0.00110.145270.0002
XML
Image XML parsing0.00120.160730.0004
class_abstraction
Instantiating content class attribute0.00000.001980.0000
General
dbfile0.00090.1173230.0000
String conversion0.00000.001440.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
3content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
5content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
6content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/strong.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/strong.tplEdit templateOverride template
1content/datatype/view/ezxmltags/emphasize.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/emphasize.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 18
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs