Class
zope.app.onlinehelp.onlinehelptopic.ZPTOnlineHelpTopic

Represents a page template based Help Topic which has other filename extension than .pt.

>>> from zope.publisher.browser import TestRequest, BrowserView
>>> from zope.app.pagetemplate.viewpagetemplatefile import \
...     ViewPageTemplateFile
>>> from zope.app.onlinehelp.tests.test_onlinehelp import testdir
>>> path = os.path.join(testdir(), 'help.pt')

Create a page template based Help Topic from a file

>>> topic = ZPTOnlineHelpTopic('help','Help',path,'')

Test the title

>>> topic.title
'Help'

Test the topic path

>>> topic.getTopicPath()
'help'
>>> topic.parentPath = 'parent'
>>> topic.getTopicPath()
'parent/help'

Test the help content.

>>> class TestView(BrowserView):
...     def index(self):
...         path = self.context.path
...         view = ViewPageTemplateFile(path)
...         return view(self)
>>> request = TestRequest()
>>> view = TestView(topic, request)
>>> res = view.index()
>>> u'<span>This is a ZPT help!</span>' in res
True
>>> u'\u0444\u0430\u0439\u043b' in res
True

Resources can be added to an online help topic.

>>> topic.addResources(['test1.png', 'test2.png'])
>>> topic['test1.png'].contentType
'image/png'
>>> topic['test2.png'].contentType
'image/png'

Base classes

Implemented Interfaces

Attributes/Properties

Methods

Known Subclasses

There are no known subclasses.