I made a BrowserView with a custom template for 'view' of a content type, but it is being ignored as if it doesn't see it.
I have a content type, MyEventType that implements IEvent for marker purposes. It also is assigned in my.product.myeventtype.xml the IEventBasic behavior.
In myeventtype,py:
from plone.app.contenttypes.interfaces import IEvent
from Products.Five import BrowserView
from plone.directives import form
class IMyEventType(form.Schema):
"""Interface for IMyEventType"""
class IMyEventType(Interface):
"""implements IEvent"""
implements(IMyEventType,IEvent)
"""methods""""
class View(BrowserView):
def __init__(self, context, request):
self.context = context
self.request = request
def render(self):
return self.index()
def __call__(self):
return self.render()
In configure.zcml:
<browser:page
name="view"
for=".myeventtype.IMyEventType
class=".myeventtype.View"
permission="zope2.View"
template="templates/myeventtype.pt"
/>
In my view template:
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal"
xmlns:i18n="http://xml.zope.org/namespaces/i18n"
lang="en"
metal:use-macro="context/main_template/macros/master"
i18n:domain="my.product">
<body>
<metal:main fill-slot="content-core">
<metal:content-core define-macro="content-core">
<div tal:replace="structure provider:plone.abovecontenttitle" />
.....
<div tal:replace="structure provider:plone.belowcontentbody" />
</metal:content-core>
</metal:main>
</body>
</html>
When I try viewing the template, it uses the default one. I tried a print statement in the call and render functions, as well as init, but none of the print statements were called. I event tried appending /view in the url to see if that worked and it did not.
I'm sorry that similar questions were asked, but I had something like this working before and I can't figure out what's wrong. I got this method of assigning the template to View before with other content types I've created. What am I doing wrong?
I am using Plone 4.3.
Edit: I thought I found the solution, but I didn't. I accidentally assigned the view template to the edit form. So I still don't understand what is causing the problem.