Editing File Assets Using Simple Edit
Ever seen the limbo_assetid URL parameter? You have now! This tutorial explains one of it's purposes and how to use it to apply a simple edit interface correctly to publicly accessible file assets on a system without Easy Edit Suite installed.
Long before the fruity goodness fell from the tree of the Easy Edit Suite, it was up to implementers to create a custom set of Simple Edit Interfaces for clients who wished to edit their Matrix content. One gotcha which caught out many implementers was the application of Simple Edit Interfaces on Live, publicly accessible File Assets.
Take for example the URL of this PDF File asset. This asset either does not have public read permissions or its status has not been set to live:
http://community.squiz.net/beginner/editing-file-assets-using-simple-edit/demo/Example.pdf (This URL won't actually work)
Once we make this live and give the public read permissions, the url will change to:
http://community.squiz.net/__data/assets/pdf_file/0010/3034/Example.pdf
For security reasons Matrix prints out a __data based URL to cloak your sites asset / file structure. Now if we try to access the simple edit interface using both of the previous URLs, you will find the cloaked URL will return a 404.
http://community.squiz.net/__data/assets/pdf_file/0010/3034/Example.pdf/_edit (This URL won't work either)
Here is where we bring in the limbo_assetid. The limbo_assetid url parameter allows us to pass the asset id of an asset to the Simple Edit Interface, so we can access and edit the file via a dummy URL. To provide a human readable URL we often create a standard page in our sites root folder titled, 'File Edit'. Using its URL we append /_edit?limbo_assetid= plus our File Asset's Asset ID giving us the following link:
The link above will take you to the Simple Edit Interface of the file asset.
So when you are preparing the File Edit Site Tools and printing out your asset listing of files which your client can edit, rather than just applying the simple edit URL as you normally would:
%asset_url%/_edit
It's better to play it safe and provide a simple edit URL using a limbo_assetid parameter
http://siteroot.com/file-edit/_edit?limbo_assetid=%asset_assetid%
That way users will be able to edit file assets via the Simple Edit Interface regardless of their status and permissions.
Tutorial Feedback
There is currently 2 comments.
Add Your Feedback
You must be logged in to leave a comment. You can sign-up for free!
