Asset Manager plug-ins?

67 views
Skip to first unread message

Hels Bells

unread,
Nov 22, 2011, 5:22:22 AM11/22/11
to RedDot CMS Users
Hi all,

I'm looking for an improved way for our editors to easily edit a photo
gallery. Current method is the bog standard way :

- Template A has a container that allows creation of pages from
Template B
- Template B has 2 image elements - one for the main and the other for
the thumbnail

Template B's images reference different folders (one for the large and
one for the thumbnails)

I'd like a way to automatically create thumbnails from the main image
and store it within the thumbnail's asset manager folder. The image
editing within Asset Manager works fine but results in the editors
having to go through a number of steps which I know they will probably
get wrong!

I'm well aware of the very simple alternative of using an attribute
element referencing the main image but due to creative the thumbnail
image has to be 77x77 which isn't possible (unless anyone knows how to
add in more options here ???)

Before I start reinventing the wheel just thought I'd see if anyone
else has done anything similar with a plug-in?

Thanks in advance
Helen

Jian Huang

unread,
Nov 22, 2011, 10:32:33 AM11/22/11
to RedDot CMS Users
Hi Helen,

Yes, there is a solution, and it is a slight extension of what you
have mentioned.

Thumbnail image placeholder references Full image placeholder.

Thumbnail image placeholder has placeholder setting of automatic image
resize (it is done via ImageMagik on server side) to your desire
width.

You will then ask, "Then for each of these image module pages, I will
have to manually reference the images?"

Answer: yes, unless you have a plugin that retroactively references,
and automatically reference on page open, both I had written. Please
let me know if the solution works for you. If so, we can talk about
delivery of the plugin.

Best,

-Jian

VegeJuice

unread,
Nov 22, 2011, 11:50:22 PM11/22/11
to reddot-c...@googlegroups.com
An alternate solution is to use render tags.

Create the img placeholder (say img_GalleryItem) and set the size for the thumbnail. The images in Asset Manager are sized to full size.

The thumbnail is referenced normally: <img src="<%img_GalleryItem%>" />

For the full sized image just reference it via the render tag code 
<img src="<%!! Context:CurrentPage.Elements.GetElement(img_GalleryItem).GetHtml() !!%>" />. 

If you're referencing the full sized image via a list then you can use:
<img src="<%!! Context:Pages.GetPage(Guid:<%inf_PageGUID%>).Elements.GetElement(img_GalleryItem).GetHtml() !!%>" />, where inf_PageGUID is an info placeholder.

Hels Bells

unread,
Nov 23, 2011, 7:12:03 AM11/23/11
to RedDot CMS Users
Hey thanks guys,

I'm really pleased with the the render tag solution in the case of a 1
full sized to 1 thumbnail image ratio. It works brilliantly!

And sorry Jian I should have made it more obvious that I was aware of
the scaling option but I was trying to not have to use any rql.

However I think I'm going to have to use RQL as in one of our
templates we have a full sized image and 6 other ones of varying
smaller dimensions. As long as I can confirm that the dimensions will
be in the same proportion (so that they scale nicely) then I'm going
to write a plug-in that the user has to activate to copy over the
contents of the main image to the 6 other images.

Jian Huang

unread,
Nov 23, 2011, 1:02:28 PM11/23/11
to RedDot CMS Users
Hi Helen,

Glad you found a solution.

Please note the usage of Elements.GetElement rendertag reduced page
load time and general project performance because the entire page
object need to be loaded into memory prior to element inspection. The
usage is generally not recommended by OpenText Consultant services and
is considered a project red flag.

Also, Element.GetElement has the rendertag cache issue. Sometimes,
when image placeholder is updated, the rendertag still use the cache
placeholder content instead of new content.

RQL: I would probably recommend the other 6 placeholders reference the
original image placeholder, instead of copying the image over 6 times
because reference once and it is done, if copy, then copy operation
needs to be done each time the content changes.

Just want to share my experience and hope other people can avoid the
pitfalls.

Best,

-Jian

VegeJuice

unread,
Nov 24, 2011, 1:07:23 AM11/24/11
to reddot-c...@googlegroups.com
Does Page.GetElementByName() get around the performance issue?

Jian Huang

unread,
Nov 24, 2011, 10:34:25 PM11/24/11
to RedDot CMS Users
Nope. By calling that renderta, the page still get loaded into
memory.

In regular content classes, it is best to stick with regular
placeholders.

-Jian

Hels Bells

unread,
Nov 25, 2011, 7:14:08 AM11/25/11
to RedDot CMS Users
That's really interesting thank you Jian. I would still have to write
some RQL to do the referencing but it works very nicely. I thought I'd
tried it after your initial suggestion and it didn't work but whatever
I did wrong is working now!

I presume it's the same effect for
Context:CurrentMasterPage.Elements.GetElement ??

Jian Huang

unread,
Nov 28, 2011, 4:43:55 PM11/28/11
to RedDot CMS Users
Hi Helen,

Yes, that rendertag too.

-Jian

Reply all
Reply to author
Forward
0 new messages