Page tree
Skip to end of metadata
Go to start of metadata

This page contains useful tips to create themes that will be compatible with future versions of JIRA and Confluence:


Learn from existing Extensions

Look into the Sample Extensions to see how other extensions work. And read the detailed blogpost about how the "Language Switcher Extension" has been built.

Increase the probability of compatibility for your extension

  • Styles
    • Use the very common html containers of the application:
      • #header
      • #footer
      • #main
    • Do not style into the very little end of the applications html
    • Do not rely on a specific container hierarchy:
      • #div1 > h1 > ul > li > a
    • Each style needs to have a specific context id to start
      • #header .examplediv
      • #main #examplediv
  • Javascript
    • Use only one "AJS.toInit" function as a kind of "main" function
      • call up all your container move functions from this function
  • Template
    • Create a specific container div id to include your backend code:
      • <div id="my-special-unique-container" ></div>

Troubleshooting

  • If your Template content is not available in the html
    • search the html for "Error during template resource parsing!"
    • If this string is present please check the logs for further information

 

Scope your Template HTML 

If your Extension HTML should only be available in certain pages 

  • You can scope the Template code to a specific action or URL
#Confluence
## example HTML only for Dashboard
#if($req.getRequestURL().toString().endsWith("dashboard.action"))
	your scoped HTML
#end
 
#JIRA
## example HTML only for Dashboard
#if($request.getRequestURL().toString().endsWith("Dashboard.jspa"))
	Your HTML code
#end


 

  • Your can Scope your Application to a specific Context
#Confluence
## example HTML only for space with key "ds"
#if($space.key.equals("ds"))
	your scoped HTML
#end


#JIRA
## example HTML only for project with key "DEMO"
#if($project.key.equals("DEMO"))
	Your HTML code
#end




  • No labels

3 Comments

  1. Hey… Tip has one 'p' not two (smile)

  2. for even more "cuteness" we made our german accent visible (smile)

    To be serious: thanks for the tip

     

    1. Heh, German accents are always cute (wink)

      You are welcome!