Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Display lists from subsite on main site
I have a site example.com
In a folder of this site, I have a sub site installed example.com/sub
This is for simplicity. example.com is the main site to attract visitors and already has lots of articles. example.com/sub is for users to log into and create their own page. They will have limited rights and pages will also be limited to certain design criteria — it is basically only content that will change.
There will probably be example.com/sub2 as another complete txp installation too, which gets data from both other sites, processes it and returns the newly processed data to those sites.
I need to display a latest list of articles for various categories and sections of example.com/sub on example.com
Is there a way to use article_custom on sub to display articles on example.com — In other words to display lists on the txp installation that is one folder up? If it can be done with txp tags and perhaps a small bit of php, that would be perfect. But I don’t know php. Plugin territory maybe? I can pay a little.
Offline
Re: Display lists from subsite on main site
You will need to install rah_external_output in the /sub
/sub2
etc
sites. Then you create a form with a name which starts with rah_eo_yourformnamehere
. Within the form you write the code you wish. The form could contain something like:
<div>
<txp:article_custom section="yoursection" category="yourcategory" break="li" wraptag="ol">
<txp:permlink><txp:title /></txp:permlink>
</txp:article_custom>
</div>
<div>
<txp:article_custom section="yourothersection" category="yourothercategory" break="li" wraptag="ol">
<txp:permlink><txp:title /></txp:permlink>
</txp:article_custom>
</div>
In the page in your main domain you want that content to appear, you add
<txp:php>echo file_get_contents('http://example.com/sub/?rah_external_output=yourformnamehere');</txp:php>
and that’s it:)
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Offline
Offline