Hi Rachel,
If needed, I could put some screen shots up a correct trigger configuration tomorrow, let me know if you don't get it working.
New jQuery Plugin released for MySource Matrix
I have no javascript skills so it is possible that I missed something, but it does seem to be that the trigger never fires.
A screengrab of a trigger would be helpful, perhaps you could fuzz out the url you chose? Or PM it?
[quote]I have no javascript skills so it is possible that I missed something, but it does seem to be that the trigger never fires.
A screengrab of a trigger would be helpful, perhaps you could fuzz out the url you chose? Or PM it?[/quote]
One more thing, have you checked your error log, there should be an error when the trigger fails. Also, here is a way to test if your trigger works. Since it is really just accessing the URL, just put the URL into the browser along with the URL suffix and see if it will fire the trigger, this is the best way to test, as ajax is pretty silent.
So, http://www.yoursite.com?action=delete
Try that, and see if your asset, or a test asset gets deleted, if it does great, if not, we should check the trigger settings.
Oh, and you don’t need to have any javascript skills, that is why I made this plugin!
[quote]I have no javascript skills so it is possible that I missed something, but it does seem to be that the trigger never fires.
A screengrab of a trigger would be helpful, perhaps you could fuzz out the url you chose? Or PM it?[/quote]
Hi Rachel,
I just realized that there was a bug in the code, which might have been causing you problems with this. I have fixed the bug, and tested the plugin thoroughly and it should be working perfectly now. Please download the newest version from github and let me know if it works for you:
github
Okay, before I downloaded the new version I tried putting action=delete in a URL and the trigger fired beautifully, no problems at all, page is in the trash! System log says trigger worked fine.
Downloaded the new version. Tried simple edit again and the same sort of behaviour; click on a link, asks if I want to delete, then removed it from the list. But it’s still there. But this time there is something in the error log! A big red error saying ‘(/core/include/backend.inc:197) - Backend Page “main?action=delete” unknown [SYS0097]’.
So I guess I am getting ‘main’ in there somehow which is stuffing it up.
Here is exactly what I am doing (not how I intend to roll it out eventually but how I’ve been testing it).
I add a raw html div at the end of my standard page layout screen. Into it I have:
[codebox]<script type=“text/javascript” src=“http://www.domain.com/__data/assets/file/0004/9967/jquery.matrix.js”></script>
<script type=‘text/javascript’>
$(document).ready(function() {
$(‘a’).matrixDelete();
});
</script>[/codebox]
I then log into simple edit. I click on one of the navigational menu links to delete that page (I’m wondering if this is where I am going wrong; is it supposed to be some other kind of area or link?). Screengrab of what happens when I click on ‘Micky’s tests’ and the error message (interestingly doesn’t contain the asset number).
[attachment=356:deleteerror.gif]
So… uh… I feel like I am not implementing this correctly since it isn’t even picking up the asset number… :unsure:
deleteerror.gif (53 KB)
Rachel,
Thanks for bearing with me on this one. I realized that I did not account for the urlSuffix being added after other query strings, so you are getting this error. Please download the brand new version of the plugin that I just uploaded. Sorry for the problems, but I appreciate you helping me find these!
Ok, so now, since you are in simple edit, and the string is getting added AFTER the rest of the URL, you are going to have to add &action=delete. So something like this:
[codebox]
<script type='text/javascript'>
$(document).ready(function() {
$('a').matrixDelete({urlSuffix: '&action=delete'});
});
</script>[/codebox]
If there is nothing else on the URL, then you could do ?action=delete.
Also, I would advise you making the jQuery selector more specific (you can use normal css type selectors), right now it is adding that matrixDelete function to ALL links in your entire page. So, you need to be more specific with it, such as:
[codebox]
<script type='text/javascript'>
$(document).ready(function() {
$('#nav a').matrixDelete({urlSuffix: '&action=delete'});
});
</script>[/codebox]
This would look for all anchor tags within an element with the ID of nav.
Also, the asset ID really is just pulled from the ID of the selected element, so right now, it does not seem that your anchor tags have any ID attributes on them. But, if you do something like the following, it will find the ID.
%asset_name%
I really hope this helps, sorry for the problems, but I do appreciate you helping me make this plugin even better! Lets cross our fingers that it works this time!
Okay, after doing all the above it still didn't work when clicking on a link the menu area but it did work when clicking on a normal link to an asset!
Yay!!! :lol:
Thanks for the assistance everyone! Hopefully this thread will be helpful to other javascript-challenged folk.
[quote]Also, I would advise you making the jQuery selector more specific (you can use normal css type selectors), right now it is adding that matrixDelete function to ALL links in your entire page.[/quote]
Oh yeah, for sure, I just wanted to make it work before I started playing with my style sheets.
Just an FYI.
I am wondering if the problem that Rachel was experiencing was due to the fact that the links that were being clicked were in menu design area, so while in simple edit, those URLs got rewrote with /_edit?SQ_BACKEND_PAGE=main'. I have a feeling that posting to the /_edit page was causing problems, so I will do some testing myself and adjust the plugin as necessary.
[quote]Just an FYI.
I am wondering if the problem that Rachel was experiencing was due to the fact that the links that were being clicked were in menu design area, so while in simple edit, those URLs got rewrote with /_edit?SQ_BACKEND_PAGE=main'. I have a feeling that posting to the /_edit page was causing problems, so I will do some testing myself and adjust the plugin as necessary.[/quote]
Hi Nic,
That's correct. We are using Design Tag of "menu_normal" as well as Rachael. This tag prints the navigation menu. I think this tag is not used in your website design.
I think the design needs to be modified to implement the customised simple edit interface to chop off the stuffs like top banner, navigation menu, breadcrumbs, etc.
Robin
[quote]Hi Nic,
That's correct. We are using Design Tag of "menu_normal" as well as Rachael. This tag prints the navigation menu. I think this tag is not used in your website design.
I think the design needs to be modified to implement the customised simple edit interface to chop off the stuffs like top banner, navigation menu, breadcrumbs, etc.
Robin[/quote]
Robin,
I can modify the plugin to remove the /_edit from the URLs. But, in your opinion would this be something that you would like to see as part of the plugin?
[quote]Robin,
I can modify the plugin to remove the /_edit from the URLs. But, in your opinion would this be something that you would like to see as part of the plugin?[/quote]
Hi Nic,
I don’t think you need to do this.
In my opinion your plugin will significantly improve the way of how the assets being updated in Matrix in simple edit interface.
In the screendump Rachael uploaded, the simple edit interface also includes top menu, banner, navigation menu and breadcrumbs. The navigation menu gives out suffix “/_edit” because it keeps the editor stay in the simple edit interface. For example, if the editor leaves the page of “Micky’s tests” for “What is new”, the interface still remains in the simple edit interface.
As we can see, it’s not easy to clone, delete or create but your plugin gives the extra features.
I am implementing your plugin with the design modified. I will put up a screen copy when it’s done.
I really love the plugin, well done Nic.
Robin
:P’ /> <img src=‘http://forums.matrix.squiz.net/public/style_emoticons/<#EMO_DIR#>/tongue.gif’ class=‘bbc_emoticon’ alt=’
[quote]I don’t think you need to do this.
In my opinion your plugin will significantly improve the way of how the assets being updated in Matrix in simple edit interface.[/quote]
Just for the sake of having the plugin work in many situations, I have updated it with a new simpleEdit option. The default for this is to not rewrite URLs, but if you do pass true to the plugin, it will rewrite all of the URLs that are matched by the jQuery selector. So, everyone can have their way!
Project on github and github has been updated.
[quote]I really love the plugin, well done Nic.[/quote]
Thanks, I appreciate that!
Hey everyone.
I just added a new plugin to the jQuery Matrix project, called matrixFilter.
This plugin will let you quickly and easily filter an asset listing giving you real-time iTunes like searching. This is very nice to quickly filter a large list of assets.
Project file has been updated as well as the documentation.
Hope you all like it, have fun!
Hey everyone,
I just updated jquery.matrix.js with a few new features, error checking and also some bug fixes. If anyone had been using the previous version I would recommend grabbing a new copy from github.
I just added a few new features which are extremely useful.
matrixStatus, matrixDelete and matrixClone plugins have all been given the feature of having an optional callback. So, once the script completes you can run an optional function. This is very nice for things like matrixDelete, where you might want to remove a large block of content visually from the user once the script completes, you can now do this using the new onComplete option.
Feel free to download a copy from github and also check out the download a copy from github
Thanks for that update Nic its working nicely!
Does anyone know how to load the details screen of a PDF File asset into the iframe with the plugin? I want to be able to have the ability to upload a new version af a file.
Cheers,
Jaco
[quote]Thanks for that update Nic its working nicely!
Does anyone know how to load the details screen of a PDF File asset into the iframe with the plugin? I want to be able to have the ability to upload a new version af a file.
Cheers,
Jaco[/quote]
You should be able to use matrixFrame for this. Have you tried and it is not working?
Were you wanting to just preview the current file, or preview the newly uploaded file?
Sorry for not having the demos online anymore, I am working on a brand new bunch of them, but they are not quite finished yet. But once there are there will be some new examples of functionality.
[quote]You should be able to use matrixFrame for this. Have you tried and it is not working?
Were you wanting to just preview the current file, or preview the newly uploaded file?
Sorry for not having the demos online anymore, I am working on a brand new bunch of them, but they are not quite finished yet. But once there are there will be some new examples of functionality.[/quote]
Yep I am using matrixFrame. For standard pages I append "/_edit?asset_ei_screen=details" (Altough "_edit" will do as details is default) and it works fine. I have tried appending that to PDF files but since a pdf file has a complete url with .pdf extension adding "/_edit" gives a 404.
Cheers,
Jaco