Getting at Concrete from standalone scripts

Permalink 1 user found helpful
Hi all,

I've inherited a Concrete5 site which has been fairly brutally combined with a Magento site and I've got a requirement to pull some 'latest' page data out of Concrete and include it a couple of the Magento templates.

As I see it, I have a couple of possibilities to achieve this:

1) Load the Concrete environment by some means in my external PHP script and use the framework directly

2) Create some AJAX calls to the Concrete part of the site and return the relevant HTML fragments


So, as this is my first foray into Concrete I'm really looking for some sage-like advice from the C5 community. Which of the above is likely to be the best / quickest / most efficient solution? Also any pointers as to where I should be digging in the documentation would be cool. I can see that I'm going to need to get quite familiar with Concrete, but unfortunately it's 'in at the deep end'

Once I work out the best way forward, I'll be back to pester you all for some pointers about the specifics of what I need to extract :-)

Cheers

TimboJones
 
mnakalay replied on at Permalink Reply
mnakalay
Hello,
I suggest you read those 2 threads that can put you in the right direction
https://www.concrete5.org/community/forums/customizing_c5/rest-and-t...
http://www.concrete5.org/community/forums/customizing_c5/concrete-a...

Pay special attention to
define('C5_ENVIRONMENT_ONLY', true);

As well as link to projects that did partly what you want
TimboJones replied on at Permalink Reply
TimboJones
Thanks for that, some useful information there.
TimboJones replied on at Permalink Reply
TimboJones
I've been playing with options on this and I'm currently looking at an implementation that loads the content via AJAX from a couple of custom single pages in the Concrete site.

My theory is that this has a few efficiency benefits:

1) The processing time for the page (which is generated by Magento) won't be extended by having to load the Concrete environment at the same time, so the visitor will still see the page rendering in the same time-frame as it currently does.
2) The page caching of the Magento page is unaffected by the changing Concrete content, so again, the page will be quicker and less resource-intensive
3) The web server should be able to manage the requests a bit more efficiently
4) By using a standard Concrete feature, (hopefully) the process of getting and rendering the content I want will be simpler than working externally.

Fingers crossed :-)