Jump to:

10928 Posts in 2612 Topics by 1809 members

All other Modules

SilverStripe Forums » All other Modules » tagfield : how to output tags in same order they were entered?

Discuss all other Modules here.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 875 Views
  • DsX
    Avatar
    Community Member
    178 Posts

    tagfield : how to output tags in same order they were entered? Link to this post

    I am using the tag field for a number of short text fields in my system, and until recently it appeared to work perfectly.
    But as I entered more data and started to reuse tags, I found the output of the tags to my pages are not in the order I entered them.

    How might I go about setting the module to output tags in the same order that they have been entered?

  • DsX
    Avatar
    Community Member
    178 Posts

    Re: tagfield : how to output tags in same order they were entered? Link to this post

    Looking at the database I see that I may be able to get the behavior I want by sorting the tags based on the ID from the Many-Many relation table.

    I am guessing that if tags are entered in the correct order, that this order is reflected in the ID numbers in the relation table?
    So if Tags are not in the correct order, that removing all tags, saving, and then reentering the tags in the correct order would rewrite the unique ID to the relation table and allow me to sort them correctly?

    If this is in fact how this is working (hoping someone with more experience here might know) how might I go about extending this class to sort in this manner?

    875 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.