Default values for a field
This is an open discussion with no replies, filed under Extensions.
Search
Create an account or sign in to comment.
This is an open discussion with no replies, filed under Extensions.
Create an account or sign in to comment.
Quick Links
Symphony • Open Source XSLT CMS
--with-xsl
)
I'm not a php developer. But sometimes I got ideas: if then it could be awesome, else we need a workaround.
Sometimes I think a default value for a field could be really usefull. So I opened today a field.php file and start reading and understanding the structure and the code.
At the point of
checkPostFieldData
I thought this must be the place ... so ifstrlen
is zero there must be no value. The field wasn't required also. What about a default value? That way we got at least a value to display or to use as filter. But how to set the value?The api told me to use
setData
. But as I told I'm not a php developer. I can read, I can think but one of my shortcomings is I'm not a hardcore backend coder.I hope for some suggestions.
The next steps are some backend options for every field, a checkbox 'I like to have a default value' and of course an input field for the default value. But heck let solve first things first.