(this is really one for the user list)
Hi Ole,
I just did a quite neat integration that is along the lines of what
you talk about.
When uploading an image I have an option to instead give an image
reference that when received on the server goes and fetches the image
from an image library. The integration was not very hard - I found the
hooks I needed in
info.magnolia.module.admininterface.dialogs.ParagraphEditDialog and
info.magnolia.cms.gui.dialog.DialogFile.
and made my own dialog with special control as such:
public class ImageLibraryLoadingParagraphEditDialog extends
ParagraphEditDialog {
...
}
public class ImageLibraryDialogFile extends DialogFile {
...
}
As for image resizing there's an incredibly neat tag in the utility
tag library (cmsu below). Consider this snippet from my templates
(somewhat simplified):
<c:set var="imageurl">
<cmsu:scaleImage parentNodeDataName="image"
imageContentNodeName="sizeW300"
maxWidth="300"/>
</c:set>
<cms:setNode var="imagedata" />
<img src="${pageContext.request.contextPath}${imageurl}"
alt="${imagedata.imageAlt}" />
This automatically resizes my image (stored as 'image') to a width of
300 and stores it back into the data node (under the name 'sizeW300').
What's even better is that it only does the resizing if it notices
that it has to. Hence I can have a page with hundreds of these images
and it will load in seconds and only rescale one if I update it.
Martin
On 2 Dec 2008, at 20:35, Ole Christian Rynning wrote:
I am currently in a very early stage evaluating Magnolia.
I need to import and manage several thousands of product images with
the WCMS/DMS. Typically the images are large jpgs, pngs, gifs and
pdfs. When importing I wish to automatically resize the image into
three sizes: thumbnail, product and large (+ full).
For this I wish to to develop a module/template that:
A) Automatically resizes the images and stores them into the DMS
i.e. under images/products/name-{thumb,small,large,full} upon upload/
import.
B) A template that allows the editor to navigate the DMS by
thumbnails, and insert images with selected size.
Can anybody give me some general pointers for how to do this (the
magnolia-way!)?
Best regards,
Ole Christian
----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <[EMAIL PROTECTED]>
----------------------------------------------------------------