 readme  id readmetxt v 18 20100808 035007 jrao exp description this module allows the use of hierarchical select form element as a widget for cck node reference field both in node add edit form and in views filter a hierarchical select in widget setting allows you to define a path in the hierarchy of node reference fields once defined this path can be used to render hierarchical select form element in node add edit form and views filter save lineage dropbox and create new item level features of the hierarchical select is supported in cck field widget as long as the field number of values and referenced content types setting can support them installation 1 place this module directory in your modules folder this will usually be sites all modules don t install your module in drupal core s modules folder since that will cause problems and is bad practice in general if sites all modules doesn t exist yet just create it 2 enable the module hierarchical select node reference and hierarchical select node reference views cck node reference field configuration 1 when adding new node reference field select hierarchical select as form element alternatively click configure on an existing node reference field and change the widget type to hierarchical select 2 in field s global settings make sure content types that can be referenced is selected and click save field settings to save the selection without this the node reference path setting will be empty 3 once content types that can be referenced is saved go back to field configuration use the dropdowns under node reference path to define a path you would like to use for hierarchical select widget click save field settings to save the selection note in order for note reference path to have options there must exist a node reference hierarchy ie the content types selected in content types that can be referenced must have their own node reference fields referencing some other content types otherwise the note reference path will always be 4 optionally click the link under node reference path to configure hierarchical select settings the settings page is also listed under admin settings hierarchicalselect configs node reference path example node reference path is the most important setting in this module here s an example of how node reference path works 1 setup the following content types country state add a node reference field country with widget type select list content types country required number of values 1 city add a node reference field state with widget type select list content types state required number of values 1 address add a node reference field city with widget type hierarchical select content types city required number of values 1 2 add some test data country united states canada states under united states california washington michigan states under canada british columbia alberta manitoba cities under california los angeles san diego san jose sacramento cities under washington olympia seattle cities under michigan lansing detroit cities under alberta airdrie grande prairie red deer cities under british columbia burnaby lumby city of port moody cities under manitoba birtle 3 play with node reference path setting change address content type s city field s node reference path to citystate save the setting then attempt to create a new address node in the form s city field you can see hierarchical select in action first select a state then select a city change the city field s node reference path to citystate statecountry try to create a new address node this time the first dropdown is a list of countries select a country will bring you the states and select a state will bring you to the cities note the node reference path is the reverse of what actually appears on form this is by design since the field where node reference path is setup is always going to be the last to appear in the form s hierarchical select views filter configuration 1 when adding new node reference field filter an extra configuration form is displayed use selection type to choose which widget to use for this filter choose dropdown to use the original filter came from cck choose hierarchical select when using hierarchical select as selection type pick a corresponding content type in the left side 2 in the filter configuration click expose to expose the filter and use the node reference path to select the path to use for the hierarchical select 3 optionally use the link in extra configuration form to configure hierarchical select settings the settings page is also listed under admin settings hierarchicalselect configs node lineage when and how to use 1 if save node lineage is selected in hs setting for node reference field this means all the nodes in the node reference path will be saved into this node reference field for example if address has node reference field city and node reference path is citystate and user selected california los angeles in the hs dropdowns then both the state node california and the city node los angeles will be saved to the node reference field obviously this requires this node reference field to accept at least 2 values and can accept both city and state content types the hs setting will disable the save node lineage radio button if these criteria are not satisfied 2 the save node lineage in node reference field is not necessary for the hs cascade dropdown to work with node references the main reason save node lineage is selected is for partial matches in node reference field filter in views 3 the hs setting for node reference field filter also has a save node lineage radio button selecting this means all the nodes in the node reference path will be used in views query instead of just the deepest node this setting is usually used with a node reference field whose save node lineage is also turned on this allows partial matches to work in the filter to continue the example in 1 if save node lineage is turned on for a node reference field filter for field city when only california is selected in the views filter without city selection the views will return any address whose state is california including california los angeles if los angeles is selected in city filter then only california los angeles is returned rendering node reference hierarchy lineages when viewing content this module is mainly used for input thus it is only used on the create edit forms of content however there is a need for the module to help display the value s in the node reference field that is using this module for input since only this module and the hs module knows how to reconstruct the lineage based on field value s thus the module now provides 3 theme functions similar to those provided in hs module themehsnodereferenceselectionaslineages this function will take a node and a node reference field name and render the field value as lineages based on the field configuration themehsnodereferencelineages this function is used to render multiple lineages in case the field has multiple node references in it ie when dropbox is enabled on the input side theme developer can override this function to customize the display of multiple lineages themehsnodereferencelineage this function is used to render a particular lineage theme developer can override this function to customize the display of individual lineage sample usage this will automatically render all lineages for the value s in node s fieldaddresses field assuming this field is a node reference field using this module as widget cck formatter this module now provides a cck formatter called hierarchical select lineages which can be used in cck and views the formatter will use theme function themehsnodereferenceselectionaslineages to render the node reference field in node display or views 