Website Downloads Documentation Knowledgebase Wiki Issue tracker Commercial support

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

  1. Copy the entire document-to-html.xsl file to and change the appropriate value in the insertImage template
  2. 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

  1. 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
  2. copy <wikidata dir>/resources/skins/default/xslt/document-to-html.xsl  to your skin  <wikidata dir>/resources/skins/yourskin/xslt/document-to-html.xsl
  3. Edit document-to-html.xsl.
  4. Find the section <xsl:template name="insertImage">
  5. Change the image width value on the line
    <xsl:when test="$imageWidth > 801 and $linkInfo/p:linkPartInfo[@name='ImagePreview']">
  6. restart the daisy wiki

Create a new document-to-html.xsl

  1. 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
  2. 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">
  3. Next, import the default document-to-html.xsl
    <xsl:import href="wikidata:/(webapp)xslt/document-to-html.xsl"/>
  4. Then copy the insertImage section from <wikidata dir>/resources/skins/default/xslt/document-to-html.xsl and insert
    <xsl:template name="insertImage">
    ...
    ...
    </xsl:template>
  5. 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

Comments (0)
Advertisement

Daisy hosting, installation, support. Workshops and turnkey Daisy CMS projects. Get Daisy from its creators.

outerthought.org

Downloads provided by

SourceForge.net Logo

Open source stats