[Plone-IT] Re: help con template di edit
Yuri
yurj a alfa.it
Lun 2 Feb 2009 17:07:24 UTC
Yuri ha scritto:
> Salve,
>
> voglio cambiare il template di edit di un mio contenuto, ma senza
> ricopiare il base edit & c, cioè avere la modifica minimale.
>
> Ho provato per un pò ma non ne vengo a capo, potete postare un
> template di edit minimo per plone3? Vi ringrazio :)
>
Per chiarire, volevo evitare un template del tipo:
=================
<tal:block metal:define-macro="master"
define="view context/@@at_base_edit_view;
dummy python:view.isTemporaryObject() and
request.set('disable_border', True);
lifecycle context/@@at_lifecycle_view;
lock_info context/@@plone_lock_info;
dummy lifecycle/begin_edit;
errors options/state/getErrors | nothing;
Iterator
python:modules['Products.Archetypes'].IndexIterator;
schematas here/Schemata;
allow_tabbing python: not view.isMultiPageSchema();
fieldsets python:[key for key in schematas.keys() if
(schematas[key].editableFields(here, visible_only=True))];
default_fieldset python:(not fieldsets or 'default'
in fieldsets) and 'default' or fieldsets[0];
fieldset
request/fieldset|options/fieldset|default_fieldset;
fields python:[f for key in fieldsets for f in
schematas[key].editableFields(here)];
dummy python:here.at_isEditable(fields);
portal_type
python:here.getPortalTypeName().lower().replace(' ', '_');
type_name here/getPortalTypeName|here/archetype_name;
base_macros here/edit_macros/macros;
edit_template python:'%s_edit' % portal_type;
edit_macros python:path('here/%s/macros | nothing' %
edit_template);
header_macro edit_macros/header | header_macro |
base_macros/header;
typedescription_macro edit_macros/typedescription |
typedescription_macro | base_macros/typedescription;
body_macro edit_macros/body | body_macro |
base_macros/body;
footer_macro edit_macros/footer | footer_macro |
base_macros/footer;
isLocked isLocked | lock_info/is_locked_for_current_user;
css python:here.getUniqueWidgetAttr(fields,
'helper_css');
js python:here.getUniqueWidgetAttr(fields,
'helper_js');">
<html xmlns="http://www.w3.org/1999/xhtml"
xml:lang="en"
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"
metal:use-macro="here/main_template/macros/master"
i18n:domain="plone">
<metal:head fill-slot="top_slot">
<tal:block define="macro edit_macros/topslot | nothing"
condition="macro">
<metal:block use-macro="macro" />
</tal:block>
</metal:head>
<metal:javascript_head fill-slot="javascript_head_slot">
<tal:block define="macro
here/archetypes_custom_js/macros/javascript_head | nothing"
condition="macro">
<metal:block use-macro="macro" />
</tal:block>
<tal:js condition="js"
repeat="item js">
<script type="text/javascript"
charset="iso-8859-1"
tal:condition="python:exists('portal/%s' % item)"
tal:attributes="src string:$portal_url/$item">
</script>
</tal:js>
<tal:block define="macro edit_macros/javascript_head | nothing"
condition="macro">
<metal:block use-macro="macro" />
</tal:block>
</metal:javascript_head>
<metal:css fill-slot="css_slot">
<tal:css condition="css"
repeat="item css">
<style type="text/css"
media="all"
tal:condition="python:exists('portal/%s' % item)"
tal:content="structure string:<!-- @import
url($portal_url/$item); -->">
</style>
</tal:css>
<tal:block define="macro edit_macros/css | nothing"
condition="macro">
<metal:block use-macro="macro" />
</tal:block>
</metal:css>
<body>
<metal:fill fill-slot="main">
<metal:main define-macro="main">
<metal:use_header use-macro="header_macro" />
<metal:use_typedescription use-macro="typedescription_macro" />
<metal:use_body use-macro="body_macro" >
<metal:prova fill-slot="widgets">
<tal:tabbed tal:condition="allow_tabbing | nothing">
<fieldset tal:define="sole_fieldset python:len(fieldsets)
== 1"
tal:repeat="fieldset fieldsets"
tal:attributes="id string:fieldset-${fieldset}"
tal:omit-tag="sole_fieldset">
<legend id=""
tal:content="python:
view.getTranslatedSchemaLabel(fieldset)"
tal:attributes="id
string:fieldsetlegend-${fieldset}"
tal:condition="not:sole_fieldset" />
<tal:fields repeat="field
python:schematas[fieldset].editableFields(here, visible_only=True)">
<tal:block tal:condition="python:field.getName() <> 'referee'">
<metal:fieldMacro
use-macro="python:here.widget(field.getName(), mode='edit')" />
</tal:block>
</tal:fields>
</fieldset>
</tal:tabbed>
<tal:nottabbed tal:condition="not: allow_tabbing | nothing">
<tal:fields repeat="field
python:schematas[fieldset].editableFields(here, visible_only=True)">
<metal:fieldMacro
use-macro="python:here.widget(field.getName(), mode='edit')" />
</tal:fields>
</tal:nottabbed>
</metal:prova>
</metal:use_body>
<metal:use_footer use-macro="footer_macro" />
</metal:main>
</metal:fill>
</body>
</html>
</tal:block>
==================
Maggiori informazioni sulla lista
Plone-IT