Friday 14 January 2005 4:39:56 am
Hi again Nigel --
I didn't give you enough explanation before........
Here's what I did --
The hidden field that I needed was an objectrelation datatype - so I entered that into the class using the regular add attribute interface. Then, I used that forum comment I linked to earlier to do the datatype override for objectrelation datatype. Here's the code that I put in the override file.......
{let user=fetch('user','current_user')}
<input type="hidden"
name="{$attribute_base}_data_object_relation_id_{$attribute.id}"
value="{$user.contentobject_id}" />
{/let}
This set my hidden objectrelation attribute to the value of the current user's id number -- and it works like a charm. For the name, I just copied what I found in the standard dataype template into the name field of hidden value. Make sense so far....... What I still need to figure out is how to do a conditional loop that gets the class id of the current object and only uses this special hidden item code for certain classes. Also, because of some coding somewhere, I couldn't get my object name to stop appearing in the input layout - so I just deleted the text from the name field of the attribute and put in some dashes so it won't confuse my users. This workaround keeps me from having to create a custom datatype - which I have no desire to tackle. A hidden value datatype would be nice to have wouldn't it??
|