Squiz Matrix Tip: Remove Webpaths
Wed, Jun. 1, 2011This is a great tip that might not be well-known, so I thought that I would share.
Manipulating Root Nodes
As old Squiz Matrix veteran Avi Miller stated it: "Ever wanted a custom root node for a listing, but didn't want your assets to get lots of URLs/lineages in the wrong place? Well, a little known tip is that you can create an asset and then remove it's web path. Anything linked under that asset won't get a URL at that location. So, you can create custom root nodes, link assets from other locations, but they'll still print their 'real' URL in a list!"
I use this all the time to manipulate what I want to list. Folders can be used as "tags", such as creating a few folders for your blog (ios, javascript, matrix, etc), then linking in assets associated with that folder/tag (with no webpath). Then, using an asset listing, use those folders as root nodes. The nice thing is that since they don't have webpaths, no one will ever browse to the location where they are linked, rather, they will get pointed to the real webpath that you want them to visit.
Nested Assets
If you have assets that are used only for nesting, such as a "Nested Content" folder or comments, you can just remove the webpath for the folder or parent asset. If there is no need for all of the assets to have webpaths then it is just unnecessary space used in the database. When assets are nested they don't need a URL or webpath. Another added benefit to this is that users can't accidently access these assets that are used for nesting and really should never be viewed on their own.
I do this for hundreds of assets for the Pacific Union College website since we use a lot of nested assets across the site.
Comments