Forum Discussion

PerBonomi's avatar
11 years ago

How do I add a div to the author section?

Hi there.

I'd like to add a field, or div, below where it currently says

name

rank

 

on the left of every post.

 

What's the easiest way to go about that?

  • NicoB's avatar
    NicoB
    Lithium Alumni (Retired)

    Hi PerBonomi 

    the only thing I can think about is creating a component author@override which would look like this:

    <#assign msgId = env.context.message.id />
    <@delegate />
    <div id="custom-${msgId}" style="diplay:none">your content here</div>
    <@liaAddScript>
    ;(function($) {  
       LITHIUM.Loader.onLoad(function(){
          $("lia-message-view message-uid-${msgId} > .lia-message-author-rank").append("#custom-${msgId}");
    $("custom-${msgId}").css("display", "block"); }); })(LITHIUM.jQuery); </@liaAddScript>

     Basically the idea is to inject the custom content as a hidden div and then use jQuery to place it where you want and make it visible again.

     

    I haven't tested the code so it's very likely you will get errors but I hope it gives you an idea how I would have tackled the problem.

     

    Thanks,

     

    Nico