Skip to content

Commit a60c4c8

Browse files
committed
pagefolder view
1 parent 7c76416 commit a60c4c8

File tree

2 files changed

+22
-15
lines changed

2 files changed

+22
-15
lines changed

src/cs_dynamicpages/views/configure.zcml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
<!-- -*- extra stuff goes here -*- -->
99

1010
<browser:page
11-
name="dynamic-page-folder-view"
12-
for="*"
11+
name="view"
12+
for="cs_dynamicpages.content.dynamic_page_folder.IDynamicPageFolder"
1313
class=".dynamic_page_folder_view.DynamicPageFolderView"
1414
template="dynamic_page_folder_view.pt"
1515
permission="zope2.View"
16-
layer="cs_dynamicpages.interfaces.ICsDynamicpagesLayer"
16+
layer="cs_dynamicpages.interfaces.IBrowserLayer"
1717
/>
1818

1919
<browser:page
Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
<html xmlns="http://www.w3.org/1999/xhtml"
2-
xmlns:metal="http://xml.zope.org/namespaces/metal"
3-
xmlns:tal="http://xml.zope.org/namespaces/tal"
4-
xmlns:i18n="http://xml.zope.org/namespaces/i18n"
5-
i18n:domain="cs_dynamicpages"
6-
metal:use-macro="context/main_template/macros/master">
1+
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:metal="http://xml.zope.org/namespaces/metal"
2+
xmlns:tal="http://xml.zope.org/namespaces/tal" xmlns:i18n="http://xml.zope.org/namespaces/i18n"
3+
i18n:domain="cs_dynamicpages" metal:use-macro="context/main_template/macros/master">
4+
75
<body>
86

97
<metal:custom_title fill-slot="content-title">
@@ -23,13 +21,22 @@
2321
</metal:custom_description>
2422

2523
<metal:content-core fill-slot="content-core">
26-
<metal:block define-macro="content-core">
24+
<metal:block define-macro="content-core">
2725

28-
<h2>Main content</h2>
29-
<!--<div tal:replace="view/my_custom_view_method" />-->
30-
<!--<div tal:replace="context/my_custom_field" />-->
26+
<tal:define tal:define="
27+
isAnon context/@@plone_portal_state/anonymous;
28+
">
29+
<tal:condition tal:condition="isAnon">
30+
<tal:replace tal:replace="python:context.REQUEST.RESPONSE.redirect(context.aq_parent.absolute_url(),301)">
31+
</tal:replace>
32+
</tal:condition>
33+
<tal:conditionisanon tal:condition="not:isAnon">
34+
<a class="btn btn-primary btn-lg" href="${context/aq_parent/absolute_url}">View dynamic page</a>
35+
</tal:conditionisanon>
36+
</tal:define>
3137

32-
</metal:block>
38+
</metal:block>
3339
</metal:content-core>
3440
</body>
35-
</html>
41+
42+
</html>

0 commit comments

Comments
 (0)