Retrieve default value of email field

More
12 years 4 months ago #27610 by igcorreia
I am trying to get the default value of an email but I cant.
instead of the:
Code:
$field->display:
i wanted to only get the email but it does not work:
Code:
$field->default_value;

with $field I cant get the email array:
Code:
[id] => 49 [field_type] => email [name] => e_mail [label] => E-mail [description] => [isfilter] => 0 [iscore] => 0 [issearch] => 1 [isadvsearch] => 0 [untranslatable] => 0 [formhidden] => 0 [positions] => [published] => 1 [attribs] => display_label=1 size=30 required=0 allow_multiple=0 max_values=0 default_value=webmarketing@quintadolago.com use_title=1 default_value_title=Contact us by Email! title_usage=0 pretext= posttext= separatorf=1 opentag= closetag= [checked_out] => 0 [checked_out_time] => 0000-00-00 00:00:00 [access] => 0 [ordering] => 47 [item_id] => 887 [value] => Array ( [0] => a:2:{s:4:"addr";s:29:"webmarketing@quintadolago.com";s:4:"text";s:20:"Contact us by Email!";} ) [parameters] => JParameter Object ( [_raw] => display_label=1 size=30 required=0 allow_multiple=0 max_values=0 default_value=webmarketing@quintadolago.com use_title=1 default_value_title=Contact us by Email! title_usage=0 pretext= posttext= separatorf=1 opentag= closetag= [_xml] => [_elements] => Array ( ) [_elementPath] => Array ( [0] => /var/www/quintadolago/libraries/joomla/html/parameter/element ) [_defaultNameSpace] => _default [_registry] => Array ( [_default] => Array ( [data] => stdClass Object ( [display_label] => 1 [size] => 30 [required] => 0 [allow_multiple] => 0 [max_values] => 0 [default_value] => webmarketing@quintadolago.com [use_title] => 1 [default_value_title] => Contact us by Email! [title_usage] => 0 [pretext] => [posttext] => [separatorf] => 1 [opentag] => [closetag] => ) ) ) [_errors] => Array ( ) ) [display] => Contact us by Email! )

Please Log in or Create an account to join the conversation.

More
12 years 4 months ago #27613 by ggppdk
i think you have confused field properties (each one is stored in DB table column) with field parameters

Use this one to retrieve a parameter value:
Code:
$default_value= $field->parameters->get( 'default_value', '');
the $field->parameters was created via:
Code:
$field->parameters = new JParameter ($field->attribs);


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
12 years 4 months ago #27615 by igcorreia
Perfect. Worked.

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.345 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline