Drupal assign taxonomy to content( story ) - drupal

I have a Druapl application in which the taxonomy is supposed to have 4 nested terms for eg
Sports->World->Country, so when we create a story the taxonomy option is displayed as multiple select box with values nested inside.
Like this:
Sports
--World
---United States
---United Kingdom
---Germany
---France
---So on
So when creating content it will be a huge task for the user to pick one from the enormous list. Is there any way I can split the select box in to 3 where selecting the first level load the second level in another select box and so on.
Or where should I customize ( the files which displays this select box ) this select box.
Any help highly appreciable
Thanks and Regards

Check out Hierarchical Select module - http://drupal.org/project/hierarchical_select

Related

Showing count of content based on the select list values Drupal 7

I have a requirement in which I need to show some content along with its count based on values in a select list. I wanted to display the allocated,released and resigned resources of a particular department in a selected date range. Using views, date range and department fields are created as exposed filters.
Created a content type for creating resources. The Resources content type is having action as a select list with values allocated,released,resigned. Department is another select list and date field is also added.
Please help me with an answer if views module is not enough. Provide some other solutions also. I'm using Drupal 7.
I figured out how to show node count in views. In my view I’ve some exposed filters and passed my select list cck field as contextual filter. If no result available I made the view to display summary as row count. In the template file, I’m planning to do some calculations for showing the resources count in and out of the project. Please correct me if there is anything wrong in this approach.

Hierarchical Select, exposed filter, taxonomy,associated with at least one node

Hello evrey body and thanks for any one can help me in advanced.
im using Hierarchical Select in exposed filter views 2.
how can i configure my exposed filter to not show all taxonomies in the select list of the filter , i want from it to show taxonomies with with at least one node associated.
i have tired enabling this option from Hierarchical Select inside the vocabulary
and i got this error
user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') count_alias' at line 1 query: SELECT COUNT(*) FROM () count_alias in C:\wamp\www\8keys\sites\all\modules\hierarchical_select\modules\hs_taxonomy_views.module on line 556.
and i also want to ask if i can use the same techinque but with cck field instead of taxonomy ,
i mean country : i dont want to show in the search list the list of countries with at least one node associated.
thanks a lot
Check out this module. It should narrow your list of terms only to used ones.
http://drupal.org/project/views_hacks#views_filters_selective

Views 1: Filter by custom table/field (or using Argument Hand. Code)

I have a page which should list nodes. The views is called from a locality page (a taxonomy term page). What I need is almost the same as using the Taxonomy: tid in arguments and passing the tid.
I can't use the term_node table, as (for other reasons) we have a custom table term_node_hierarchy (with nid and tid only). The table term_node_hierarchy is like term_node but also saves the tid of the parents (from an "external" code)
I've been looking for options but still no joy.
Currently I'm building an array of the nid's that should be displayed on the current page, and passing them like print views_build_view('embed', $view, $matching_nids); but the Argument Node: ID states This argument is a single Node ID. As said, only the first node is displayed when printing the views. It would be great if it could filter on more than one nid.
I'm open to any kind of suggestions on how to do this.
Thanks
You could create your own module for this. You could populate the $page_content variable with the results of your own custom query where you allow the user to sort against multiple nids. You could do this a number of different ways. You could display a list of the existing nids with corresponding checkboxes, so that, when the user clicks submit, all the nids that match the selected checkboxes get used in the query. Then you just display the result of that query. That's the easiest way I can think of to offer that degree of flexibility.

Multiple ListBox's in Drupal CCK?

I want to create content type with multiple ListBox's which populate dynamically depending on the previous.
E.x. If user selects the continent the next list box shows the list of countries present in the continent .
I think what you need is Hierarchical Select
also: http://drupal.org/node/212834 (see comments also), but Hierarchical Select at current state is the best...

Drupal 6: Taxonomy splot up in managed fields?

So you have two taxonomies, namely: "Business Type" and "Location"
This is assigned to a node called BUSINESS. In effect, when the user creates a BUSINESS node, her has to choose for example, location "New York" and type "Information Services". My problem is when:
a) Capturing the taxonomy, and
b) Displaying the taxonomy
I want the two terms to be separated from each other. I.e. I want to be able to move the two terms individual positions in the MANAGE FIELDS view, so that they can be grouped or placed seperately. Currently, Drupal only allows one entry, called "TAXONOMY" which is effectively the two terms next to each other.
This is what I have:
alt text http://www.namhost.com/have.jpg
This is what I want:
Bare in mind, I need to be able to use this with Hierarchical Select, which means Content Taxonomy is not an option.
You'll have to separate your problem in 2 parts:
The form filling part, which will have all vocabularies together to the editor.
The content display part, which you'll be able to separate vocabularies.
I'll cover here more the second part, about displaying.
Use the CCK computed field module and create one field for each vocabulary you want to display. Position this field where you want them.
Configure each field as follows:
On the Computed Code, put something like this:
# Get vocabulary ID from its management URL (/admin/content/taxonomy/edit/vocabulary/[VOCABULARY_ID]) and set here:
$node_field[0]['value'] = "5";
# Also, configure this field as 'Raw Text' on Display Fields
On Display Format, use this:
$vocabulary_id=$node_field_item['value'];
$terms=taxonomy_node_get_terms_by_vocabulary($element['#node'], $vocabulary_id);
foreach ($terms as $tid => $details) {
# The taxonomy_get_textual_term_hierarchy_by_id() is implemented on the SolutionHub's theme template.php file
$textualTerms .= taxonomy_get_textual_term_hierarchy_by_id($tid);
}
if (isset($textualTerms)) {
$display='';
$display.=$textualTerms;
$display.='';
}
The taxonomy_get_textual_term_hierarchy_by_id() function is specific to my site and is defined in DRUPAL_ROOT/sites/default/themes/mytheme/template.php and simply rewrites the taxonomy term text in a fancy way to show its entire lineage. So instead of "apple" I'll get something like "food > desert > fruit > apple". I won't paste it here cause it is out of scope.
If your problem is to reposition the vocabulary in the edit form, I would suggest the Content Taxonomy module.
You are stuck with the two taxonomies appearing together in the input form, they come as a package. Taxonomy should be used as a classification system (like animal kingdom classifications) so the terms to belong together in physical space.
But for the other half of your question, keep in mind your users will see the 'Business type' and 'Location' labels in the input form, not the generic 'Taxonomy' label that you see when managing fields.
maybe you could do better with cck. by enabling text (comes with cck) you can add text fields. and you can easily use them separately, use them with views, templates, etc.

Resources