Forum Discussion

EricNissan's avatar
10 years ago

Display images in labels

Hi,

 

We'd like to use labels on forum discussion on a particular board where several version of the product are used and people are familiar with how it looks but not familiar with the names.

 

So to help them, we'd like propose a filter on the images of the products when creating or searching a subject. 

Labels seems like the solution but would be way more efficient with the images of the products than with the names.

 

Has anyone tried something like that? How could it be done?

 

Thanks

Eric

 

  • You could probably use css with jquery. 

    Use something like this to give each tag an extra class, named after its exact contents, then with css give tags an image instead of text. 

  • You could probably use css with jquery. 

    Use something like this to give each tag an extra class, named after its exact contents, then with css give tags an image instead of text. 


  • EricNissan wrote:
    So to help them, we'd like propose a filter on the images of the products when creating or searching a subject. 

    Labels seems like the solution but would be way more efficient with the images of the products than with the names. 


    Great idea for a smaller pool of products, we love pictures more than words. Simple creatures after all.

     

    For once I'd disagree with PerBonomi and advise against doing it client side. If there's the chance to lose functionality when something breaks, you want it in your hands not the clients. I hate torubleshooting an issue for someone who says they can't see what you see.

     

    I'd hide the labels completely, build a custom component to read the labels and then append .png onto the end of them and wrap in IMG tags.

     

    Nice and simple to do, and you could even hardcode a suitable list of labels to prevent img errors.

     

    So your component has a list of suitable labels, reads in the labels for the thread, board, category,wherever and checks each one against the master list, and if it's there spit out a chunk of

    <div class="wrap_images"><a href ="/t5/labels/filterbylabel/LABELNAME"><IMG src="/html/assets/LABELNAME.png"></a></div>

     Float, shuffle, position em wherever you like.


    Solved!

    • I'll try not to take it personally Tim_h :)

       

      That's a fine approach. Would you use a macro to loop/list labels for each post?

      • Tim_h's avatar
        Tim_h
        Boss

        PerBonomi wrote:

        That's a fine approach. Would you use a macro to loop/list labels for each post?


        You know, thinking about it again an endpoint would be perfect for this.

         

        The endpoint would take a post or thread id, and a value declaring which it was (message or topic) and then return a LIST o JSON object of the labels.  Even cleaner with LiQL.