function taxonomy_facets_admin_settings in Taxonomy Facets 7.2
Same name and namespace in other branches
- 7.3 taxonomy_facets.inc \taxonomy_facets_admin_settings()
Provides admin page.
Parameters
array $form: admin form
array $form_state: admin form
Return value
array returns admin form
1 string reference to 'taxonomy_facets_admin_settings'
- taxonomy_facets_menu in ./
taxonomy_facets.module - Implements hook_menu().
File
- ./
taxonomy_facets.inc, line 21 - taxonomy_facets.inc Admin section of the taxo faceted navigation module
Code
function taxonomy_facets_admin_settings($form, &$form_state) {
$form['taxonomy_facets_first_argument'] = array(
'#type' => 'textfield',
'#title' => t('First argument'),
'#size' => 60,
'#maxlength' => 250,
'#default_value' => variable_get('taxonomy_facets_first_argument', 'items_list'),
'#required' => TRUE,
'#description' => t('First argument in the url, it is necessary for the working of this module. For example, if this is an ecommerce site the argument could be products, so URL would look something like http://yoursite.com/products/hardware/monitors. Can not be null. Be careful not to use name produced by token used to generate clean url.s'),
);
$form['taxonomy_facets_display_link_if_empty'] = array(
'#type' => 'checkbox',
'#title' => t('Do not display link if empty'),
'#default_value' => variable_get('taxonomy_facets_display_link_if_empty', FALSE),
'#description' => t('If there are no nodes under particular link, do not display it.'),
);
$form['taxonomy_facets_display_link_if_intersection_empty'] = array(
'#type' => 'checkbox',
'#title' => t('Do not display link if the intersection of terms is empty'),
'#default_value' => variable_get('taxonomy_facets_display_link_if_intersection_empty', FALSE),
'#description' => t('Do not display link if there are no nodes under particular link, but also taking into account current filter selection. I.e if there are no nodes for current filter combination. Works well only for flat hierarchies, i.e single level hierarhy'),
);
$form['taxonomy_facets_redirect_to_home'] = array(
'#type' => 'checkbox',
'#title' => t('Redirect to page if no filters applied'),
'#default_value' => variable_get('taxonomy_facets_redirect_to_home', FALSE),
'#description' => t('If no arguments passed as filters, i.e if all filters deselected, than redirect to home page.If this checkbox is checked and the field bellow is empty redirect to home page. If this check box is unchecked all nodes will appear, this is similar behaviour as on sitename.com/node page.'),
);
$form['taxonomy_facets_redirect_to_page'] = array(
'#type' => 'textfield',
'#title' => t('Redirect to a page if no filters applied'),
'#default_value' => variable_get('taxonomy_facets_redirect_to_page', FALSE),
'#description' => t('If no arguments passed as filters, i.e if all filters deselected, redirect to a specified page. NOTE: Make sure you check above check box "Redirect to page..." and specify the page url in this field, if you want to redirect to home page just leave this field empty.'),
);
$form['taxonomy_facets_ignore_language_prefix'] = array(
'#type' => 'checkbox',
'#title' => t('Ignore language prefix'),
'#default_value' => variable_get('taxonomy_facets_ignore_language_prefix', FALSE),
'#description' => t('If you check this box ,the setting will force filters links to stay unchanged and language independent, so <strong>no</strong> language prefix will be added in the url.'),
);
//********************************* Display text about configuring taxonomy paterns ******************************
$form['set_taxo_patterns'] = array(
'#type' => 'fieldset',
'#title' => t('Set taxonomy patterns'),
'#collapsible' => TRUE,
'#collapsed' => FALSE,
);
$form['set_taxo_patterns']['set_taxo_patterns_text'] = array(
'#markup' => ' Go to: <br>
Administration > Configuration > Search and metadata > URL aliases > <a href="/admin/config/search/path/patterns">Patterns</a>
<br>
In the TAXONOMY TERM PATHS section configure term patterns, change it to
single argument. <br>For example change default pattern:
[term:vocabulary]/[term:name] to [term:name].<br>
You can use [term:vocabulary]-[term:name] or similar, the key is to NOT have
any / character in the pattern, as this module expects a single argument for
each filter.<br><br>
If you already have taxonomy term aliases generated with a different pattern than update them:<br>
* <a href="/admin/config/search/path/delete_bulk"> Delete aliases for taxonomy terms.</a><br>
* <a href="/admin/config/search/path/update_bulk">Bulk update taxonomy term paths</a><br>.
',
);
// **************************** Select content type **********************************************
$form['content_types'] = array(
'#type' => 'fieldset',
'#title' => t('Select content types'),
'#collapsible' => TRUE,
'#collapsed' => FALSE,
);
$form['content_types']['taxonomy_facets_content_type_options'] = array(
'#type' => 'checkboxes',
'#options' => taxo_faceted_get_node_types(),
'#default_value' => variable_get('taxonomy_facets_content_type_options', array()),
'#title' => t('What content types should be displayed on taxonomy facets listing page,
i.e the page that you specified in the "First argument" field above?'),
);
//********************************* Display text about adding taxo facets block ******************************
$form['set_taxo_block'] = array(
'#type' => 'fieldset',
'#title' => t('Add taxonomy faceted navigation blocks'),
'#collapsible' => TRUE,
'#collapsed' => FALSE,
);
$form['set_taxo_block']['set_taxo_block_text'] = array(
'#markup' => ' Go to: <br>
Administration > Structure > <a href="/admin/structure/block">Blocks</a>
<br>
Click on <a href="/admin/structure/block/add-taxofacet-block">"Add taxofacet block"</a>
<br>Select desired taxonomy.
<br>In the visibility setngs set desired options, for example if your "Firs argument" is "items_list", than
in the "Show block on specific pages"
<br>
Click on "Only the listed pages" radio
<br>
and set it to: items_list*
<br>.
',
);
//********************************* Display text about theming ******************************
$form['set_taxo_theme'] = array(
'#type' => 'fieldset',
'#title' => t('Theme templates'),
'#collapsible' => TRUE,
'#collapsed' => FALSE,
);
$form['set_taxo_theme']['set_taxo_theme_text'] = array(
'#markup' => 'There a 3 templates that you can use to theme filter blocks. Simlpy copy files from the templates folder inside this module in your themes template folder.
',
);
return system_settings_form($form);
}