Squiz Matrix for iOS Beta 1 Released

Today saw the release of Squiz Matrix iOS beta 1. This is the first round of beta testing for all users that signed up.

  • Beta
  • Beta

The beta version includes the following features.

Features:

  • Add multiple site configurations
  • Asset Map Browsing
  • Status Colors
  • Importing of files in app
  • Management of Imported Files
  • Asset creation of selected assets
  • Asset creation from imported files
  • Viewing of selected asset screens
  • Asset Details
  • Viewing/changing Asset Status
  • Viewing/changing Asset Attributes
  • Viewing/changing Asset Metadata
  • Viewing Asset Webpaths
  • Preview Assets including all file types
  • Asset Map sorting
  • Deleting of assets
  • Pull to refresh

Squiz Matrix 3.28.0 is required.

Note: Since this is a beta there will be issues, things not finished, and bugs. Make sure you contact us with any of these issues that you might find.

Interested in Helping Out?

You can still be a tester! Sign-up below.

Squiz Matrix for iOS: An Update

I just did a guest blog over on the Squiz Advocate blog about the status of my Squiz Matrix iOS app. Head over there to read the full post:

Squiz Matrix for iOS: An Update, on the Squiz Advocate Blog website

iOS Beta Testers Wanted!

As time gets closer to some of our iOS app releases we are looking for individuals who are interested in being Beta Testers! Those special people will have a chance to play with beta versions as well as have input on new features and UI.

If anyone is interested we would be very grateful. Just follow the button below to come on board.

Using Complex Keyword Modifiers in Squiz Matrix to Solve Problems

4 months ago by Nicholas Hubbard in #PUC #Matrix

Today I was working on creating a .ics file for Pacific Union College and I ran into a problem. Because I wasn't using an asset listing (using a Rolling Calendar Page) I wasn't able to use conditional keywords in order to change some of my output.

The problem was, iCal files are picky. They have to validate just like an RSS feed would. The DTSTART property must be printed differently if it doesn't contain a time. I wanted to check the results of a keyword to see if it didn't contain a time, which shows up as --:--:--. I also needed it to write some extra text if it didn't contain time. Here is what I came up with:

%asset_attribute_start_date^contains:--^replace:3:;VALUE=DATE^replace:0:%

Breaking It Down

Here is how this keyword works. It will be printing the date/time in two different ways. Assets that have a time will print like 20110122T111500 while another might just print 20110122, which is without a time. If I don't have a time, I need to also add ;VALUE=DATE, this tells the file it is only a date.

The keyword modifier looks at the result of the asset_attribute_start_date keyword and checks to see if it contains any --, if it does, it will return the number of times it find that, in my case, 3. So, I want to replace that number 3 with ;VALUE=DATE but if it returns 0 (meaning it found nothing) then we just want to replace it with a blank string.

It seems complicated but it actually is really logical and works really well. Very powerful stuff!

I found a bug in Matrix that prevents keyword modifiers from being used on event keywords such as %event_start_time_12h%, so if that had worked there would have been more than one way to accomplish this.

Squiz Matrix Asset Name: Two Ways To Do It

4 months ago by Nicholas Hubbard in #Matrix

One thing that people might not realize is that asset names can be printed in two ways. The first converts the ampersand into HTML entities and the second one does not. Both cases are useful for their own purposes.

%asset_name% 

// This automatically turns & into &
// This is always useful when printing for HTML
%asset_attribute_name% 

// This will NOT convert & to &
// This can be used if you are creating a different format, such as a .csv or .ics file

Squiz Matrix Keyword Modifiers Test Suite

Keyword Modifiers are an extremely powerful feature of Squiz Matrix. They can be be used almost everywhere in the system and provide a great deal of keyword customization.

If you have never used keyword modifiers before give it a try, you can even modify they keyword yourself to see how to use it!

Test Keyword Modifiers

See how it works

Try It Yourself

Console Output

$test:

Note: Some of the keyword modifiers don't seem to work correctly when parsed with the JS API such as the data keyword.

In a future post I will talk about complex keyword modifiers which allows you to combine modifiers and use complicated modifiers such as xpath: and xslt:.

Change the Asset Map Sort Order Using Javascript in Squiz Matrix

In a past project I needed a way to change the asset map sort order by dragging items in an asset listing. I figured that it had to be possible, so with a little bit of javascript I wrote up the following function.

Hope it helps someone out!

/**
/**
* Changes the sort order of assets in Squiz Matrix
*
* @param number         id              ID of the asset to move
* @param number         parent          ID of the parent that the asset is under
* @param number         new_position    New position of asset (0 is first in the sort order)
*
* @return string
* @access public
*/
function changeSort(id, parent, new_position) {
        var host_url = location.protocol+'//'+location.host+'?SQ_ACTION=asset_map_request';
        var link_id;
        
        // Construct our XML to send
        var xml_get = '<command action="get assets"><asset assetid="'+parent+'" start="0" limit="150" linkid="10" /></command>';
        
        $.ajax({
                url: host_url,
                type: 'POST',
                processData: false,
                data: xml_get,
                contentType: "text/xml",
                dataType: 'xml',
                success: function(xml) {
                        $(xml).find('asset').each(function() {
                                if ($(this).attr('assetid') == id) {
                                        link_id = $(this).attr('linkid');
                                        $.ajax({
                                                url: host_url,
                                                type: 'POST',
                                                processData: false,
                                                data: '<command action="move asset" to_parent_assetid="'+parent+'" to_parent_pos="'+new_position+'"><asset assetid="'+id+'" linkid="'+link_id+'" parentid="'+parent+'" /></command>',
                                                contentType: "text/xml",
                                                dataType: 'xml',
                                                success: function(xml) {
                                                        //alert(xml);
                                                }
                                        });//end ajax
                                        
                                }//end if
                                
                        });//end each
                        
                }//end success
                
        });//end ajax
        
}//end changeSort()

