Displaying Full Size Images
Overview
Images embedded into a Daisy Page display full size in editing, but when they are saved, the display as a preview, with a link "Click to enlarge".
The default Daisy installation only displays full size images if the width is under a default value (at time of writing this was 650px). If the images is larger, it displays a preview with the "Click to enlarge" link.
This behavior is defined in the document-to-html.xsl, and can be overwritten in the skin
Basically, we are creating a new document-to-html.xsl inside the skin and changing the Maximium width value. Ths can be done two ways
- Copy the entire document-to-html.xsl file to and change the appropriate value in the insertImage template
- Create a new document-to-html.xsl file with only an import of the default document-to-html.xsl and the overridden insertImage template
Procedure
copy the entire document-to-html.xsl
- Check if <wikidata dir>/resources/skins/yourskin/xslt exists (where yourskin is the name of the skin you are using ). If it does not exist, create it
- copy <wikidata dir>/resources/skins/default/xslt/document-to-html.xsl to your skin <wikidata dir>/resources/skins/yourskin/xslt/document-to-html.xsl
- Edit document-to-html.xsl.
- Find the section <xsl:template name="insertImage">
- Change the image width value on the line
<xsl:when test="$imageWidth > 801 and $linkInfo/p:linkPartInfo[@name='ImagePreview']">
- restart the daisy wiki
Create a new document-to-html.xsl
- Check if <wikidata dir>/resources/skins/yourskin/xslt exists (where yourskin is the name of the skin you are using ). If it does not exist, create it
- edit document-to-html.xsl. Put in the following for the header:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:d="http://outerx.org/daisy/1.0">
- Next, import the default document-to-html.xsl
<xsl:import href="wikidata:/(webapp)xslt/document-to-html.xsl"/>
- Then copy the insertImage section from <wikidata
dir>/resources/skins/default/xslt/document-to-html.xsl and insert
<xsl:template name="insertImage"> ... ... </xsl:template>
- Change the line to have the appropriate width for full-size images.
<xsl:when test="$imageWidth > 801 and $linkInfo/p:linkPartInfo[@name='ImagePreview']">
Notes
The preview behavior can also be modified in the <daisydata>/conf/myconfig.xml in the ImagePreSaveHook section ( the above method is the more appropriate).
In the section on <previewMaxSize>250</previewMaxSize>. When an image is loaded, if it is under this width (and under this height???) the real image will be used for the preview instead of generating a preview. Likewise for thumbnails modify the value <thumbnailMaxSize>125</thumbnailMaxSize>
References
Full reference on the "daisyskin" and "wikidata" schemes: http://cocoondev.org/daisydocs-2_0/374-cd/25-cd/192-cd.html



There are no comments.