Message from discussion
Ajax and the Joomla Framework
Received: by 10.180.92.170 with SMTP id cn10mr1679299wib.3.1334595269418;
Mon, 16 Apr 2012 09:54:29 -0700 (PDT)
X-BeenThere: joomla-dev-cms@googlegroups.com
Received: by 10.180.19.168 with SMTP id g8ls2813216wie.2.gmail; Mon, 16 Apr
2012 09:54:25 -0700 (PDT)
Received: by 10.180.8.137 with SMTP id r9mr1679461wia.2.1334595265396;
Mon, 16 Apr 2012 09:54:25 -0700 (PDT)
Received: by 10.180.8.137 with SMTP id r9mr1679460wia.2.1334595265375;
Mon, 16 Apr 2012 09:54:25 -0700 (PDT)
Return-Path: <drmmr...@gmail.com>
Received: from mail-we0-f179.google.com (mail-we0-f179.google.com [74.125.82.179])
by gmr-mx.google.com with ESMTPS id fm5si3583482wib.2.2012.04.16.09.54.25
(version=TLSv1/SSLv3 cipher=OTHER);
Mon, 16 Apr 2012 09:54:25 -0700 (PDT)
Received-SPF: pass (google.com: domain of drmmr...@gmail.com designates 74.125.82.179 as permitted sender) client-ip=74.125.82.179;
Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of drmmr...@gmail.com designates 74.125.82.179 as permitted sender) smtp.mail=drmmr...@gmail.com; dkim=pass header...@gmail.com
Received: by werg1 with SMTP id g1so3599869wer.38
for <joomla-dev-cms@googlegroups.com>; Mon, 16 Apr 2012 09:54:25 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20120113;
h=mime-version:in-reply-to:references:from:date:message-id:subject:to
:content-type;
bh=pVOom7OJ+SCULlsTTe1+lBw8CL9imy2SiIngJ2LDPss=;
b=bUusxnFihjNDjUx0JJw2vevE1EyUdgv3Um7p0JgRaNIBaUjkLxhNjCwnnLH4m08JGC
iqL9Y+UChLYnIFm3lyck9UMJ/71/8f5gRaF2V6JtVGdZT7D6dT67Lq8G4c3pIwEsD4f1
573R/qKxaFdQoBlLXOI38riPP0xcYVVGsPWuHbTWoNM57mgX4xngxHsrwWm+5UiBX4HR
6dnSATz5dAt78gdAPhH5QEjnlsH50dlQDKJx33V2EizC7QrcubzqVca8Zz6xYBiLCQst
E3Pljc1JapWAKIJ0ZqrNqmRt7+Hg1l459y5trYdyw4gpdux4M6g88de13L+drXsFz7X/
NRxg==
Received: by 10.216.144.138 with SMTP id n10mr7234179wej.56.1334595265180;
Mon, 16 Apr 2012 09:54:25 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.216.209.67 with HTTP; Mon, 16 Apr 2012 09:54:04 -0700 (PDT)
In-Reply-To: <a84fd06c-4248-4284-a048-365e11e65...@s7g2000yqm.googlegroups.com>
References: <e6fe8c78-36d7-4f00-bad0-4adf85d77...@l4g2000vbt.googlegroups.com>
<12f3266c-48d8-4de2-871b-8d621088b...@x17g2000yqj.googlegroups.com>
<4f47339e-67f9-4230-97dc-51ad9a687...@r9g2000yqd.googlegroups.com>
<4F8C1585.5000...@gmail.com> <a84fd06c-4248-4284-a048-365e11e65...@s7g2000yqm.googlegroups.com>
From: Chad Windnagle <drmmr...@gmail.com>
Date: Mon, 16 Apr 2012 12:54:04 -0400
Message-ID: <CAA=5Qbd5xY+ndcCwySj7Qq0VVkfNgLNhk8Q=Te=fUuxVCgR...@mail.gmail.com>
Subject: Re: [jcms] Re: Ajax and the Joomla Framework
To: joomla-dev-cms@googlegroups.com
Content-Type: multipart/alternative; boundary=0016e6de0137b334c704bdceac2c
--0016e6de0137b334c704bdceac2c
Content-Type: text/plain; charset=ISO-8859-1
Gary just want to thank you for your explanation on using the different
view file types with the URL parameters. That is very useful information!
It would be really cool if that were in the documentation somewhere.
-Chad
Regards,
Chad Windnagle
Fight SOPA <https://www.google.com/landing/takeaction/>
On Mon, Apr 16, 2012 at 12:38 PM, Lobos <adam.doche...@gmail.com> wrote:
> Yeah I mentioned in my post, the system plugin would be a quick and
> dirty way to do it. What Gary mentioned is the cleanest way to go
> about it, but the thing is that if you update the Kunena component you
> will lose your changes because you are effectively hacking it. With a
> plugin you will not lose your changes when you need to update the
> component (or have to reintegrate them).
>
> I have always felt there is a need to be able to extend component
> views and such in a non hack type of way, say like a plugin group that
> can add new views without needing to hack the "core" of the component.
> Just my two cents...
>
> On Apr 16, 9:50 am, Gary Mort <garyam...@gmail.com> wrote:
> > On 4/16/2012 2:25 AM, RonaldJ wrote:
> >
> > > Thanks Lobos for your reply.
> >
> > > Kunena 2 is not there yet so I can not use that.
> > > And as far as I know is it not possible to call functions inside a
> > > plugin or such from ajax.
> >
> > Well, you can, but it's ugly. You can make a system plugin that checks
> > for your specific url, does something, spits out the json, and dies.
> >
> > However, it's much CLEANER to do this via a component.
> > The summary:
> > Add &format=json&tmpl=raw in your query string
> > create the files view.json.php and default_json.php to do your special
> > processing
> > Everything works. Grab a beer.
> >
> > -----
> > The long winded, ask me the time and I tell you how to build a clock,
> > commentary:
> >
> > I assume you already now how to make a component which returns html. Ie
> > using the files
> > componentname/viewname/view.html.php
> > componentname/viewname/tmpl/default.tpl
> >
> > Now the view.html.php is actually determined depending on what format
> > the browser says it wants the data in. If you add &format=ejs then the
> > file used would be view.ejs.php, if you add &format=json then the file
> > used is view.json.php. One exception, if you add &format=html5 because
> > you want a specific cool html5 format and to allow for fallback to
> > view.html.php for older browsers - your out of luck. If the first 4
> > charectors of the viewname are html, view.html.php is always used. So
> > you would have to use &format=5html to do it.
> >
> > So now you have a view that can respond to ajax requests and will return
> > json data. But what about the template? No problem, format is used
> > there as well.
> > default.php
> > default_html.php
> > default_json.php
> >
> > If default_html.php exists, it is used instead of default.php. Same
> > deal with default_json.php
> >
> > So far so good. So now can create a component which returns json data.
> > But your still stuck with all the other modules and stuff. So how do
> > you get past that?
> > 2 ways: add either tmpl=component or tmpl=raw to your query string.
> > tmpl=raw is safest.
> > tmpl=raw means no template will be loaded. Just the results of the
> > component plus any plugins which are called will be sent back, in
> > whatever way they are formatted.
> >
> > tmpl=component instead will use the component.php file[if one exists] in
> > the template directory instead of the index.php file. Since most
> > templates do NOT have a component.php file the effect would be the
> > same...but if yours does...
>
> --
> You received this message because you are subscribed to the Google Groups
> "Joomla! CMS Development" group.
> To post to this group, send an email to joomla-dev-cms@googlegroups.com.
> To unsubscribe from this group, send email to
> joomla-dev-cms+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/joomla-dev-cms?hl=en-GB.
>
>
--0016e6de0137b334c704bdceac2c
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Gary just want to thank you for your explanation on using the different vie=
w file types with the URL parameters. That is very useful information! It w=
ould be really cool if that were in the documentation somewhere.=A0<div><br=
>
</div><div>-Chad<br><div><br><div>Regards,<br>Chad Windnagle<br><font size=
=3D"1"><a href=3D"https://www.google.com/landing/takeaction/" target=3D"_bl=
ank">Fight SOPA</a></font><br>
<br><br><div class=3D"gmail_quote">On Mon, Apr 16, 2012 at 12:38 PM, Lobos =
<span dir=3D"ltr"><<a href=3D"mailto:adam.doche...@gmail.com">adam.doche=
r...@gmail.com</a>></span> wrote:<br><blockquote class=3D"gmail_quote" st=
yle=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Yeah I mentioned in my post, the system plugin would be a quick and<br>
dirty way to do it. What Gary mentioned is the cleanest way to go<br>
about it, but the thing is that if you update the Kunena component you<br>
will lose your changes because you are effectively hacking it. With a<br>
plugin you will not lose your changes when you need to update the<br>
component (or have to reintegrate them).<br>
<br>
I have always felt there is a need to be able to extend component<br>
views and such in a non hack type of way, say like a plugin group that<br>
can add new views without needing to hack the "core" of the compo=
nent.<br>
Just my two cents...<br>
<div class=3D"HOEnZb"><div class=3D"h5"><br>
On Apr 16, 9:50=A0am, Gary Mort <<a href=3D"mailto:garyam...@gmail.com">=
garyam...@gmail.com</a>> wrote:<br>
> On 4/16/2012 2:25 AM, RonaldJ wrote:<br>
><br>
> > Thanks Lobos =A0for your reply.<br>
><br>
> > Kunena 2 is not there yet so I can not use that.<br>
> > And as far as I know is it not possible to call functions inside =
a<br>
> > plugin or such from ajax.<br>
><br>
> Well, you can, but it's ugly. =A0 You can make a system plugin tha=
t checks<br>
> for your specific url, does something, spits out the json, and dies.<b=
r>
><br>
> However, it's much CLEANER to do this via a component.<br>
> The summary:<br>
> Add &format=3Djson&tmpl=3Draw in your query string<br>
> create the files view.json.php and default_json.php to do your special=
<br>
> processing<br>
> Everything works. =A0Grab a beer.<br>
><br>
> -----<br>
> The long winded, ask me the time and I tell you how to build a clock,<=
br>
> commentary:<br>
><br>
> I assume you already now how to make a component which returns html. =
=A0Ie<br>
> using the files<br>
> componentname/viewname/view.html.php<br>
> componentname/viewname/tmpl/default.tpl<br>
><br>
> Now the view.html.php is actually determined depending on what format<=
br>
> the browser says it wants the data in. =A0If you add &format=3Dejs=
then the<br>
> file used would be view.ejs.php, if you add &format=3Djson then th=
e file<br>
> used is view.json.php. =A0 One exception, if you add &format=3Dhtm=
l5 because<br>
> you want a specific cool html5 format and to allow for fallback to<br>
> view.html.php for older browsers - your out of luck. =A0If the first 4=
<br>
> charectors of the viewname are html, view.html.php is always used. =A0=
So<br>
> you would have to use &format=3D5html to do it.<br>
><br>
> So now you have a view that can respond to ajax requests and will retu=
rn<br>
> json data. =A0 But what about the template? =A0No problem, format is u=
sed<br>
> there as well.<br>
> default.php<br>
> default_html.php<br>
> default_json.php<br>
><br>
> If default_html.php exists, it is used instead of default.php. =A0Same=
<br>
> deal with default_json.php<br>
><br>
> So far so good. =A0So now can create a component which returns json da=
ta.<br>
> But your still stuck with all the other modules and stuff. =A0So how d=
o<br>
> you get past that?<br>
> 2 ways: add either tmpl=3Dcomponent or tmpl=3Draw to your query string=
.<br>
> tmpl=3Draw is safest.<br>
> tmpl=3Draw means no template will be loaded. =A0Just the results of th=
e<br>
> component plus any plugins which are called will be sent back, in<br>
> whatever way they are formatted.<br>
><br>
> tmpl=3Dcomponent instead will use the component.php file[if one exists=
] in<br>
> the template directory instead of the index.php file. =A0 Since most<b=
r>
> templates do NOT have a component.php file the effect would be the<br>
> same...but if yours does...<br>
<br>
--<br>
You received this message because you are subscribed to the Google Groups &=
quot;Joomla! CMS Development" group.<br>
To post to this group, send an email to <a href=3D"mailto:joomla-dev-cms@go=
oglegroups.com">joomla-dev-cms@googlegroups.com</a>.<br>
To unsubscribe from this group, send email to <a href=3D"mailto:joomla-dev-=
cms%2Bunsubscribe@googlegroups.com">joomla-dev-cms+unsubscribe@googlegroups=
.com</a>.<br>
For more options, visit this group at <a href=3D"http://groups.google.com/g=
roup/joomla-dev-cms?hl=3Den-GB" target=3D"_blank">http://groups.google.com/=
group/joomla-dev-cms?hl=3Den-GB</a>.<br>
<br>
</div></div></blockquote></div><br></div></div></div>
--0016e6de0137b334c704bdceac2c--