postbox
E-Commerce module released under GPL
Posted on 05 Jan 2009 10:05pm by Aleks Bochniak
Today the E-Commerce model was released under the GPL version of MySource Matrix 3.20.0. Other modules such as Bulkmail, Calendar and Search were also included from the SSV version and distributed under the GPL.
This is an important release for MySource Matrix GPL users, as we now have the ability to create more dynamic websites using this new release. I have been testing 3.20.0 RC1 for about a week now, and I am quite pleased with it. The 3.20.0 stable release is even better with more bug fixes and features added.
Some additionals features of particular interest to me are:
- Hipo Herder: Resume jobs in new window
- Clear Matrix Cache: Multiple Root Nodes
- New re-cache suffix
- Metadata Value Cascading
- Simple Edit Layouts applied by Root Node
- Multi-Page Forms
- Log In as another user (Troubleshooting Tool)
- New Global Keyword for HTTP POST variable replacements
- The name of the user that committed each asset version is now shown on the asset "History" screen
Most of this features have been required for quite some time, and it's good to finally see them released. Details about each of those features can be seen in the changelog.
Over the next couple of weeks I am going to add more content to this website, as well as a demonstration of the e-commerce module. I've been toying with the idea to see how possible it is to use paypal as a payment gateway, so keep an eye out for that too.
Where are the photos?
Posted on 19 Aug 2008 9:55pm by Aleks Bochniak
In case you were wondering where my travel photos disappeared to, I have decided to buy a Pro account an Flickr and upload my latest photos there. The main reason for this is the fact I haven't developed an image gallery for MySource Matrix yet, and that the iWeb templates I was using are too bulky and cumbersome.
So if you feel like taking a look, wander your way to my photostream. There is also a link to my flickr profile in the right hand column.
Btw, I've also upgraded to 3.18.4, installed a php accelerator and tweaked postgres and my cache settings. Hopefully this site is a little bit snappier now ;-)
Enabling MySource Matrix cache
Posted on 21 May 2008 3:08am by Aleks Bochniak
By default MySource Matrix comes shipped with caching turn off. Squiz recommend in their documentation that to increase performance, caching should be enabled for your sites. To do this, you will need to access the Cache Manager in System Management via the Asset tree. The Cache Manager allows you to turn on caching as well as set the default expiry time.
The number of cache buckets allows you to set the file system directories to use for caching. If you set a low number, each directory will hold a large number of files which may reach operating system limits. If you set the number too high, each directory will hold a small number of files which may be inefficient.
The default expiry length (seconds) is 86400 (24h). For my site I have changed this to 604800 seconds (one week), as I don't post very often. I have also enabled Public Level, Permission Level and Group Level caching. More information about these options can be found in the System Administrator manual on Squiz's documentation website.
When an asset is updated the cache is not automatically cleared until the expiry time has been reached. To get around waiting for changes to appear on your site, you can create a Trigger to automatically clear the cache for an asset that has been updated.
Trigger to clear cache
Under the Trigger Manager (under System Management in the Asset tree), create a child asset of type Trigger named 'Clear cache on update'.
Set the following options:
Details
- Status: Enabled
Events
- Asset Updated
Conditions
- Nil
Actions
- Clear Matrix Cache
Ignore Permissions
Include Current Asset? Yes
Level Selected assets and their dependants
- Clear Matrix Cache
Ignore Permissions
Include Current Asset? Yes
Level Selected assets and their children
The dependants of an asset are those that cannot exist without that asset. For example, the Page Contents asset of a Standard Page. The children of an asset are those that have been created underneath it in the hierarchy.
What this Trigger will do is clear the cache for any asset that has any of the attributes listed in Events updated. The cache for Asset Listings and Paint Layouts which list/nest other asset types will not be automatically cleared with this trigger. That is one exercise for you to figure out for yourself.
Upgraded MySource Matrix to 3.18.0
Posted on 23 Apr 2008 9:11pm by Aleks Bochniak
Finally after much drama of upgrading from Ubuntu Dapper to Edgy, then to Feisty, and then to Gutsy. I now have a working MySource Matrix 3.18.0 installation running on php5. woot
Now, I will go have a play and see what all the fuss is about. CAPTCHA on Asset Builders here I come!
How to make a tag cloud
Posted on 22 Jan 2008 9:39pm by Aleks Bochniak
Tag clouds or 'tagging' has been around used the web for a couple of years now, it's not relatively new or unique. However, using tags and/or tag clouds on your web-site can add value to your content and be beneficial to your users.
What is a tag cloud exactly? Wikipedia has a good definition. A simple example is just to your right in the side column under the heading 'Tags used'.
Creating one of these can be a little tricky in MySource Matrix, especially the GPL version (no lovely search module here). Since we can't use php code in our pages, we have to use javascript to do the hard work for us.
Some clarification
There are 3 different ways to tag a page or asset with terms. One way is to create a lexicon of terms in a thesaurus and use the tagging screen to select these terms, however it's not possible to print out which terms are used on the front-end and their associated weighting. Kind of disappointing really.
The other two ways involve metadata. One using a thesaurus as a metadata field type, or using a multiple text field type. I prefer the multiple text option, as it allows me to enter free text as terms and removes the hassle of maintaining a definitive list separate to my content.
Building the cloud
First thing we need to do is to create a metadata schema with a default section and one metadata field called 'tags' of type "multiple text field".
Secondly create a few pages in a folder, apply our metadata schema and tag some terms. I have a few dummy pages which I have tagged with some latin text.
Below is part of a screenshot of one page's metadata screen.
Next we need to create an asset listing page called 'tag cloud' to find all the pages in the folder. Nothing tricky needs to be defined for the asset listing, just the types of assets to list "Standard Page" and root node; being your folder.
I would suggest for all the divs created and used in this example be of type "Raw HTML" and style "Raw HTML". On the Type Formats -> Default Format page contents enter the following without trailing spaces:
%asset_metadata_tags%;
This tag should spit out something like (with the semicolon at the end):
lorem; lipsum; consectetuer; platea; nunc; morbi; mauris; venenatis; donec; primis; nulla; leo id; morbi; arcu; nunc; aliquam; mollis; elementum; commodo; nulla; tristique; pretium; ultrices; lorem; nunc; ultrices; leo; accumsan; nulla; condimentum; cursus; quam; posuere; curae; ipsum; primis; lorem; leo id; nulla; ultricies; libero; loboritis; non; ante; morbi; tristique; senectus; pellentesque; aliquet; curae; nonummy; nulla; suscipit; magna; lorem; purus; sapien; cras; ligula; iaculis; suscipit; commodo;
Now we need some javascript to split that long string into an array of unique terms, ordered alphabetically and their frequency counted.
Javascript comes to the rescue
In my Design I am importing a javascript file which contains 3 functions that help sort the array of terms and assign a css class to the tag link.
function unique(x) {
tmp = new Array(0);
for(i=0;i<x.length;i++) {
if(!contains(tmp, x[i])) {
tmp.length+=1;
tmp[tmp.length-1]=x[i];
}
}
return tmp;
}
function contains(x, e) {
for(j=0;j<x.length;j++) {
if(x[j]==e) {
return true;
}
}
return false;
}
function getTagClass(z) {
var tagClass = "smallestTag";
if(z==smallest) {
tagClass="smallestTag";
} else if(z==largest) {
tagClass="largestTag";
} else if(z >= large) {
tagClass="largeTag";
} else if(z <= large && z >= medium) {
tagClass="mediumTag";
} else if(z <= medium && z >= smallest) {
tagClass="smallTag";
}
return tagClass;
}
In the Page Contents of the 'tag cloud' asset listing page, we need to pull in the list of tags with the %asset_listing% keyword and assign it a javascript string for processing. This string then needs to be split into an array, duplicates removed and sorted alphabetically.
<script type="text/javascript">
<!--
var a = '%asset_listing%';
var split = new Array();
split = a.split('; '); //string to array
var unique = unique(split);
unique.sort(); //sort alphabetically
We also need to find the number of times (frequency) a tag term is being used so we can assign a font size (with a css class) to it.
var frequency = new Array();
var counts = new Array();
var largest = 0;
var smallest = 1;
/* create array of tag counts and find sizes */
for(var i=0; i<unique.length-1; i++) {
var mullet=0;
unique[i] = unique[i].replace(/^\s+|\s+$/g, '') ;
for(var j=0; j<split.length; j++) {
if (unique[i]==split[j]) {
mullet=mullet+1;
}
frequency[i] = mullet;
}
}
Now, we need to do some simple maths to find the largest times a term has been used, the medium value, distribution and difference. The size of the tags will be from the smallest (1) to the largest (we still need to find it!).
for(var d=0;d<frequency.length;d++){
largest=Math.max(largest,frequency[d]); //find largest
}
var diff = largest-smallest; //difference, smallest is always 1
var dist = diff/3; //distribution
var large = 1 + (dist*2);
var medium = 1 + dist;
The following code is used to write out a paragraph with the tags linked to Google blogsearch, and style the link with their relevant size.
/* continue */
if(unique.length != 0) {
document.write('<p id=\"tags\">');
for(var i=0; i<unique.length-1; i++) {
var z=0;
for(var j=0; j<split.length; j++) {
if (unique[i]==split[j]) {
z=z+1;
}
counts[i] = z;
}
var size = getTagClass(z);
document.write('<a class=\"'+size+'" href=\"http://blogsearch.google
.com/blogsearch?q='+unique[i]+'\">'+unique[i]+'</a> ');
}
document.write('</p>');
}
//-->
</script>
So, that's basically it. There are probably a few ways to optimise the code and behaviour, but that's an exercise to come later when I have time. As a quick start it works very well.
Above is a image of a tag cloud I created using this code.
Displaying 5 of 6 articles






