? ? Success

User tests: Successful: Unsuccessful:

avatar okonomiyaki3000 okonomiyaki3000 - open - 9 Jun 2014
avatar Bakual
Bakual - comment - 9 Jun 2014

I don't see how this could be useful?

avatar okonomiyaki3000
okonomiyaki3000 - comment - 9 Jun 2014

If you can set up a menu item to access com_ajax, it means you can access it by it's alias. So instead of /index.php?option=com_ajax, maybe you only need to access /ajax (or whatever you choose as the menu item alias).

Then, since the menu item can have settings of it's own, you can set some defaults. So, instead of /index.php?option=com_ajax&format=json, you only need /ajax.

You can even set a default module or plugin so that instead of /index.php?option=com_ajax&format=json&plugin=myPlugin, you would only need /ajax.

avatar wilsonge
wilsonge - comment - 9 Jun 2014

But no extensions developer can ever really use that because you can't guarentee the menu item has been created. I don't see this as been worth it tbh

avatar okonomiyaki3000
okonomiyaki3000 - comment - 9 Jun 2014

What do extension developers have to do with anything? By using com_ajax, you can give your site a rudimentary API. By using this addition, you can do it with nicer looking urls.

avatar chrisdavenport
chrisdavenport - comment - 9 Jun 2014

The purpose of com_ajax itself is to give your site a rudimentary API. In my opinion, obscuring that API behind "nicer looking urls" will just make it harder to debug and encourages the construction of fragile clients (your client code will depend on the menu item being set correctly).

avatar Bakual
Bakual - comment - 9 Jun 2014

com_ajax is only meant to be used by modules and plugins. The call to this URL is done invisible to the user within the JavaScript code.
SEF URLs are quite meaningless there.

avatar betweenbrain
betweenbrain - comment - 9 Jun 2014

There's nothing that I'd love to see more than being able to achieve something like this, but I agree with @chrisdavenport @wilsonge about the risks of this. Unfortunately the video isn't available, but there was a great talk at J and Beyond about APIs and Joomla (http://jandbeyond.org/program/sessions/dont-worry-be-api-best-practices-and-implementatio.html). Essentially, the weak link in Joomla is the router and being able to achieve SEF URLs. Making them menu dependent is too great of a risk in my opinion.

avatar okonomiyaki3000
okonomiyaki3000 - comment - 11 Jun 2014

To be clear, this does not stop the longhand version of urls from working. It just provides an alternative.

avatar Bakual
Bakual - comment - 11 Jun 2014

To be clear, this does not stop the longhand version of urls from working. It just provides an alternative.

That's obvious. I just don't see the point in creating a SEF URL for an API. It would only confuse users to have one more menu item choice. Nobody would have it as a real visible menu item anyway, there is no point for that. So we're left with a hidden menu item which is purely for creating nice URLs. But again this URLs aren't visible to the user, they're only used internally within an AJAX call.

Extensions using com_ajax don't use JRouter to create SEF URLs. There is no point wasting ressources doing that. To work properly, the extension would also need an added parameter where you can specify the Itemid you want to use, otherwise the whole thing is useless again.

So unless you can tell us what you want to solve, I'm not a fan of this.

Of course you can always do it for your own site if you think you need this for your special use. But I don't see how that would be useful for a bigger user base. It's likely only you who would use it.

avatar okonomiyaki3000
okonomiyaki3000 - comment - 11 Jun 2014

I didn't really have in mind that this would be used by the host site itself. I imagined that someone might use this to simple ways for other sites, apps, whatever, to access some kind of data. Sorry it sounds pretty vague. It doesn't solve any specific issue, it's more of a "let's see what people do with this" kind of thing.

avatar phproberto
phproberto - comment - 11 Jun 2014

I can understand that you want to use a cleaner url but I think the new menu item screen has already a lot of options and add another one that is not being used by most users is not a good idea.

avatar brianteeman brianteeman - change - 8 Aug 2014
Labels Added: ?
avatar brianteeman brianteeman - change - 21 Aug 2014
Status New Pending
avatar nicksavov nicksavov - change - 21 Aug 2014
Labels Removed: ?
avatar brianteeman brianteeman - change - 16 Oct 2014
Status Pending Needs Review
avatar brianteeman
brianteeman - comment - 16 Oct 2014

I am changing this to Needs Review so a decision can be made. It looks to me from the comments that several PLT members are saying no to it. @bakual @betweenbrain @phproberto @chrisdavenport

avatar Bakual
Bakual - comment - 17 Oct 2014

Closing this as there are strong comments against this from PLT members and George and nobody supporting it.

avatar Bakual Bakual - close - 17 Oct 2014
avatar Bakual Bakual - change - 17 Oct 2014
Status Needs Review Closed
Closed_Date 0000-00-00 00:00:00 2014-10-17 08:23:56
avatar phproberto
phproberto - comment - 17 Oct 2014

I'm hate when contributions are discarded because you invested time on this.

Thanks @okonomiyaki3000 !!!

Add a Comment

Login with GitHub to post a comment