Commit 6b66946b authored by Jean-Paul Smets's avatar Jean-Paul Smets

2007-01-08 JPS - refactored API and implemented minimal site.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@11918 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent c4b05340
......@@ -321,7 +321,7 @@ return aggregate_list\n
</item>
<item>
<key> <string>id</string> </key>
<value> <string>WebSite_getGroupList</string> </value>
<value> <string>Form_getGroupList</string> </value>
</item>
<item>
<key> <string>title</string> </key>
......
......@@ -76,21 +76,37 @@
ERP5 contents through multiple custom web layouts.\n
\n
This script returns a list of tuples in the form\n
(title, value) where title is the title of the\n
(title, value) where title is the *translated* title of the\n
document provided as value. The document value\n
must be wrapped in the acquisition context\n
(ex. Web Site / Section / Module / Document).\n
\n
Scripts of page templates which use this script\n
The reason why the title is generated by this script\n
is because the layout of a breadcrumb (ex. horizontal,\n
vertical, tree, etc.) is independent of the kind of\n
titles we want to use to represent each the breadcrumb\n
items. It is therefore the responsability of this\n
script to decide how to identify a document which will\n
be displayed in a breadcrumb (ex. by title,\n
by short title, by reference, by version) and to translate\n
whatever is relevant to be translated.\n
\n
Page templates which use this script\n
and need to generate the URLs of document values\n
should must use the Base_getPermanentURL API\n
or the absolute_url API in order\n
to benefit from virtual hosting features.\n
(ie. do not use getUrl or getPath)\n
should use the getPermanentURL API (called on the\n
current section) in order to benefit from\n
virtual hosting features and in order to make sure\n
that generated URLs are as much as possible permanent\n
URLs. Never use getUrl or getPath to generate URLs.\n
You may also use absolute_url but in this case you\n
will lose all the benefits from permanent URLs.\n
\n
As a rule of thumb: for viewable content, use\n
getPermanentURL; for editable content, use absolute_url\n
\n
This script can be used to produce breadcrumbs\n
in page templates or in widgets. It can be customised\n
to implement different behaviours such as\n
This script should be customised if necessary to\n
implement Web Section specific breadcrumb behaviour.\n
Typical behaviours include:\n
\n
- CMS like breadcrumb (hierarchy of contents)\n
\n
......@@ -100,10 +116,13 @@
\n
The default implementation is hierarchical.\n
\n
TODO: Clarify absolute_url or Base_getPermanentURL\n
TODO: is it so useful to include title ?\n
Customisation can be portal_type based, class based\n
or can simply result from putting a WebSection_getBreadcrumbItemList\n
directly inside a given section rather than in a skin\n
folder. The later is recommended for hosting\n
multiple sites on a single ERP5Site instance.\n
"""\n
crumb = context\n
crumb = document\n
crumb_list = []\n
\n
# Implementation consists in browsing the aq_parent sequence\n
......@@ -140,7 +159,7 @@ return crumb_list\n
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
<value> <string>document</string> </value>
</item>
<item>
<key> <string>errors</string> </key>
......@@ -160,13 +179,13 @@ return crumb_list\n
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>0</int> </value>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>context</string>
<string>document</string>
<string>crumb</string>
<string>crumb_list</string>
<string>None</string>
......@@ -187,7 +206,7 @@ return crumb_list\n
</item>
<item>
<key> <string>id</string> </key>
<value> <string>WebSite_getBreadcrumbItemList</string> </value>
<value> <string>WebSection_getBreadcrumbItemList</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
......
......@@ -81,17 +81,18 @@
\n
The default implementation should look at published\n
documents which are associated to the section\n
through aggregate relation and try to display those\n
which are in the user language if any.\n
through the aggregate relation and try to display those\n
which are available in the user language if any.\n
\n
Other implementations are possible: ex. display the last\n
version in the closest language rather than\n
the latest version in the user language.\n
\n
This script is intended to be overriden by creating a new script\n
within the Web Site instance if necessary (not inside a\n
portal_skin since multiple sites might have different behaviour).\n
\n
within a Web Section or a Web Site instance. Customisation\n
is also possible per portal type or per meta type through\n
portal skins. It is recommended to use the first approach\n
to host multiple sites on a single ERP5Site instance.\n
"""\n
portal_object = context.getPortalObject()\n
\n
......@@ -104,7 +105,7 @@ current_section = context.getWebSectionValue()\n
reference_list = context.getAggregateReferenceList()\n
if not reference_list: return None # Quick return\n
\n
return context.WebSite_getDocumentValue(name=reference_list)\n
return context.getDocumentValue(name=reference_list)\n
</string> </value>
</item>
<item>
......@@ -175,7 +176,7 @@ return context.WebSite_getDocumentValue(name=reference_list)\n
</item>
<item>
<key> <string>id</string> </key>
<value> <string>WebSite_getDefaultWebPageValue</string> </value>
<value> <string>WebSection_getDefaultDocumentValue</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
......
......@@ -74,11 +74,6 @@
ERP5 Web is a business template of ERP5 which provides a way\n
to create web sites which can display selected\n
ERP5 contents through multiple custom web layouts.\n
\n
If no name parameter is provided, this script\n
returns the document which is being displayed\n
currently in a Web Section or a Web Page\n
by invoking WebSite_getDefaultWebPageValue. \n
\n
The default implementation searches for\n
documents which are in the user language if any\n
......@@ -87,13 +82,11 @@
Other implementations are possible: ex. display the last\n
version in the closest language rather than\n
the latest version in the user language.\n
\n
If a name parameter is provided, it will lookup\n
the catalog to find the most appropriate\n
document.\n
\n
NOTE:\n
- portal param probably useless \n
- the portal parameter was introduced to\n
fix acquisition issues within the _aq_dynamic\n
lookup from WebSection class.\n
"""\n
if portal is None: portal = context.getPortalObject()\n
portal_catalog = portal.portal_catalog\n
......@@ -102,33 +95,26 @@ portal_catalog = portal.portal_catalog\n
# href tags which point to a document by reference can still work.\n
valid_portal_type_list = [\'Web Page\', ]\n
\n
# This should probably be moved to a specific page\n
if name is None:\n
if context.getPortalType() in valid_portal_type_list:\n
return context\n
elif context.getPortalType() in (\'Web Site\', \'Web Section\'):\n
return context.WebSite_getDefaultWebPageValue()\n
else:\n
return None\n
\n
# Find the applicable language\n
language = context.Localizer.get_selected_language()\n
language = portal.Localizer.get_selected_language()\n
\n
# Search the catalog for all documents matching the reference\n
# this will only return documents which are accessible by the user\n
web_page_list = portal_catalog(reference=name, portal_type=valid_portal_type_list,\n
web_page_list = portal_catalog(reference=name, portal_type=valid_portal_type_list, \n
order_by=[(\'index\', \'descending\'), (\'version\', \'descending\')],\n
language=language)\n
# XXX - group_by is missing here\n
# portal_catalog extension required\n
try:\n
# Try to get the first page on the list\n
web_page = web_page_list[0]\n
web_page = web_page.getObject()\n
except IndexError:\n
# Search again without the language\n
web_page_list = portal_catalog(reference=name, portal_type=\'Web Page\',\n
web_page_list = portal_catalog(reference=name, portal_type=\'Web Page\', \n
order_by=[(\'index\', \'descending\'), (\'version\', \'descending\')])\n
# XXX - group_by is missing here\n
# portal_catalog extension required\n
try:\n
# Try to get the first page on the list\n
web_page = web_page_list[0]\n
......@@ -161,7 +147,7 @@ return web_page\n
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>name=None,portal=None</string> </value>
<value> <string>name,portal=None</string> </value>
</item>
<item>
<key> <string>errors</string> </key>
......@@ -212,13 +198,12 @@ return web_page\n
<value>
<tuple>
<none/>
<none/>
</tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>WebSite_getDocumentValue</string> </value>
<value> <string>WebSection_getDocumentValue</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
......
......@@ -94,14 +94,21 @@
with a "validated" state and in the appropriate product family.\n
\n
This script is intended to be overriden by creating a new script\n
within the Web Site instance if necessary (not inside a\n
portal_skin since multiple sites might have different behaviour).\n
within the Web Section or Web Site instance. It can be also\n
customised per portal type within portal_skins. Customisation\n
thourgh local scripts is recommended to host multiple sites\n
on the same ERP5Site instance.\n
\n
The API uses **kw so that it is possible to extend the behaviour of\n
the default script with advanced features (ex. group by reference,\n
by version, only select a specific publication state, etc.).\n
\n
Here are some suggestions which can either be implemented using\n
SQL (group_by, order_by) or using additional python scripting\n
if this is compatible with data size.\n
\n
SUGGESTIONS:\n
\n
- Prevent showing duplicate references\n
\n
- Add documents associated to this section through \'aggregate\'.\n
......@@ -115,7 +122,7 @@ current_section = context.getWebSectionValue()\n
\n
# Return the list of matching documents for the given states\n
return current_section.searchResults(validation_state=[\'draft\', \'submitted\', \'shared\',\n
\'released\', \'public\', \'restricted\'],\n
\'released\', \'published\', \'restricted\'],\n
order_by=[(\'int_index\', \'descending\')])\n
</string> </value>
</item>
......
......@@ -85,56 +85,40 @@
even if the physical path of the document is\n
\n
/erp5/web_page_module/33\n
\n
This script can be considered as the reverse of\n
WebSection_getDocumentValue.\n
\n
The default script looks in the acquisition context\n
for the first relevant section and build a URL\n
for the first relevant section and builds a URL\n
based on the section absolute_url and on the\n
document reference.\n
\n
The section parameter can be used to provide\n
explicitely a section. This can be useful to\n
build URL generators for listbox entries.\n
The document parameter is required.\n
\n
More sophisticated behaviours are possible.\n
\n
SUGGESTIONS:\n
\n
- change the behaviour of WebSite_getDocumentUrl\n
- change the behaviour of WebSection_getPermanentURL\n
for non anonymous\n
\n
- change the behaviour of WebSite_getDocumentUrl\n
for documents which are not published.\n
\n
NOTE: absolute_url is the appropriate API to get\n
the absolute_url of the current document. It has\n
been tweaked enough in ERP5 Web to support virtual\n
hosting and permanent URLs.\n
\n
Base_getPermanentURL is useful to create a permanent\n
URL out of a document which has been accessed either\n
directly or through a Web Section / Web Site. It is\n
the reverse method of WebSite_getDocumentValue.\n
- change the behaviour of WebSection_getPermanentURL\n
for documents which are not published.\n
"""\n
# Return absolute URL if our parent is not a Web Section or Web Site\n
if section is None and context.aq_parent.getPortalType() not in (\'Web Section\', \'Web Site\'):\n
return context.absolute_url()\n
\n
# Return absolute URL if this is not an appropriate portal_type\n
valid_portal_type_list = [\'Web Page\', ] # WARNING - this is a copy from WebSite_getDocumentValue\n
if context.getPortalType() not in valid_portal_type_list:\n
return context.absolute_url()\n
valid_portal_type_list = [\'Web Page\', ] # WARNING - this is a copy from WebSection_getDocumentValue\n
if document.getPortalType() not in valid_portal_type_list:\n
return document.absolute_url()\n
\n
# Return absolute URL if this is not a \'live\' document\n
validation_state=[\'draft\', \'submitted\', \'shared\', # WARNING - this is a copy from WebSite_getDocumentValueList\n
validation_state=[\'draft\', \'submitted\', \'shared\', # WARNING - this is a copy from WebSection_getDocumentValueList\n
\'released\', \'published\', \'restricted\']\n
if context.getValidationState() not in validation_state:\n
return context.absolute_url()\n
\n
# Find the Web Section or Web Site we belong to\n
if section is None: section = context.getWebSectionValue()\n
if document.getValidationState() not in validation_state:\n
return document.absolute_url()\n
\n
# Return the URL\n
return "%s/%s" % (section.absolute_url(), context.getReference())\n
return "%s/%s" % (context.absolute_url(), document.getReference())\n
</string> </value>
</item>
<item>
......@@ -157,7 +141,7 @@ return "%s/%s" % (section.absolute_url(), context.getReference())\n
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>section=None</string> </value>
<value> <string>document</string> </value>
</item>
<item>
<key> <string>errors</string> </key>
......@@ -183,12 +167,11 @@ return "%s/%s" % (section.absolute_url(), context.getReference())\n
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>section</string>
<string>None</string>
<string>_getattr_</string>
<string>context</string>
<string>document</string>
<string>valid_portal_type_list</string>
<string>_getattr_</string>
<string>validation_state</string>
<string>context</string>
</tuple>
</value>
</item>
......@@ -200,14 +183,12 @@ return "%s/%s" % (section.absolute_url(), context.getReference())\n
<item>
<key> <string>func_defaults</string> </key>
<value>
<tuple>
<none/>
</tuple>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Base_getPermanentURL</string> </value>
<value> <string>WebSection_getPermanentURL</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
......
......@@ -73,9 +73,8 @@
for a newly created Web Site\n
"""\n
# Set Web Site layout to default one\n
default_layout = \'template_erp5_web\'\n
context.setContainerLayout(default_layout)\n
context.setContentLayout(default_layout)\n
context.setContainerLayout(\'erp5_web_layout\')\n
context.setContentLayout(\'erp5_web_content_layout\')\n
\n
# Set default webmaster to current user\n
user_id = context.portal_membership.getAuthenticatedMember().getUserName()\n
......@@ -124,7 +123,6 @@ context.setWebmaster(user_id)\n
<tuple>
<string>args</string>
<string>kw</string>
<string>default_layout</string>
<string>_getattr_</string>
<string>context</string>
<string>user_id</string>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.ERP5Form.Form</string>
<string>ERP5Form</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>action</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>enctype</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>group_list</string> </key>
<value>
<list>
<string>left column transparent (Logo)</string>
<string>left column (Navigation)</string>
<string>left column (Contents)</string>
<string>left column (Search)</string>
<string>left column (Debug)</string>
<string>right column (Demo)</string>
<string>right column (Toolbox)</string>
<string>footer</string>
</list>
</value>
</item>
<item>
<key> <string>groups</string> </key>
<value>
<dictionary>
<item>
<key> <string>footer</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>left column (Contents)</string> </key>
<value>
<list>
<string>subsection_list</string>
<string>section_content_list</string>
</list>
</value>
</item>
<item>
<key> <string>left column (Debug)</string> </key>
<value>
<list>
<string>applicable_layout</string>
</list>
</value>
</item>
<item>
<key> <string>left column (Navigation)</string> </key>
<value>
<list>
<string>language_selector</string>
<string>breadcrumb</string>
</list>
</value>
</item>
<item>
<key> <string>left column (Search)</string> </key>
<value>
<list>
<string>your_search_text</string>
<string>search_action</string>
</list>
</value>
</item>
<item>
<key> <string>left column transparent (Logo)</string> </key>
<value>
<list>
<string>website_logo</string>
</list>
</value>
</item>
<item>
<key> <string>right column (Demo)</string> </key>
<value>
<list>
<string>about_box</string>
</list>
</value>
</item>
<item>
<key> <string>right column (Toolbox)</string> </key>
<value>
<list>
<string>admin_toolbox</string>
</list>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>erp5_web_content_layout</string> </value>
</item>
<item>
<key> <string>method</string> </key>
<value> <string>POST</string> </value>
</item>
<item>
<key> <string>name</string> </key>
<value> <string>erp5_web_default_layout</string> </value>
</item>
<item>
<key> <string>pt</string> </key>
<value> <string>template_erp5_web</string> </value>
</item>
<item>
<key> <string>row_length</string> </key>
<value> <int>6</int> </value>
</item>
<item>
<key> <string>stored_encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Default Section Layout</string> </value>
</item>
<item>
<key> <string>unicode_mode</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>update_action</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.ERP5Form.InputButtonField</string>
<string>InputButtonField</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>search_action</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary/>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string>hiddenLabel searchButton</string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string>Go</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>name</string> </key>
<value> <string>Base_searchResultList:method</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Search</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -150,9 +150,7 @@
</item>
<item>
<key> <string>enabled</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
......@@ -301,26 +299,7 @@
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>here/section_content_render</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<tuple>
<tuple>
<string>Products.Formulator.TALESField</string>
<string>TALESMethod</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python:here.getPortalType() in (\'Web Site\', \'Web Section\')</string> </value>
<value> <string>here/current_web_section/section_content_render</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -150,9 +150,7 @@
</item>
<item>
<key> <string>enabled</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
......@@ -301,26 +299,7 @@
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>here/subsection_render</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<tuple>
<tuple>
<string>Products.Formulator.TALESField</string>
<string>TALESMethod</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python:here.getPortalType() in (\'Web Site\', \'Web Section\')</string> </value>
<value> <string>request/current_web_section/subsection_render</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -150,9 +150,7 @@
</item>
<item>
<key> <string>enabled</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
......@@ -301,26 +299,7 @@
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>here/section_content_render</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<tuple>
<tuple>
<string>Products.Formulator.TALESField</string>
<string>TALESMethod</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python:here.getPortalType() in (\'Web Site\', \'Web Section\')</string> </value>
<value> <string>request/current_web_section/section_content_render</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -150,9 +150,7 @@
</item>
<item>
<key> <string>enabled</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
......@@ -301,26 +299,7 @@
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>here/subsection_render</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<tuple>
<tuple>
<string>Products.Formulator.TALESField</string>
<string>TALESMethod</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python:here.getPortalType() in (\'Web Site\', \'Web Section\')</string> </value>
<value> <string>request/current_web_section/subsection_render</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -105,18 +105,26 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n
<!-- Here we force the editable_mode variable to True to let the layout and widgets\n
based on forms be rendered as editable or non-editable according the "editable"\n
property on fields.\n
However this hasa bad side effect: the editable_mode variable in request is\n
\n
However this has bad side effect: the editable_mode variable in request is\n
forced to True and is no longer representative of the web site mode.\n
\n
We also set some REQUEST variables which will be needed by Widgets.\n
-->\n
</tal:block>\n
\n
<tal:block tal:repeat="aggregate python: layout_form.WebSite_getGroupList([\'header\', \'left\', \'right\', \'footer\'])"\n
<tal:block tal:repeat="aggregate python: layout_form.Form_getGroupList([\'header\', \'left\', \'right\', \'footer\'])"\n
tal:define="dummy python: request.set(\'editable_mode\', True);\n
dummy python: request.set(\'http_parameters\', http_parameters);\n
dummy python: request.set(\'actions\', actions);">\n
dummy python: request.set(\'actions\', actions);\n
dummy python: request.set(\'current_web_section\',\n
request.get(\'current_web_section\', here.getWebSectionValue()));\n
dummy python: request.set(\'current_web_document\',\n
request.get(\'current_web_document\', here));\n
dummy python: request.set(\'is_web_section_default_document\',\n
request.get(\'is_web_section_default_document\', 0));">\n
<tal:block metal:use-macro="here/aggregate_render/macros/aggregate_render"/>\n
</tal:block>\n
\n
</tal:block>\n
</tal:block>\t\n
</tal:block>\n
......
......@@ -57,7 +57,7 @@
tal:condition="remaining_items">\n
<li tal:define="current_item python: remaining_items[0];\n
remaining_items python: remaining_items[1:]">\n
<a tal:attributes="href python: \'%s/view\' % current_item[1].Base_getPermanentURL();\n
<a tal:attributes="href python: \'%s/view\' % current_item[1].getPermanentURL(current_item[1]);\n
class python: len(remaining_items) == 0 and \'selected\' or \'\'"\n
tal:content="python: current_item[0]"/>\n
<tal:block metal:use-macro="here/breadcrumb/macros/renderBreadcrumbItem"/>\n
......@@ -66,7 +66,7 @@
</tal:block>\n
\n
<!-- Initialize the recursive loop -->\n
<div class="breadcrumb" tal:define="remaining_items python: context.WebSite_getBreadcrumbItemList()">\n
<div class="breadcrumb" tal:define="remaining_items python: context.getBreadcrumbItemList(here)">\n
<tal:block metal:use-macro="here/breadcrumb/macros/renderBreadcrumbItem"/>\n
</div>\n
\n
......
......@@ -53,8 +53,8 @@
are published and linked with the current section through Predicate.\n
--></tal:block>\n
\n
<ul tal:repeat="document python: context.WebSection_getDocumentValueList()">\n
<li><a tal:attributes="href python: document.WebSite_getDocumentUrl()"\n
<ul tal:repeat="document python: request.current_web_section.getDocumentValueList()">\n
<li><a tal:attributes="href python: context.getPermanentURL(document)"\n
tal:content="python: document.getProperty(\'translated_short_title\', None)\n
or document.getTranslatedTitleOrId()"/></li>\n
</ul>
......
......@@ -52,7 +52,7 @@
This widget displays the list of Sections contained in the current context.\n
--></tal:block>\n
\n
<ul><tal:block tal:repeat="section python:context.contentValues(portal_type=\'Web Section\')">\n
<ul><tal:block tal:repeat="section python:here.contentValues(portal_type=\'Web Section\')">\n
<li>\n
<a tal:attributes="href python: section.absolute_url_path()"\n
tal:content="python: section.getProperty(\'translated_short_title\', None)\n
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment