Sf websites
From ARK
Description
The sf_websites is for generating a list of web URLs, where query string parameters can be filled by values from user-specified fields. The field will need to be properly setup in field_settings.php. It is better to use an attribute field, or something without verbose text as the whole string will be sent as the search term.
Additional Fields
sf_websites takes the following extra fields:
- 'websites' - REQUIRED - this is an array containing the following values:
- 'title' - REQUIRED - the title to be displayed as the link text
- 'url' - REQUIRED - the base url (with other non-dynamic parameters if required, but with the dynamic parameters REMOVED)
- 'params' - REQUIRED - an array containing:
- 'variable' - REQUIRED - the variable name (i.e. '&search_term=')
- 'fields' - REQUIRED - the field whose value will be used as the value of the parameter
Example Configuration
An example of sf_websites displaying a link to youTube where the search term is filled from $conf_field_common_name
$conf_mcd_website =
array(
'view_state' => 'max',
'edit_state' => 'view',
'sf_title' => 'brd_websites',
'sf_html_id' => 'brd_websites', // Must be unique
'script' => 'php/subforms/sf_websites.php',
'sf_nav_type' => 'full',
'op_label' => 'space',
'op_input' => 'edit',
'websites' => array(
array(
'title' => 'youTube Videos',
'url' => 'http://www.youtube.com/results?search_type=&aq=f',
'params' => array(
array(
'variable' => '&search_query=',
'fields' => $conf_field_common_name
)
)
),
),
'fields' => array(
)
);