OrangeScape Developer Community

A community for Application Developers on OrangeScape's Platform-as-a-Service

Theming your applications - Migrating from Mako to Cheetah

With the next build, the template engine in OrangeScape is being changed from MAKO to Cheetah.  You can read more about that here.  

This change will affect those who have made changes to the default theme, to suit to their needs.  We’ll be listing down the changes to be made to make your theme work with the new build release.  This is only for the default make code used in the template files.  If you have made more custom changes / written mako code for your requirements, please make sure you change that.  You can read about Cheetah here


login.html

  • replace “$appName” with “$metadata.getApplication().getSheetName()”
  •  replace “${applicationId}/1/signin”  with “/$metadata.getApplication().getSheetId()/1/signin”.  
  • replace “input name='userid' type='text' value='${userId}' id='userid' class ="Form_Widget"” with “input name='userid' type='text' value='' id='userid' class ="Form_Widget"”
  •  remove the lines starting from “% if errorMsg:” till “% endif”
  •  remove the lines starting from “% if captchaurl:” till “%endif”
  • replace “<input name='forward' type='hidden' value='${forwardUrl}' id='forward'>” with “<input name='forward' type='hidden' value='$forwardUrl' id='forward'>”
  • replace “<%include file="footer.html"/>” with “#include source = $getFileContents($templatePath+"/footer.html")”
theme.html
  • replace “% if isTheme==True:” with “#if $httprequest.getParameters().get('theme') != 'off':”
  • replace “<%include file="header.html"/>” with “#include source = $getFileContents($templatePath+"/header.html")”
  • replace “<%include file="layout.html"/>” with “#include source = $getFileContents($templatePath+"/layout.html")”
  • replace “<%include file="footer.html"/>” with “#include source = $getFileContents($templatePath+"/footer.html")”
  • replace “% else:” with “#else:”
  • replace “% endif” with “#end if”
header.html
  • remove all commented out HTML
  • replace “${home_url}” with “$helper.getHomeUrl()”
  • replace “${log_out_url}” with “$helper.getLogoutUrl()”
  • replace “$appName” with “$metadata.getApplication().getSheetName()”
  • replace “${ user.FirstName }” with “$context.getUser().getValue('FirstName')”
  • replace “${user.getTodayStr()}” with “$helper.getToday()”
  • remove the line “${constructMenu(menuDict)}”
  • remove the lines starting from “<%def name="constructMenu(menuDict)">” to “</%def>”

Changing these should make your application work with your themes.  If you have done any other customizations with mako, then please make changes to them also, to make your theme work.  

 

if you run into any trouble migrating your themes, please post it in the forums.  The new default template files will be uploaded soon.

Views: 101

Comment

You need to be a member of OrangeScape Developer Community to add comments!

Join OrangeScape Developer Community

Comment by Kamal.S on March 27, 2014 at 3:16pm

© 2018   Created by OrangeScape Technologies.   Powered by

Badges  |  Report an Issue  |  Terms of Service