Front end editing and the web site toolbar

Author Message

STEVO +

Thursday 03 March 2011 1:07:08 pm

Sorry - forgot to mention that the extension doesn't override attribute_view_gui and node_view_gui but adds new template functions that wrap them - so you'll currently have to do a search + replace throughout all relevant templates - ezwebin, ezflow, custom frontent templates.
Change attribute_view_gui to attribute_sedit_gui
Change node_view_gui to node_sedit_gui
Also there's a couple of regex search/replaces in /temp/regex.txt that should be used for full effect.
The toolbar button doesn't do anything yet.
Clear all caches etc then you should see divs as mentioned above wrapping content areas and rolling over them will reveal the icons.
Cheers

Eirik Alfstad Johansen

Sunday 10 July 2011 1:59:13 pm

OK, so I've been doing some more research on this, and allthough I think that most functionality can be handled by an extension, I think a small kernel modification will result in the best implementation of this functionality. 

Here is what I propose: 

  • The ability to have a template surrounding the templates produced by attribute_view_gui, node_view_gui and other template functions making use of the eZObjectForwarder class (check out kernel/common/eztemplateautoload.php).
  • The names of these templates could be an underscore, followed by the name of the template function, followed by «.tpl» and the template could be placed in the same folder as the template_root of the specific template function (or in the matching template root for those functions which make us of the multi_match template_root type, like attribute_view_gui). To use node_view_gui as an example, the surrounding template would be located in design/standard/templates/node/view/_node_view_gui.tpl. An alternative placement is to have them all in a content/inlineedit template folder. In this case, the node_view_gui template would be located in design/standard/templates/content/inlineedit/node_view_gui.tpl
  • These surrounding templates will only be invoked if a new InlineEditing INI setting is set to enabled/true.
  • The variables accessible in the surrounding template should be the same as the ones that are accessible in the included template.

I was hoping to accomplish this myself, but looking into kernel/common/ezobjectforwarder.php, the class it's quite daunting and not very well documented. So, I was hoping that someone would be able to give me a hand with this before I embark upon the rest of the task.

Any takers?

Sincerely,

Eirik Alfstad Johansen
http://www.netmaking.no/

Eirik Alfstad Johansen

Monday 11 July 2011 12:30:45 pm

Having taken a closer look at STEVO's project, I can see that he has in fact gone with a very similar approach to the one described above.

However, I'm stilling having trouble getting it to work properly (meaning seeing the icons when I hover over an attribute).

As far as I can tell, there's nothing that actually included the sedit.js file (which I assume holds the logic behind this), so I've added it to JavaScriptSettings > FrontendJavaScriptList of the design.ini file.

I've checked the source to ensure that both sedit.js and YUI are included, but still nothing happens when I hover over an attribute_view_gui which has been replaced with attribute_sedit_gui (and yes, the HTML for the attribute_sedit_gui does get included).

How to troubleshoot from here?

Sincerely,

Eirik Alfstad Johansen
http://www.netmaking.no/

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 03:05:10
Script start
Timing: Jan 18 2025 03:05:10
Module start 'layout'
Timing: Jan 18 2025 03:05:10
Module start 'content'
Timing: Jan 18 2025 03:05:11
Module end 'content'
Timing: Jan 18 2025 03:05:11
Script end

Main resources:

Total runtime0.7313 sec
Peak memory usage4,096.0000 KB
Database Queries56

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0087 589.7109152.6406
Module start 'layout' 0.00870.0045 742.351639.9297
Module start 'content' 0.01320.7163 782.2813535.1172
Module end 'content' 0.72950.0017 1,317.398414.2578
Script end 0.7312  1,331.6563 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00380.5182160.0002
Check MTime0.00140.1898160.0001
Mysql Total
Database connection0.00160.216410.0016
Mysqli_queries0.661190.4063560.0118
Looping result0.00060.0838540.0000
Template Total0.688494.120.3442
Template load0.00310.422620.0015
Template processing0.685393.712620.3427
Template load and register function0.00020.030910.0002
states
state_id_array0.00120.166810.0012
state_identifier_array0.00460.622820.0023
Override
Cache load0.00240.3342300.0001
Sytem overhead
Fetch class attribute can translate value0.00130.181920.0007
Fetch class attribute name0.00070.091950.0001
XML
Image XML parsing0.00160.213220.0008
class_abstraction
Instantiating content class attribute0.00000.001760.0000
General
dbfile0.00110.1454220.0000
String conversion0.00000.001340.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
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
4content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/li.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/li.tplEdit templateOverride template
1content/datatype/view/ezxmltags/ul.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/ul.tplEdit templateOverride template
1content/datatype/view/ezxmltags/strong.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/strong.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 16
 Number of unique templates used: 9

Time used to render debug report: 0.0017 secs