Remember, this function requires jQuery.

Using the JS API Enhanced Mode in Squiz Matrix

The new Squiz Matrix JS API asset was just released with a great new option, Enhanced Mode. This allows for jQuery like methods for a much more object oriented style of doing things. The great thing is that you don't have to pass all of the parameters like the old version of the API, only the ones that are required and ones you want.

Test Functions

See how it works

Console Output

$test:

Javascript

// Code goes here

There are many more API methods that require more than read access, but those are out of the scope of this post.

PUC Website Moves to a VM in the Cloud

6 months ago by Nicholas Hubbard in #PUC #Matrix

The Pacific Union College website had a problem. Our servers were nearing 5 years old, both of them out of warranty and feeling very slow with aging hardware. Our version of Squiz Matrix was 3.24.3, a version which came out on December 7, 2009. I had patched in a few of the newer features of Matrix such as more SOAP methods and JS API methods, but it was starting to feel like a patchwork of old version code and a bit of new code for added functionality. We were in need of an upgrade badly, but we could not afford to have Squiz do the upgrade for us. I know that they would have done a wonderful job, but we just didn't have the money. So, we made the decision to move the PUC website over to a VM on our internal cloud. This would allow us the flexibility of a VM and the power of the cloud.

  • Listing

The migration took a few days of planning including writing out all of the upgrade steps that would be needed and finally doing a number of test upgrades from our backup files. We ran into many issues during testing, but lucky for us we were just in the testing and documenting state, so each error or issue we had was good news because we could figure out what was wrong then write down those steps so we wouldn't have the same issue next time.

Once all testing and steps had been completed we implemented an editing freeze and used our most recent backup file. The entire upgrade from 3.24.3 to 4.4.0 took the better part of the day, but by 4:00pm we were ready to move over from our physical servers to our finalized VM of Squiz Matrix 4.4.0. Everything went fairly smoothly, just a few forgotten steps and a script that needed to be ran here or there, but for the most part it was very easy and extremely successful.

I would have to say the most wonderful thing about being on a VM now is that we can easily take a quick snapshot of the system, then move on to upgrading to the most recent version. Since 4.4.1 had come out we decided to make the quick upgrade to make sure that we were completely up-to-date. Again, the process was painless thanks to the Automatic Upgrade scripts.

All in all it was a very successful migration and we are extremely happy with our decision to move to a VM. Look for puc.edu 3.0 coming in the future.

Understanding the Power of list_current_asset_id in Squiz Matrix

6 months ago by Nicholas Hubbard in #Matrix

The list_current_asset_id feature of Squiz Matrix has always been somewhat complex and confusing to understand and setup correctly. It is extremely powerful and helps eliminate common problems such as attaching a thumbnail to an asset or printing out child asset info in an asset listing. Here I want to provide an easy to follow tutorial on how exactly to use this feature and why you would want to use it.

For some reason list_current_asset_id is still an undocumented feature on the Squiz Matrix Manuals website.

Why Use?

The main reason that I love using list_current_asset_id is because I like to be able to store images in relation to the asset that they will be used in. So, if I have a Standard Page Asset that includes images in the markup I don't always want to store those images in the Media Folder or elsewhere because I feel there is a disconnect between the content that is associated with that page (others might feel different about this, that is fine). Using an Asset Listing Page you can list the contents and attributes of your Standard Page assets, but how are you going to show the image that is a child of the Standard Page? That is where list_current_asset_id comes into play.

  • Listing

As you can see, I have structured each one of my pages with images as children assets. Currently my Image Assets are TYPE_1 links. If you structure is going to show in a navigation you might want to switch them to TYPE_2.

  • Asset Map

1. Parent Asset Listing

Continuing from the example above, create a new Asset Listing Page, this will be our "Parent" asset listing. Setup your asset listing like the following:

  • Asset Types to List: Standard Page
  • Asset Statuses to List: Live
  • Root Nodes: Leave blank if assets are children of asset listing
  • Direct Links Only: Yes (makes things faster when listing)

2. Child Asset Listing

This is where the magic happens, the child asset listing. Create a second Asset Listing Page. This can be created outside of your site or where ever you like since it will not be viewed directly. Create this new Asset Listing Page then configure it will the following:

  • Asset Types to List: Image
  • Asset Statuses to List: Live
  • Root Nodes: Your site asset
  • Direct Links Only: Yes (makes things faster when listing)
  • Dynamic Parameters: Replacement Root node for the listing: list_current_asset_id
  • Dynamic Params

In the default format asset of this child asset listing you can place the code to print out your image:

<img src="%asset_url%" height="%asset_attribute_height%" width="%asset_attribute_width%" alt="Your image" />

3. Hooking the two together

Next you need to edit the default format asset of your parent listing. Create a new Nested Content div. Once that has been created, nest your Child Asset Listing. Preview the parent asset listing and you should now see all of your child images listed along with any other additional keywords you might want to add, just make sure to create another RAW HTML div to add these keywords in.

  • Dynamic Params

Conclusion

Using list_current_asset_id is extremely powerful but you have to know how to use is properly and get the setup right. There are many more powerful things you can do with this, we have just scratched the surface of what it can do. If you want to see the working example take a look at the apps and projects pages, both of which are using list_current_asset_id.

Just remember, it takes two asset listings. Good luck!