trigger-large.jpg

Trigger happy images

By Liam Coltman posted on 23 Aug 2010

What is it?

Image varieties are a powerful tool in MySource Matrix which allow you to set different size constraints for an image to be adjusted when it is uploaded. These different sized images can then be used as smaller preview versions for the real image.

Functionality: Global

Assets used: Image, Trigger

How do I do it?

Craete the trigger

  1. Open the System Management folder in the Asset Map and right click on the Trigger Manager.

    System management folder
  2. Select New Child > Trigger > Trigger *note that you can only create triggers in the Trigger Manager, any other location will cause an error.
  3. Type an appropriate name for the trigger and if you’d like a description.

    Image variety name
  4. In the Events list check the Asset Created tickbox. These events will fire after certain actions are performed in MySource Matrix and provide useful ways to automate processes.
  5. Change the dropdown under Conditions to Asset is of Type and then change the Actions dropdown to Create Image Variety and commit the changes

    Events, conditions and actions
  6. Reacquire the locks on the asset and change the Asset is of Type to Image. Create another condition type for Tree Location. This will allow you to have site specific triggers.

    Selecting the tree location
  7. In the Create Image Variety section give the variety a meaningful name as you will be using this to reference the image in asset listings or paint layouts.
  8. Set the constraints you would like the image set to, this can be whichever sizes you wish. You can also constrain by Height, Width, Both or Neither. This will result in the following:
    1. Height: Once the image hits the specified height constraint it will no longer resize regardless of width.
    2. Width: Once the image hits the specified width constraint it will no longer resize regardless of height.
    3. Both: Once the image hits the specified width OR height constraint it will no longer resize.
    4. Neither: The image will be resized to the exact dimensions specified in height and width.

      Create Image Variety settings
  9. If you would like another image variety simple add another new action type of Image Variety and repeat step 8 as many times as desired.
  10. Once you are finished set the status on the trigger to Enabled.
  11. Upload a new image under the appropriate tree area and expand it and voila! More image varieties than you can poke a stick at.

    Created image variety

If you want to retroactively apply this trigger to the images in your site you can run a batch job from the trigger manager which will allow you to do this.

Run a batch job

  1. Open the System Management folder and right click on the Trigger Manager and select Batching.

    Batching from the Trigger Manager
  2. Acquire the locks and select the node you would like the trigger to run on.

    Selecting the root node for batching
  3. Select the same Event trigger that you used above, Asset Created.
  4. Once you commit the changes a Hipo will run which simulates the images already uploaded to this area being created. If you now expand them you will see that they have image varieties applied.


Comments


There are currently no comments for this article. Why not be the first to post a comment?

Build your own search

By Ladoo posted on 20 Oct 2011

You can create your own personal Search Page to assist with locating and editing the content you look after. This can be especially helpful in larger systems where quick search becomes less accurate.

Output content to a file

By Ladoo posted on 17 Nov 2011

As well as HTML and text, Matrix can be configured to directly output XML, iCal, RTF and even Word and Excel documents, so that users can directly download and work with these files.

Pretty as a picture Image Gallery

By Liam Coltman posted on 13 Nov 2010

Image Galleries can help to add a bit of colour to your website. With a little bit of tinkering you can make an image gallery that will rival the Louvre

Comment all you want

By Liam Coltman posted on 08 Sep 2011

Using a combination of an Asset Builder and an Asset Listing in Mysource Matrix can allow you to create a comment area in your website and can be used for blogs.

Dynamic Asset Listings

By Liam Coltman posted on 14 Aug 2010

Learn how to make you asset listings dynamic so they can be reused across multiple pages on your site

Paint Layouts

By Liam Coltman posted on 06 Mar 2010

The best way to think of a Paint Layout is a Design File for your page content.

News delivered to your doorstep

By Liam Coltman posted on 10 Sep 2010

With users becoming more and more demanding on their news and website updates RSS provides the perfect option to keep readers up to date with what is happening on your site.

Matrix PHP API - Creating Standard Page Assets

By Anton Babushkin posted on 28 Feb 2011

Using the Matrix PHP API can allow you to do more than you previously would have thought possible. This article will teach you how to create Standard Page assets as well as give you some insight into when you could utilize the PHP API in the real world.

Release notes for Matrix 1.2

By Anton Babushkin posted on 16 Jul 2013

You can create your own personal Search Page to assist with locating and editing the content you look after. This can be especially helpful in larger systems where quick search becomes less accurate.

Search

By Ladoo posted on 23 Feb 2012

Most content management systems only offer basic search functionality, and Matrix is no exception.