change priority automatically

Author Message

Marko Žmak

Wednesday 18 October 2006 11:33:44 pm

I have a question about changing the priority of nodes in eZ admin interface. When have two nodes with priority 1 and 2, and I change the priority of the second node then I get two nodes both with priority 1.

Is there a way to change this behaviour so that when I change the priority of second node to 1, the first node gets priority 2 and the second node priority 1?

Is there maybe an extension for this, or something else?

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Claudia Kosny

Thursday 19 October 2006 3:48:26 am

Hi Marko

Depending on how the priority change should propagate this might be easiest to solve using Javascript.
If you want to reorder all priorities it is really simple: Fetch all the input boxes, order them by their value and insert the position on the ordering as new value . Just take care that the input box that triggers the function takes precedence in the ordering. Trigger this script onblur or onchange of the textboxes. I can send you a script which does that for selectboxes if you are interested, but it is really easy.

This simple approach will cause problems if you have some special priorities that should not change (E.g I use a priorities of 1000 for nodes that should not be displayed when fetching all children). In this case you might need something more fancy.

I haven't looked into whether there are any extensions or native EZ functions that do this.

Greetings from Luxembourg

Claudia

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 19 2025 00:33:18
Script start
Timing: Jan 19 2025 00:33:18
Module start 'layout'
Timing: Jan 19 2025 00:33:18
Module start 'content'
Timing: Jan 19 2025 00:33:19
Module end 'content'
Timing: Jan 19 2025 00:33:19
Script end

Main resources:

Total runtime1.1129 sec
Peak memory usage4,096.0000 KB
Database Queries54

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0069 587.9141152.6250
Module start 'layout' 0.00690.0035 740.539139.4453
Module start 'content' 0.01041.1011 779.9844527.0703
Module end 'content' 1.11150.0014 1,307.05478.3203
Script end 1.1129  1,315.3750 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00320.2896160.0002
Check MTime0.00140.1265160.0001
Mysql Total
Database connection0.00070.066710.0007
Mysqli_queries1.069896.1268540.0198
Looping result0.00050.0469520.0000
Template Total1.070496.220.5352
Template load0.00220.198220.0011
Template processing1.068295.983020.5341
Template load and register function0.00010.009510.0001
states
state_id_array0.00110.101810.0011
state_identifier_array0.00190.171520.0010
Override
Cache load0.00180.1655150.0001
Sytem overhead
Fetch class attribute can translate value0.00080.075920.0004
Fetch class attribute name0.00110.095930.0004
XML
Image XML parsing0.00060.056620.0003
class_abstraction
Instantiating content class attribute0.00000.000630.0000
General
dbfile0.00070.0662180.0000
String conversion0.00000.001040.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
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
3content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 9
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs