Added a new tool for selecting taxonomy terms

I added a new tool to aid in selecting taxonomy terms.
It appears as a link in a block positioned in the right side bar on edit pages.

Screen shot

A new option is available in the right sidebar: "Suggest keywords" containing one link: Highlight Terms.

Upon clicking the Highlight terms link a script searches the body of the node and does two things:

  1. Highlight taxonomy terms found in the body

    Screen shot

    Now the terms that were found in the body of the document have been highlighted.

  2. Produce a word cloud with the left over terms:

    Screen shot

    Here are the left over terms. Ones that were not highlighted. Next to the term name is the number of occurrences in the document.

The terms in the cloud are sorted by frequency of occurrence (most to least) and sized accordingly. They also have the number of occurrences in parenthesis next to the term.

If the user clicks a term a script populates the term in the “Enter New Tags” field. Separating any existing terms in the field with a comma.

I also added some code to slide the tool block down the right sidebar to be level with the taxonomy term section:

Screen shot

Here you can see the tax. section and the tool link are the same positioned the same.

I don’t think the method I used to position this block is ideal but it get’s the job done for now.

Back end info:
For now this code is split between a centrally located js file and a manually created block.
I’ve started creating a module that houses all of this code and creates the block but I wanted to get this working quick.
Here’s the module code:

<h2>Suggest Keywords</h2>
<a href="#">Highlight Terms</a>

$suggest_terms_tax_super_select_js = &lt;&lt;&lt;javascript
Drupal.behaviors.suggest_terms_tax_super_select = function (context) {
		void(&#039; &#039;);
drupal_add_js($suggest_terms_tax_super_select_js, &#039;inline&#039;);

It's currently set up to show display on any page with */edit* in the url

Leave a Comment