Re: error validating authoring html code
| Newsgroups | gmane.comp.cms.wyona.user |
|---|---|
| Message-ID | <[email protected]> |
Hi Michael,
thanks for your response. I've figured out another possibility which
could also be an appropriate solution.
The idea is to use the mode-attribute in the template-tags.
Here the file ../Page/container.xsl with the required modifications:
<snip>
<xsl:variable name="container_header"> <!-- *** container header: style part
of live content -- >
<link rel="stylesheet" href="{$context_prefix}/live/default.css"
type="text/css"/>
</xsl:variable>
<xsl:template match="Container"> <!-- *** live content -->
<html> <!-- *** complete html structure -->
<head>
<xsl:call-template name="makeTitle"/>
<xsl:copy-of select="$container_header" /> <!-- *** container header -->
</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0"
marginheight="0"><xsl:attribute name="background"><xsl:value-of
select="$image_root"/><!--<xsl:value-of
select="//meta/images/@id"/>--><xsl:value-of
select="//meta/images/@basename"/>/background.gif</xsl:attribute>
<xsl:apply-templates select="parentchild"/>
</body>
</html>
</xsl:template>
<xsl:template match="Container" mode="authoring" > <!-- *** mode authoring
without html-header -->
<xsl:apply-templates select="parentchild"/>
</xsl:template>
<xsl:template match="Container" mode="edit" > <!-- *** mode edit without
html-header -->
<xsl:apply-templates select="parentchild"/>
</xsl:template>
<xsl:template match="parentchild"> <!-- *** remaining live
content -->
<table Name="maintable" Border="{$tborder}" bgcolor="#{$pagecolor}"
Cellspacing="0" Cellpadding="0" Width="745" Height="214">
...
</snip>
Introduce the mode-attribute in following files:
- ../Authoring/main.xsl
<snip>
<xsl:template match="body">
<xsl:apply-templates select="Container" mode="authoring"/> <!-- *** mode
attribute authoring -->
</xsl:template>
</snip>
-
webapp/wyona/cms/pubs/ANY-PUB/stylesheets/wyona/cms/edit/Page/Edit/root_html_form_editor.xsl
<snip>
<body bgcolor="#ffffff" onload="return fnOnLoad()">
<xsl:apply-templates select="body" mode="edit" /> <!-- *** mode attribute
edit -->
</body>
</snip>
Moreover, rename 'cmsbody' to 'body' in
webapp/wyona/cms/pubs/ANY-PUB/authoring-sitemap.xmap
e.g.
<snip>
<map:match pattern="authoring/**.xhtml.source">
<map:aggregate element="wyona">
<map:part src="cocoon:/standard/t01/menu/generic/{1}"/>
<map:part src="cocoon:/container/authoring/{1}.xhtml" element="body"/>
<!-- *** body instead of cmsbody -->
</map:aggregate>
<map:serialize type="xml"/>
</map:match>
</snip>
(I have to admit that I don't know why the element was called
'cmsbody' instead of 'body'. However, this way it seems to me more
understandable...)
Rename 'cmsbody' to 'body' also in file
webapp/wyona/cms/stylesheets/cms/Page/root.xsl.
Introducing the variable 'container_header' which is defined in container.xsl
allows to include live-specific stylesheets into authoring.
<snip>
<xsl:template match="wyona">
<html>
<head>
<title>Authoring</title>
<style type="text/css">
<xsl:comment>
.awyona {
color: #0066FF;
text-decoration: none;
}
.awyona:visited {
<!--color: #669999;-->
color: #0066FF;
text-decoration: none;
}
</xsl:comment>
</style>
<xsl:copy-of select="$container_header"/> <!-- *** add header of live
content (defined in container.xsl) -->
</head>
<body bgcolor="#ffffff">
<xsl:apply-templates select="menu"/>
<xsl:apply-templates select="body"/>
</body>
</html>
</xsl:template>
</snip>
The modifications in root.xsl cause failures if publication specific files
are not updated (i.e. if the variable container_header is missing)!
Actually I don't work with xopus - probably also main_xopus.xsl has
to be modified according to the lines mentioned above.
However, my own pub works fine with that changes.
Any comments? Any problems which I don't see yet?
Best wishes
Jürgen
--------------------------------------------------------------------
Quoting Michael Wechner <[email protected]>:
>
>
> [email protected] wrote:
>
> <snip/>
> > May be i am picky :-)
>
>
> no, you are not picky, we were just to lazy to better organize
> the XSLTs ;-)
>
>
> > ... but isnt it possible to produce nice html also
> > for the authoring area?
> > As far as i can see that would require some modifications in some
> > xsl-files, e.g. container.xsl. What do you think?
>
>
> That's right. The "only" difference between Authoring and Live
> is that Authoring has the menu. The publication specific XML is wrapped
> as follows
>
> <wyona:page>
> <wyona:menu>
> ...
> </wyona:menu>
> <wyona:body>
> publication specific XML
> </wyona:body>
> </wyona:page>
>
> I think there are two possibilities to resolve this issue:
>
> 1) We also wrap the Live part (my favorite) and dismiss the "root
> template" of the publication specific XSLT.
> 2) We use another "root template" for the publication specific XSLT
> within the authoring are
>
> In the end the question remains (well, kind of): "If somebody is
> building a publication on XML and XSLT independently of Wyona, how can
> we afterwards wrap around Wyona?"
>
> Any thoughts or suggestions?
>
> All the best
>
> Michael
>
>
>
> >
> > Very best wishes
> > Jürgen
> >
> >
> > -------------------------------------------------
> > This mail sent through IMP: http://horde.org/imp/
> >
> >
> > _______________________________________________
> > WyonaCMS-users mailing list
> > [email protected]
> > http://mail.wyona.org/cgi-bin/mailman/listinfo/wyonacms-users
> >
>
>
-------------------------------------------------
This mail sent through IMP: http://horde.org/imp/