Problem with a "single page"

Permalink
Greetings eathlings,
I want to use AJAX in my site. I would like to call my AJAX data from a single page. I was able to make one, but the problem is, concrete seems to put a theme to it... I don't want a theme, I want to only have a JSON object in there... Why is the theme being applied? How can I only have my JSON data?

Thanks!

P.S. Couple more notes to help troubleshoot my problem:
- My PHP file for the single page is in the folder single_pages
- I created a single page, through the concrete "add a single page" function.
- I made my own theme. If I change the theme to one of the default themes, the content I have in my singe page php content appears in the page, but not in the one I made...

slafleche
 
JohntheFish replied on at Permalink Reply
JohntheFish
You need to ajax load the data from a tools file, that way c5 only loads a minimum environment and only outputs what the tool does, not theme or wrapping.
slafleche replied on at Permalink Reply
slafleche
If I load it from a tools file, can you get to it via a url? I want to get the JSON data from an adress, ex: mysite.com/getJsonData
JohntheFish replied on at Permalink Reply
JohntheFish
You can use the c5 tool helper and getToolsURL(). The parameters depend on whether the tool is in a package or in the root /tools.

You can also use an action in a single page controller as an ajax action.

There is some stuff on tools and actions in the docs and help that is just about enough to explain. You may also find my ajax lessons howto & block useful, though the content of these is getting a bit dated.
JohntheFish replied on at Permalink Reply
JohntheFish
Another solution would be to simply code up a block to show your data. Maybe using designer content to get it started.

You can then ajax load the block with my blocks by ajax addon by any of:
- creating a blocks by ajax template for it (lots of examples in the addon and docs)
- put the block in a stack and use blocks by ajax to load the stack

- (and other variations of this)

If you decide to go this route, the trick for maximum efficiency is for the view to ask for the content by calling back to the controller. (Rather than the controller preparing it all first and then handing it over to the view)
slafleche replied on at Permalink Reply
slafleche
I solved my own problem, check out this thread if you want to see how:
http://www.concrete5.org/community/forums/customizing_c5/accessing-...

Thanks JohntheFish for taking the time to reply.