add node type raw to be able to emit e.g. robots.txt and similar stuff
This commit is contained in:
parent
b3677ea635
commit
b7c702f17d
3 changed files with 7 additions and 0 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,5 +1,6 @@
|
|||
*.pyc
|
||||
*.pyo
|
||||
dist/
|
||||
*.project
|
||||
*.pydevproject
|
||||
*.sublime-project
|
||||
|
|
|
@ -85,6 +85,11 @@ class NodeView(BaseView):
|
|||
self.setSkin(self.viewConfig.get('skinName'))
|
||||
|
||||
def __call__(self, *args, **kw):
|
||||
if self.nodeType == 'raw':
|
||||
vn = self.context.viewName
|
||||
if vn:
|
||||
self.request.response.setHeader('content-type', vn)
|
||||
return self.context.body
|
||||
tv = self.viewAnnotations.get('targetView')
|
||||
if tv is not None:
|
||||
if tv.isToplevel:
|
||||
|
|
1
view.py
1
view.py
|
@ -219,6 +219,7 @@ nodeTypes = [
|
|||
('page', _(u'Page')), # standalone page with a menu item
|
||||
('menu', _(u'Menu')), # top-level menu (also a page)
|
||||
('info', _(u'Info')), # not shown automatically, but may be a link target
|
||||
('raw', _(u'Raw')), # render body as is, viewName may contain content type
|
||||
]
|
||||
|
||||
class NodeTypeSourceList(object):
|
||||
|
|
Loading…
Add table
Reference in a new issue