?
avatar htmgarcia
htmgarcia
19 Jul 2016

Steps to reproduce the issue

With this URL we can get the component output, including the JS, CSS files and the html, head, body tags:
www.site.any/alias-example?tmpl=component

<html>
<head>
// JS and CSS files loads here
</head>
<body>
    <div id="mycomponent">
        // component's code loads here
    </div>
</body>
</html>

Expected result

What if I want to load just the component while using ajax?
www.site.any/alias-example?tmpl=ajax

<div id="mycomponent">
     // component's code loads here
</div>

Actual result

N/A

System information (as much as possible)

N/A

Additional comments

N/A

avatar htmgarcia htmgarcia - open - 19 Jul 2016
avatar htmgarcia htmgarcia - change - 19 Jul 2016
The description was changed
avatar mbabker
mbabker - comment - 19 Jul 2016

You can create your own ajax.php file in the template and use it. As long as you have a file matching the tmpl parameter it works. No need for Joomla core to support a varying degree of possibilities beyond the basics.

avatar htmgarcia
htmgarcia - comment - 19 Jul 2016

Having this file won't damage the core. It would make Joomla more flexible.

avatar mbabker
mbabker - comment - 19 Jul 2016

No, it doesn't damage core, but IMO it's not core's job to ship tools for every possible scenario the user base can think of. This gets into a case of is this something that the core system really needs to ship with, and I think it's a case that leans toward no.

avatar htmgarcia
htmgarcia - comment - 19 Jul 2016

I disagree. If we can increase the possibilities for the CMS, why not?

avatar htmgarcia htmgarcia - change - 19 Jul 2016
The description was changed
avatar mbabker
mbabker - comment - 19 Jul 2016

I'm not saying that adding new features is a bad idea. I just don't agree that the Joomla core needs to carry the weight of every possible feature every possible user might need. To me this is an edge case feature that the Joomla core does not need to provide. Not to mention that AJAX requests for full HTML is IMO a bad idea to begin with.

avatar Fedik
Fedik - comment - 19 Jul 2016

I think it need only for template developers, but they already can add it to its own template without problem.

Extension developers already have a loot possibility to do "ajax stuff".

avatar htmgarcia
htmgarcia - comment - 19 Jul 2016

Ajax was just an example, but not the only.
Another one is to embed an article/component view into an external website within an iframe:
<iframe src="http://www.site.any/alias-example?tmpl=ajax"></iframe>

avatar mbabker
mbabker - comment - 19 Jul 2016

Isn't an iframe supposed to have a full HTML document within it (including proper <html> tags)?

avatar htmgarcia
htmgarcia - comment - 19 Jul 2016

You're right! Obviously I didn't thought properly that last one 😵

avatar Bakual
Bakual - comment - 19 Jul 2016

You can of course also use a plugin together with com_ajax to do that. No need for an ajax.php file then.

avatar htmgarcia htmgarcia - change - 19 Jul 2016
Status New Closed
Closed_Date 0000-00-00 00:00:00 2016-07-19 18:37:30
Closed_By htmgarcia
avatar htmgarcia htmgarcia - close - 19 Jul 2016
avatar htmgarcia htmgarcia - close - 19 Jul 2016
avatar brianteeman brianteeman - close - 19 Jul 2016
avatar htmgarcia
htmgarcia - comment - 19 Jul 2016

I appreciate your thoughts, guys!

avatar brianteeman brianteeman - change - 21 Jul 2016
Labels Added: ?

Add a Comment

Login with GitHub to post a comment