Post subject: Share page content between sites using RSS
Posted: Wed Jun 11, 2008 10:59 am
Power Poster
Joined: Thu Jan 26, 2006 11:46 am Posts: 700
Share any page's {content} block with other site(s) via RSS.
In the absence of multisite capabilities and until that feature is added at some point in 2.0 (see roadmap); I've come up with a Quick-and-Dirty way to share (duplicate) a page's content between different sites using some template modifications and RSS.
Test configuration: Apache 1.3.xx and PHP/cgi 5.1.xx on Linux 2.6.xx running CMSMS 1.3 with mod_rewrite enabled.
Notes:
1. You need to know what IP address your ("destination") server uses for outgoing http requests. We will be modifying the output template(s) on the "origin" site based upon this IP.
2. May require slight modifications to work on configurations other than above.
3. The entire content of the "origin" page's {content} block (as generated and output) is inserted into the resulting RSS feed. As this includes links, you need to ensure you're using FULL domain/path in your links (including images) pointing elsewhere on the "origin" site.
4. What will happen on pages with forms or other complex content is unknown and untested. Has been tested with simple static content (html, text, images) only.
Main use here is a half-dozen sites of same client with shared pages that include things like contact and company info, a list of events (in static html), some simple online shopping pages (that use paypal cart), etc.. This shared content can now be edited via only ONE of the CMSMS installs instead of having to copy/paste it into the other five after every editing session.
Step 1. Modify site template(s) in ORIGIN site's CMSMS:
At the very beginning, before and on the SAME line as DOCTYPE if you have one, add:
Code:
{if $smarty.server.REMOTE_ADDR neq 'xx.xx.xx.xx'}
where xx.xx.xx.xx is the IP address the REQUESTING server's http requests come from.
At the very end, starting after and on the SAME line as your closing