How to add Facebook – Twitter – Google+ social icons to MySource Matrix

The following code can be used to dynamically create Facebook, Twitter and Google+ social icons in the MySource Matrix content management system.

The code can be added to your template or added to a page (as raw HTML) and then added in as a nested page when needed.

The code outputs this:

MySouceMatrix-SocialIcons1

<!-- Google Plus Javascript -->
<script type="text/javascript">
(function() {
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
po.src = 'https://apis.google.com/js/plusone.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();
</script>

<!-- CSS -->
 <style type="text/css">
.social-links { float: right; margin-right: -30px; }
.fb { float: left; margin-right : 10px; }
.googplus { float: left; }
.googplus > div { display: inline !important;}
.tweet { float: left; width: 95px; }
div[id*="content"] {clear: both;}
</style>
<div class="social-links">
 <div class="fb">
 <script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script>
 <script type="text/javascript">
 document.write('<fb:like layout="button_count" show_faces="false" width="100"></fb:like>')
 </script></div>
 <div class="tweet">
 <a title="Tweet this page" href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal"></a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div>
<div class="googplus">
 <g:plusone size="medium"></g:plusone></div>
 </div>

How to create a Google sitemap.xml using MySource Matrix

The following steps detail how to make a sitemap.xml using MySource Matrix that is compatible with search engines such as Google.

The process involves creating a design and asset listing page.

Please note that if your website contains a lot of pages the asset listing process may be resource intensive and may take a few seconds to load.

Step 1: creating the design

  1. Right-click on where you want to create the design, choose ‘New Child’ -> ‘Design’ then ‘Design’
  2. MySourceMatrix-Sitemap1
  3. Under ‘Design Name’ enter Sitemap and click ‘Apply’ (you may choose another name)
  4. Right-click on the sitemap design and choose ‘Edit Parse File’
  5. MySourceMatrix-Sitemap2
  6. Acquire the lock and paste in the following code
  7. <MySource_PRINT id_name="__global__" var="content_type" content_type="text/xml" />
    <?xml version="1.0" encoding="UTF-8"?>
    <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
    <MySource_area id_name="body" design_area="body" /></urlset>
    
  8. Apply the changes.
  9. Open the ‘Details’ screen for the design and ‘Approve and Make Live’.

Step 1: creating the assist listing

  1. At the top level of your website, right-click and choose ‘New Child’ -> ‘Pages’ then ‘Asset Listing Page’
  2. MySourceMatrix-Sitemap3
  3. Under ‘Page Name’ enter sitemap.xml – it is important that this is the name entered, this is the recognised standard name for a website sitemap.
  4. Click ‘Apply’ to create the asset listing.
  5. Open the ‘Details’ screen, acquire the lock and choose what types of files and pages you want to be included, for example ‘Standard Page’ and ‘Assist Listing Page’
  6. Under ‘Asset Statuses to List’ choose ‘Live’
  7. Under ‘Exclude This Asset’ choose ‘Yes’
  8. Under ‘Root Nodes’ choose the top level of your website.
  9. From here you may also choose assets to exclude
  10. MySourceMatrix-Sitemap4
  11. Apply the changes
  12. Expand sitemap.xml, and then expand ‘Type Formats’
  13. Right-click on ‘Default Format’ and choose ‘Edit Contents’
  14. MySourceMatrix-Sitemap5
  15. Click on the orange edit properties icon then change ‘Presentation’ and ‘Content Type’ to ‘Raw HTML’
  16. Click ‘Apply’
  17. Replace the content with the code below
  18. <url>
    <loc>%asset_url%</loc>
    <lastmod>%asset_updated_short%</lastmod>
    </url>
  19. Click ‘Apply’ to save the changes
  20. Right-click on ‘Page Contents’ and choose ‘Edit Contents’
  21. Click on the orange edit properties icon then change ‘Presentation’ and ‘Content Type’ to ‘Raw HTML’
  22. Click ‘Apply’
  23. Open the ‘Details’ screen for the design and ‘Approve and Make Live’.

 

Step 3: Apply the design to the asset listing page

  1. Right-click on the sitemap.xml asset listing page and select ‘Settings’
  2. Acquire the lock
  3. In the ‘Designs’ section, under ‘System Defined Frontend Design’, use Override’ to select the design created earlier
  4. Apply the changes.

Step 4: Test!

The sitemap.xml should now load using the address of www.yourdomain.com/sitemap.xml

You should now open it and check if it is including everything you need, and make sure it’s not including stuff you dont want – such as folders that you dont want Google to index.

You can go back to the asset listing details page to customise what is and is not included.

MySource Matrix – Content Keyword List

squiz matrix logoMySource Matrix users may be familiar with the ability to use keywords to automatically build content. This feature is particularly helpful when creating asset listings however there is a severe lack of documentation provided by Squiz (the developer) – or an inability to find such documentation.

As such, below is the full list of supported keywords for MySource Matrix.

 

Common Asset Keywords

Keyword Output Version
%asset_assetid% The unique ID of the current asset.
%asset_name%
%asset_short_name%
%asset_type% Type code e.g. page_standard).
%asset_url% Full web address of the current asset.
%asset_name_linked% Asset name linked to asset url
%asset_href% “Web path” of the current asset (i.e. relative href/link).
%asset_thumbnail%
%asset_thumbnail_alt%
%asset_thumbnail_url%
%asset_thumbnail_caption%
%asset_metadata_X%
%metadata_field_X%

Anywhere (global) keywords

Keyword Output Version
%globals_X% A meta-keyword which allows you to list (nearly) any keyword for the current asset. 3.14.5+
%globals_asset_attribute_X% A more specific version of %globals_X% used for asset attributes. 3.14.5+
%globals_asset_attribute_X:Y% A more specific version of %globals_asset_attribute_X% used for listing an asset attribute for the asset ID specified in Y. 3.14.5+
%globals_icon% Asset Map icon of asset type X. 3.24.0RC1+
%globals_site_X% A meta-keyword which allows you to list (nearly) any keyword for the current site. 3.14.5+
%globals_user_X% A meta-keyword which allows you to list (nearly) any keyword for the current user 3.14.5+
%globals_date_X% Prints the current server date and time. Date and time can be formatted by replacing X with a PHP formatted server date/time, for example %globals_date_M% prints the three letter representation of the current month. 3.20.2+
%globals_get_X% Non-array value of a GET variable. 3.14.5+
%globals_pst_X% Non-array value of a POST variable. 3.20.0+
%globals_server_X% Value of PHP Server Variable 3.14.5+
%globals_session_X% Session var. from Matrix sandbox
%globals_cookie_X% Variable from the current user’s cookies. 3.24.0+
%globals_random% Random whole (integer) number.
%globals_random_X_Y% Randomly generated number (X to Y). For example, to generate a random number from 1 to 10 use %globals_random_1_10%. 3.22.0+
%globals_asset_charset% 3.20.6+
%globals_asset_languages% 3.20.6+
%nested_asset_X%
%referring_X% Keyword of referring asset

Keyword Modifiers

Keyword Output Version
%X^Y% Allows the modification of an existing keyword. 3.24.1+
%Y^urlencode% URL encoded version of X. 3.24.1+
%X^uppercase% UPPERCASE version of X. 3.24.1+
%X^charcount% Number of characters in X. 3.24.1+

Less Common Asset Keywords

Keyword Output Version
%asset_created_by_name%
%asset_created_by_assetid%
%asset_created_by_url%
%asset_published_by_name%
%asset_status_changed_by_name%
%asset_status_description%
%asset_status_colour%
%asset_thumbnail_v_X%
%asset_type_icon% Asset Map icon of the current asset. 3.24.0RC1+
%asset_updated_by_name%
%asset_version%
%asset_version_major%
%asset_version_minor%
%asset_version_micro%
%link_target_X% Keyword of the linked asset. 3.24.1+
%link_relation% 3.24.1+
%link_url% The url (or asset) that the link is pointing to 3.24.1+

Date Keyword

Keyword Output Version
%asset_created_X% PHP formatted date the asset was created
%asset_updated_X% PHP formatted date the asset was created
%asset_published_X% (see example below) PHP formatted date the asset was created
 %asset_published_l%, %asset_published_j% %asset_published_F% %asset_published_Y%
Wednesday, 5 September 2012
%asset_created%
%asset_updated%  2012-10-15 11:31:18
%asset_created_short%  2012-09-05
%asset_updated_short%  2012-10-15
%asset_created_readable%  05 Sep 2012 10:57am
%asset_updated_readable%  15 Oct 2012 11:31am
%asset_created_readabledate%  05 Sep 2012
%asset_updated_readabledate%  15 Oct 2012
%asset_created_readabletime%  10:57am
%asset_updated_readabletime%  11:31am
%asset_created_iso8601%  2012-09-05T10:57:18+11:00
%asset_updated_iso8601%  2012-10-15T11:31:18+11:00
%asset_created_rfc2822%  Wed, 05 Sep 2012 10:57:18 +1000
%asset_updated_rfc2822%  Mon, 15 Oct 2012 11:31:18 +1100
%asset_created_ical%  20120905T105718
%asset_updated_ical%  20121015T113118
%asset_published%  2012-09-05 10:57:24
%asset_published_short%  2012-09-05
%asset_published_readable%  05 Sep 2012 10:57am
%asset_published_readabledate%  05 Sep 2012
%asset_published_readabletime%  10:57am
%asset_published_iso8601%  2012-09-05T10:57:24+11:00
%asset_published_rfc2822%  Wed, 05 Sep 2012 10:57:24 +1000
%asset_published_ical%  20120905T105724
%asset_status_changed%  2012-09-05 10:57:24
%asset_status_changed_short%  2012-09-05
%asset_status_changed_readable%  05 Sep 2012 10:57am
%asset_status_changed_readabledate%  05 Sep 2012
%asset_status_changed_readabletime%  10:57am
%asset_status_changed_iso8601%  2012-09-05T10:57:24+11:00
%asset_status_changed_rfc2822%  Wed, 05 Sep 2012 10:57:24 +1000
%asset_status_changed_ical%  20120905T105724

Permission Keywords

Keyword Output Version
%asset_read_permission% Comma separated list of the full names for users with read access.
%asset_write_permission% Comma separated list of the full names for users with write access.
%asset_admin_permission% Comma separated list of the full names for users with administrator access.
%asset_read_permission_email% Comma separated list of email addresses for users with read access.
%asset_write_permission_email% Comma separated list of email addresses for users with write access.
%asset_admin_permission_email% Comma separated list of email addresses for users with administrator access.
%asset_read_permission_email_linked% Comma separated list of linked email addresses for users with read access.
%asset_write_permission_email_linked% Comma separated list of linked email addresses for users with write access.
%asset_admin_permission_email_linked% Comma separated list of linked email addresses for users with administrator access.

Asset Listing Keywords

Keyword Output Version
%asset_contents% Asset contents with paint layout. Note: doesn’t work for shadow assets (eg. LDAP users) until 3.16.0.
%asset_contents_raw% Asset contents, no paint layout. Note: doesn’t work for shadow assets (eg. LDAP users) until 3.16.0.
%asset_contents_paint_X% Asset contents, no paint layout. 3.22.0+
%list_current_asset_id%

Custom Form Keywords

Keyword Output Version
%form_summary_semantic% 3.22.0+
%page_list% 3.22.0+

Image Keywords

Keyword Output Version
%asset_attribute_alt%
%asset_attribute_caption%
%asset_attribute_width%
%asset_attribute_height%
%asset_attribute_size%
%asset_attribute_title%
%asset_attribute_name%
%asset_file_size_in_bytes%
%asset_file_size_readable%
%image_width% Image width in pixels
%image_height% Image height in pixels
%image_tag%

Image Variety Keywords

Keyword Output Version
%image_v_X% Prints the Image Variety using an tag.
%image_v_X_url%
%image_v_X_width% Prints the Image Variety width in pixels. 3.22.0+
%image_v_X_height% Prints the Image Variety height in pixels. 3.22.0+

File Keywords

Keyword Output Version
%asset_attribute_title%
%asset_attribute_name%
%asset_file_size_in_bytes%
%asset_file_size_readable%

News Item Keywords

Keyword Output Version
%asset_attribute_summary%
%asset_attribute_body%
%asset_attribute_contact_name%
%asset_attribute_contact_phone%
%asset_attribute_show_headline%
%asset_attribute_show_summary%
%asset_attribute_show_body%
%asset_attribute_show_contact_name%
%asset_attribute_show_contact_phone%
%asset_attribute_short_name%
%asset_attribute_name%
%asset_name_linked_to_link_url%
%asset_attribute_link_url%
%asset_attribute_url_suffix%

Paint Layout Keywords

Keyword Output Version
%paint_layout%
%begin_X% If paint layout condition met
%else_X% If paint layout condition not met
%end_X% End conditional paint layout content

Standard Page Keywords

Keyword Output Version
%asset_attribute_short_name%
%asset_attribute_name%

Search Page Keywords

Keyword Output Version
%X_query% Input box for search terms
%X_query_logic% Drop down logic chooser
%X_query_terms% Show the search terms entered by the user
%results_per_page%
%structured_root_node%
%submit_button%
%result_count%
%initial_result_count%
%category_list_linked%
%initial_layout%
%next_result_page_href%
%previous_result_page_href%
%next_result_page_link%
%previous_result_page_link%
%result_page_index%
%total_result_pages%
%current_result_page%
%current_result_page_end%
%result_list%
%page_list_X% Sliding list of page numbers
%X_query_synonyms_message%
%X_query_synonyms%
%X_query_suggestions_message%
%X_query_suggestions%
%X_query_synonym_search_message%

Single Calendar Event Keywords

Keyword Output Version
%event_name%
%event_start_date%
%event_start_time_12h%
%event_start_time_24h%
%event_start_time_ical%
%event_end_date%
%event_end_time_12h%
%event_end_time_24h%
%event_short_start_time%
%event_short_end_time%
%event_end_time_ical%
%event_start_datetime%
%event_end_datetime%
%event_datetime_summary%
%event_duration%

Tag Listing Page

Keyword Output Version
%tag_size% The combined tag weighting across the candidate assets. 3.24.1+

User

Keyword Output Version
%asset_attribute_email_image% Prints the user’s email address as an image. 3.22.0+