[opencms-dev] [DKIM] Page-templates and csm:editable
Hein van der Kallen
hvanderkallen at xs4all.nl
Sat Nov 19 15:08:35 CET 2022
All,
My primary problem with the use of page-templates in opencms 13 can be
solved as follows:
For xml-content types with page-templates : do NOT include them in a module
config.
If they have a formatter and formatter config then add the content-types and
the formatter configs to a master configuration, and use that master
configuration in subsites where you want to use containerpages and ADE.
I still advise to use a site config then in your site root with only
<DiscardTypes>true</DiscardTypes> because that will hide the complete
"content-elements" group of the "Create new resource" dialog of the
workplace in the part of the site where you don't use ADE and want no
content in a .content folder.
The mercury content types then still are available in the "other types"
and the "all" parts of the "Create new resource" dialog of the workplace.
If you don't want them visible at all in the "Create new resource" dialog of
the workspace, deny the create permission on the corresponding explorer
types in /WEB-INF/config/opencms-modules.xml.
The rest of my questions to Alkacon on the use of page-templates still
stand.
Regards
Hein van der Kallen
Van: opencms-dev <opencms-dev-bounces at opencms.org> Namens Hein van der
Kallen via opencms-dev
Verzonden: donderdag 17 november 2022 14:01
Aan: The OpenCms mailing list <opencms-dev at opencms.org>
CC: Hein van der Kallen <hvanderkallen at xs4all.nl>
Onderwerp: [DKIM] [opencms-dev] Page-templates and csm:editable
Alkacon,
In Opencms 7 the preferred way to create a webpage was with a xml-content
type and a page-template.
In the resourcetype of your xml-content you define a template-elements
definition pointing to your page template.
Now in every folder where an author has write permission your user can
create a new xml-content, that points to your page template. And after
publishing, the page is created using only the xml-content and the
page-template.
Moreover if you use <cms:editable> in your page template, the logged-in user
can, in display mode, see a working edit button to edit his xml-content.
See:
http://www.opencms-wiki.org/wiki/Defining_OpenCMS_structured_XML_content
If you had xmlpages and followed the excellent conversion strategy from
Michael Emmerich in
https://www.slideshare.net/AlkaconOpenCms/opencms-days-2013-how-to-update-sm
oothly-to-opencms-9ms-9
you would end up with a new xml-content type using <cms:editable> and a
page-template with an included head and foot. ( you "only" had to write a
suitable conversion program for your xmlpages).
I consider page-templates and <cms:editable> the easiest and best design for
most websites.
The author writes his story in one xml-content and publishes it, the
designer makes sure that everything needed around that story is generated in
the included head and foot.
( the base template for the head and foot can use the location of the
xml-content to show different content in the head and foot depending on that
location).
Yes, you can also create a container template with the same head and foot,
using <cms:enable-ade>
And you can add formatters and a module config to your xml-content types.
Then you can use ADE and container pages. As Alkacon prefers starting from
Opencms 8.
But that design is way more complicated. I tried it, but never found it
better.
And I never found a good conversion strategy for existing content.
In opencms 10 and opencms 11 page-templates and <cms:editable> work if in
Your site root (sites/default) you put no template property and
In /sites/default/.content/config you only state that you use no (ade)
types:
You put in /sites/default/.content/config
<?xml version="1.0" encoding="UTF-8"?>
<SitemapConfigurations xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="opencms://system/modules/org.opencms.ade.conf
ig/schemas/sitemap_config.xsd">
<SitemapConfiguration language="en">
<DiscardTypes>true</DiscardTypes>
</SitemapConfiguration>
</SitemapConfigurations>
In lower folders I can then make subsites using containerpages and ADE.
In opencms 13 Page-templates and <csm:editable> DO NOT work anymore as
desired:
The editor buttons in display mode don't work any more : when clicked they
show "Cannot be created or edited"
And when I delete the .content directory or add my xml-content types to the
/sites/default/.content/config then when I create a new xml-content opencms
will suggest to place it by default in the .content directory , what I did
not had and do not want.
Alkacon :
1. Will you continue to support a design where at least a part of the
pages is generated using Page-templates and <cms:editable> ? ( It is never
declared deprecated, but the new documentation with opencms 14 does an
excellent job in hiding this design possibility.)
2. What is the preferred way to keep Page-templates and <csm:editable>
working as it was ?
3. Will you keep hiding this solution, which some of your users still
consider the best design?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opencms.org/pipermail/opencms-dev/attachments/20221119/8e59335f/attachment.htm>
More information about the opencms-dev
mailing list