> Hi, > > I seem to be unable to insert images into the Default publication > of a lenya 1.2.x SVN checkout from about 2 weeks ago. > > In Kupu, I have the choice between left, right and inline, but > neither as any effect - after saving, the image has no class- or > align-attribute. > > In BXE, the image object has a lot of attributes, but again > neither class nor align. So again, no chance to align it somehow. > > Am I doing something wrong? The wish to align an image seems > rather basic to me, so I am puzzled... > > Have a nice weekend
Yeah, I found this out the hard way myself. Here's what I did to fix it: 1. Go to lenya/resources/kupu/apache-lenya/lenya/ and edit the file kupusave.xsl. You should see a chunk like the following: <!-- this template converts the img tag to object for more, see http://www.xml.com/pub/a/2003/07/02/dive.html --> <xsl:template match="xhtml:img"> <object> <xsl:attribute name="data"> Towards the bottom, you'll see a couple of <xsl:if> statements for the attributes @height and @width. Copy one of them as a template and replace it with @class. So your bottom section will look like this: <xsl:if test="string(@height)"> <xsl:attribute name="height"> <xsl:value-of select="@height"/> </xsl:attribute> </xsl:if> <xsl:if test="string(@width)"> <xsl:attribute name="width"> <xsl:value-of select="@width"/> </xsl:attribute> </xsl:if> <xsl:if test="string(@class)"> <xsl:attribute name="class"> <xsl:value-of select="@class"/> </xsl:attribute> </xsl:if> Save the file. 2. You'll see something similar in a file called content2edit.xsl, which is in the same directory as number 1. Make the same change by adding in a check for the class attribute. Save. 3. Lastly, you'll need to go into each publication you have and edit the file xslt/xhtml2xhtml.xsl. Take a look at the patch of XSL that starts like this: <xsl:template name="object2img"> <img border="0"> <xsl:attribute name="src"> <xsl:choose> <xsl:when test="not(starts-with(@data, '/'))"> First off, I like removing the border="0" attribute from the image tag above. I don't like the assumption that it needs to be there. I just like assigning a class to the image and assuming that the CSS will handle whether or not a border exists. Secondly, just like you did with the above two points, add a new section for @class. You can copy one of the <xsl:if> statements from @height and @width as templates. Save. Now you're all set to have classes assigned to your image when you save out of Kupu (and presumably Bitflux). If you don't like the default class names that Kupu uses, then you can go into the files lenya/resources/kupu/common/kupubasetools.js and lenya/resources/kupu/common/kupudrawers/drawer.xsl and search for the default class names of "image-left", "image-right", and "image-inline" and replace them with whatever you choose. Be sure to add the classes you create in your CSS so that they float properly and have the appropriate styles. Hope this helps! Jon
<<winmail.dat>>
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]