Page 1 of 1

Returning ONLY the data from a function, not all the joomla code...

Posted: Thu Aug 30, 2007 12:21 pm
by fire2006
hi there, I have a function in my component that is being called by an http request from another program, I need to return a simple value to my program and not all the joomla code,

any ideas how I can do this?

Re: Returning ONLY the data from a function, not all the joomla code...

Posted: Thu Aug 30, 2007 3:13 pm
by seadap
I'm not quite sure how to implement this idea but I figured I'd throw it out there.  You could use something like an rss feed to return an xml file that your program could parse to get the data you want.

Also, failing that, you could scrape the data you need out of the joomla code by searching for a token that marks the beginning and ending of the data you want..

Just a couple of ideas.  I'm sure there's an easy way to do what you're looking for.

Re: Returning ONLY the data from a function, not all the joomla code...

Posted: Thu Aug 30, 2007 3:39 pm
by fire2006
nice thanks man,

But I think I got it!  Basically, all I need to do is create a tempalte that only has:





Then, i need to create a menu item for the component, and then assign that template for it, that yields only the data I need!  Cheers!

where does come from? and how do I get rid of it?

Posted: Thu Aug 30, 2007 4:18 pm
by fire2006
I just noticed, when I view source, it's not completely bare - I still see a strange comment

""

where does come from? and how do I get rid of it?

Re: Returning ONLY the data from a function, not all the joomla code...

Posted: Sat Sep 01, 2007 11:39 pm
by DeanMarshall
It looks from your previous comments like you are using Joomla 1.0.x
This forum is aiming - I think - at the Joomla 1.5 branch.

One other method that will work with Joomla 1.0.x is to link to index2.php rather than index.php
this should output just the components output without any superfluous formatting.

Dean

Re: Returning ONLY the data from a function, not all the joomla code...

Posted: Sun Sep 02, 2007 5:06 am
by fire2006
Thanks for  catching this Dean, you are right - I am using joomla 1.0.13

Cheers!

Re: Returning ONLY the data from a function, not all the joomla code...

Posted: Sun Sep 02, 2007 12:30 pm
by ianmac
Also,
you will want to pass on the request string: &no_html=1

Ian

Re: Returning ONLY the data from a function, not all the joomla code...

Posted: Tue Sep 11, 2007 3:33 am
by jalil
DeanMarshall wrote:It looks from your previous comments like you are using Joomla 1.0.x
This forum is aiming - I think - at the Joomla 1.5 branch.

One other method that will work with Joomla 1.0.x is to link to index2.php rather than index.php
this should output just the components output without any superfluous formatting.
Dean


this forum is ? where should 1.0 coding discussions be held, i need to start with 1.0, then speed to 1.5

btw fire2006, i use the same method you thought of to get pure text menus for mobiles and it works a treat. just so you know you are on the right track.