I have a fairly complex theme set up and for the most part I can use include files to add in the code for that part of the template. For example I have:
<% if ContentPanels %>
<% loop ContentPanels %>
<% if PanelLayout = Text Block %>
<% include TextBlocks %>
<% else_if PanelLayout = Image and Text %>
<% include ImageGrid %>
etc...
However one of these layouts needs to access the $Top which does not work in an include file. Does anyone know of a work around for this, so that I am not repeating the same chunk of code on different page templates?