Personal tools
  • We're Hiring!

You are here: Home Documentation Previous versions OME Server Custom Annotations Customizing


HTML Templates - Customizing

Here is an example of how to customize your display template by adding a link to an external database. We only want to query the NIA Mouse Gene Index (MGI) for GeneSymbols and ProbeNames.

Find the template: This particular template should be in your "/OME/html/Templates/Display/One/OME/Image/" directory. The others are stored in "/OME/html/Templates/Actions/Annotator/CategoryGroup/" and "/OME/html/Templates/Browse/CategoryGroup/".

To add links, it is best to render each row of the table individually. To do this, you should remove the loop and uncomment the rest of the code. Now, let's change the order of the CategoryGroups so that the top two are the ones I want to find in MGI. Replace

<TMPL_VAR NAME="CategoryGroup.load/id-[9215,9216,9217,9218]">


<TMPL_VAR NAME="CategoryGroup.load/id-[9216,9218,9215,9217]">

The only thing that has changed is the order of the IDs - GeneSymbols and ProbeNames are first and second now.

Okay, since you've done this, you now have another variable you must take care of: "cg[num].cat/Name". This is a plaintext version of the Category's name.

Since we only want to check MGI for two categories, we can hide the others using hidden fields. Add these two lines of code to the top of the template:

<input type="hidden" value="<TMPL_VAR NAME=cg[3].cat/Name>">
         <input type="hidden" value="<TMPL_VAR NAME=cg[4].cat/Name>">

Now, add another column to the table - in the first row (<tr>row 1</tr>)

<td class="ome_td" align="left"><center>MGI Link</td>

In the 2nd and 3rd rows, you can add your link:

<td class="ome_td" align="left"><a href="
         <TMPL_VAR NAME=cg[1].cat/Name>" target="new">Query</a></td>

Make sure you're calling the category name that you want.

Here's the final product:

Document Actions