views:

600

answers:

2

I want some tags to be added to an article. The problem is that the tags are displayed in the pop-up window in "random" order. This is due to order they are pushed to the page. I want to intervene, sort the tags and present them ordered. How would you do that? I spotted the methods in tags_entries_selector.js, but I am not really sure where to start.

+1  A: 

There are 2 basic ways how to extend Liferay Portal:

  • Ext Environment
  • Hooks

Ext Environment is powerful technique, but might be a bit difficult. For hooks you can look at this: http://jdem.cz/bfms4

Jaromir Hamala
Unfortunately, it has to be through Ext Environment, as far as I am concerned.
atas
A: 

The main idea of the solution is to keep all tags in an array and not display anything until that array has 'filled'. To understand when the latter happens, compare your array's length to vocabularies.length. Perform all the necessary (not trivial) modifications inside your custom array, convert its data to string and pass it to container.html().

The main point to understand is that the instance._getVocabularyEntries() function is executed for each entry, but we only want it to execute it only when our custom array 'fills' with all the necessary data. This solution has the disadvantage that all required data must be fetched before displaying anything to the user.

atas