Forums / Developer / Editing page

Editing page

Author Message

ez man

Monday 30 April 2007 5:45:47 am

i want to add page with contact details on but i want it to be editable ..
That is, i want to know how you can change dynamically using code instead of hard coding it.

My contents are stored in design/override/templates in a file called events.tpl and i have hard coded contents

"Contact us
xyz
+1-666-666-6666(off)
+1-555-555-5555(mobile)"

I want to put this content into ezpublish.

that is to say that contents should be made dynamic

I got a suggestion:
extend your content class 'event' with a new textfield or a nother ez datatype. Then you can write this information to the content objekt and you can have access on it in the template over e.g {attribute_view_gui ... }
but where can i see the class 'event'
Any help?

Betsy Gamrat

Monday 30 April 2007 9:19:23 pm

ez man,

The suggestion is exactly what you need to do.

Go to Setup > Classes > Content and edit the class that is displayed with events.tpl. Add an XML Block, or a text block.

Next, go back to your template (events.tpl) and add the following line:

{attribute_view_gui attribute=$node.data_map.id_of_text_attribute}

Then, edit the node that is being displayed to add the content in the field.

Good luck

ez man

Monday 30 April 2007 11:08:42 pm

I added new attribute as you suggested and got id 417
Then in events.tpl file i added

{attribute_view_gui attribute=$node.data_map.417}

but how do i edit the contents?
it is not getting displayed in web page

eZ debug

Timing: Jan 30 2025 21:16:45
Script start
Timing: Jan 30 2025 21:16:45
Module start 'content'
Timing: Jan 30 2025 21:16:45
Module end 'content'
Timing: Jan 30 2025 21:16:45
Script end

Main resources:

Total runtime0.2038 sec
Peak memory usage8,192.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0067 587.7578370.3125
Module start 'content' 0.00670.0135 958.07031,001.5859
Module end 'content' 0.02030.1834 1,959.65633,890.8750
Script end 0.2037  5,850.5313 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00432.1135200.0002
Check MTime0.00130.6282200.0001
Mysql Total
Database connection0.00120.570710.0012
Mysqli_queries0.111154.51921410.0008
Looping result0.00150.72511390.0000
Template Total0.183189.910.1831
Template load0.00070.352310.0007
Template processing0.182489.504910.1824
Override
Cache load0.00050.255710.0005
Sytem overhead
Fetch class attribute can translate value0.00160.809410.0016
XML
Image XML parsing0.00020.118310.0002
General
dbfile0.00743.6261200.0004
String conversion0.00000.002130.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/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