I'm trying to build an admin interface for some users to give them access to a minimal range of functions that they can use to manage their own small websites.
I can provide them access to edit pages that are already in their sites, and give them an asset builder to add new pages and files - but how can I let them edit files that they have already added to their site?
In particular, one group needs to be able to upload a new excel file every day. when I do this for them using the backend, I simply add the new file over the old one on the details page of the file asset. How can I acheive the same thing through a front end interface?
Also - is it possible to delete assets from the front end?
If the file has a Matrix URL (ie. no __data part) then just use the normal URL + /_edit.
If the file is LIVE and Public, it will have an __data URL, meaning that is is served by Apache and Matrix no longer has control. In this case, you need to do something tricky with the limbo_assetid query string variable.
If you have a file with the assetid #1234, a URL like http://example.com/_edit?limbo_assetid=1234
will open the simple edit interface for that file asset, even if it’s live and public.
As for deleting assets, that has to be done through the admin interface. The Simple edit interface is really just for editing.
excellent - that was jus the ticket.
Actually, one more question on this. I find that when I upload a new version of a file using this method, when the process is complete I am taken to a page that doesn't exist. With an apache message like this
The requested URL /__data/assets/file/13690/av-1.gif/_edit was not found on this server.
Clearly this is because the /_edit addition to a file url is invalid. Any suggestion of what I could do about this?
Could you log a bug for this, please?
You can work around this by editing the Created bodycopy and add code similar to this:
<script>
<!–
window.location="/_edit?limbo_assetid=%created_assetid%";
// -->
</script>
Note that if you want to later edit this, you may need to lock the asset before you go to the edit contents screen, otherwise you might run the javascript redirect instead of see an edit screen.