Defining Velocity Templates

Comments

4 comments

  • Avatar
    Thomas Rough (K15t Software)
    Hi Volker, 
     
    Thanks for reaching out to us. 
     
    It’s currently not possible to add a custom vm file for user macros. But if you only want to apply some CSS style to the output of your user macro you can do the following:
     
    1. Add the “scroll-unprocessed” class to the outer div in your user macro. This will cause the exporter to directly insert the HTML of the user macro without applying any changes.
     
    Example:
     
    ## @noparams
    <div class="scroll-unprocessed my-macro">
       <p>User macro</p>
       $body
    </div>
     
     
    2. You should now be able to add CSS for your custom CSS classes in your template:
     
    Example:
     
    .my-macro, .my-macro p {
        border: 1px solid black;
    }
     
    I hope this information helps. 
     
    Cheers, Thomas (k15t Software) 
  • Avatar
    Volker Weinreich

    Hi Thomas,

    yes, thank you, this information helps regarding the css styles for a user macro.

    But could you please explain the part Defining Velocity Templates (optional) in your guide https://help.k15t.com/scroll-html-exporter/creating-a-template-75367699.html

    Okay, I can change the existing vm files.

    But what does that mean?: "For each Velocity template that should be overwritten, define a resource element with type template-part in the atlassian-plugin.xml file."

    I think they are already defined in the atlassian-plugin-xml. What else resource element I could define? 

    So, in what case I can add custom vm file? Or is it that I could use the existing resource referrals or not?

    Greetings,

    Volker

  • Avatar
    Volker Weinreich

    Hi Thomas,

    no, the approach with class="scroll-unprocessed doesn't seem to work. Okay, I can change the css. But now eyery link within the  body of the user macro doesn't work in the exported html. And images within the body aren't shown either.

    What to do?

    Greetings,

    Volker

  • Avatar
    Volker Weinreich

    Hi Thomas,

    after further tests with different html-elements, I have discovered, that I can use <table> and <td> to apply classes within my user macro. These classes are not deleted while exporting the content. So I am independent from scroll-unprosessed. So links and images are working.

    Greetings,

    Volker

Please sign in to leave a comment.

Powered by Zendesk