Forums / Developer / Affect a value to a field without form
Anthony M.
Friday 25 January 2008 12:29:01 am
Hi,
i have created a class with the field 'title', and i can access to the value with :
{$node.data_map.title.value}
but is it possible to affect a value to this field (without a form) like :
{def $node.data_map.title.value = 'test'}
Thanks for your help
Anthony
Felix Laate
Friday 25 January 2008 5:08:23 am
Hi!
Not sure if this is what you need. But with javascript you could:
<script> document.getElementById('mytitle').innerHTML = 'test'; </script> <span id="mytitle">{$node.data_map.title.value}</span>
Cheers!
Publlic Relations Manager Greater Stavanger www.greaterstavanger.com
Friday 25 January 2008 6:52:25 am
it's not that... i want to insert in the database, to fill in the field of the node automatically, do you understand ?
Atle Pedersen
Friday 25 January 2008 9:10:10 am
Unfortunately eZ has no mechanism that allow you do do such a thing. You cannot manipulate the database from inside a template.
What you maybe could do is creating a javascript doing a post call to content/action with the desired data.
Piotrek KaraĆ
Saturday 26 January 2008 2:11:20 am
Hello everyone,
It is possible by means of creating your own PHP/SQL interface for such changes (or maybe even using eZ API), but it is not considered a normal routine as far as I know, since you will be ignoring/braking versionning abstract layer. You have to understand what you're doing and how data is stored in the attributes' db table. I have used that approach in several cases, for example for flagging or periodic shuffling purposes.
Good luck,Piotrek
-- Company: mediaSELF Sp. z o.o., http://www.mediaself.pl eZ references: http://ez.no/partners/worldwide_partners/mediaself eZ certified developer: http://ez.no/certification/verify/272585 eZ blog: http://ez.ryba.eu