Changes between Version 5 and Version 6 of DeveloperGuidelines/Templates/CustomPages


Ignore:
Timestamp:
06/24/12 12:38:55 (9 years ago)
Author:
Fran Boon
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • DeveloperGuidelines/Templates/CustomPages

    v5 v6  
    3838* If a custom View template is passed in from the Template folder then this will need to be provided as a File not a String to work in compiled mode:
    3939{{{
    40 import os
     40from os import path
    4141from gluon import current
    4242response = current.response
    43 path = os.path.join(current.request.folder, "private", "templates",
    44                     response.s3.theme, "views", "index.html")
     43view = path.join(current.request.folder, "private", "templates",
     44                 response.s3.theme, "views", "index.html")
    4545try:
    4646   # Pass view as file not str to work in compiled mode
    47    response.view = open(path, "rb")
     47   response.view = open(view, "rb")
    4848except IOError:
    4949   from gluon.http import HTTP
    50    raise HTTP("404", "Unable to open Custom View: %s" % path)
     50   raise HTTP("404", "Unable to open Custom View: %s" % view)
    5151}}}
    5252== Custom Page ==