Forums / Developer / Editing page
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
Monday 30 April 2007 11:08:42 pm
I added new attribute as you suggested and got id 417Then 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