Skip to content

Instantly share code, notes, and snippets.

@robotlolita
Created January 25, 2011 15:25
Show Gist options
  • Save robotlolita/795068 to your computer and use it in GitHub Desktop.
Save robotlolita/795068 to your computer and use it in GitHub Desktop.
# -------------------------------------------------------------------------
def indexPage(self, ctx):
scope = self
class IndexPage(Conditional):
def item(self):
return scope.page if scope.page.index else None
return IndexPage(ctx)
# -------------------------------------------------------------------------
def postTitle(self, ctx):
scope = self
class Title_(Scope):
def posttitle(self, ctx):
return scope.page.title
class PostTitle(Conditional):
def item(self):
return Title_(parent=scope.page) if scope.page.title else None
return PostTitle(ctx)
# ( ... )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment