[daisy] Query for pictures including the Preview-Image?

Paul Focke paul at outerthought.org
Thu Jul 31 08:35:45 CEST 2008


Júlio

The Query
Checking if a part exists will have to be done in the query. This can be
done by using the HasPart condition. In most cases (definately not all)
you could be safe to assume that a preview part exists for an image.
This part is added automatically by the image presave hook. If there are
other images document types that also need previews then I suggest you
look in the myconfig.xml to see how this is configured.

The Styling
If you want to check the existence of a part in the query styling then
you have to give the styling something to work with e.g. the file size.
You could also check that the filesize identifier is available by
checking the titles of the query result.

Tip of the day
You might consider using the link transformer for referencing documents
& parts
http://cocoondev.org/daisydocs-2_2/374-cd/g1/274-cd.html

Paul

On Wed, 2008-07-30 at 23:30 +0100, A Rocha Webmaster wrote:

> 
> NB I am still NOT checking whether the part exists; my knowledge doesn't
> stretch that far.
> 
> Daisy experts: how can I test whether the part exists before I make an
> <img src> link to it? In another query style, I am forcing the user to
> include the part size in the query, and then link only if the part size
> is greater than zero... very lame.



More information about the daisy mailing list