Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2007-09-21 18:09:59
- BryanA.
- Member
- From: Maryland, USA
- Registered: 2007-08-12
- Posts: 104
Pull excerpts from other databases.
This might be too ambitious – I’m already in over my head with what I’m thinking of doing, but here’s another complexity I can add.
Dinarius.com has two txp databases in two folders: /commentable and /ATF
In writing for /ATF, I use excerpts and little 75×75 images. In the end of my grand scheme, I would like to have the front page of /commentable be able to show the four or five most recent writings located in /ATF
Again, both are at different databases and txp installations. I guess I’m asking if I can call excerts and permlinks and images from other databases. I have no idea now how they’ll be displayed, but is there a txp command that does what I’m hoping for? Thanks!
Links in full…
http://www.dinarius.com/commentable
http://www.dinarius.com/ATF
Voice Actor – starting up a site for that good book stuff.
Offline
Re: Pull excerpts from other databases.
It would be easier if you put both TXP installs in the same database, using prefixes to distinguish the sets of tables from each other, because you can then use many of the built in TXP functions for querying the database.
Offline
Re: Pull excerpts from other databases.
Yep, suggesting same as ruud.
But there is simple way: RSS-feeds.
On http://www.dinarius.com/ATF:
1. Install and activate plugins mg_setheader and jad_oldposted
2. Create new page-template, like rss with code something similiar to this:
<txp:mg_setheader /><?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
<generator>http://textpattern.com/</generator>
<title><txp:sitename /></title>
<link><txp:site_url /></link>
<description><txp:site_slogan /></description>
<copyright>Copyrights (c) <txp:php>echo gmdate( "Y" );</txp:php> <txp:sitename />. All rights reserved.</copyright>
pubDate><txp:php>echo gmdate( "D, d M Y H:i:s T" );</txp:php></pubDate>
<txp:article_custom allowoverride="0" form="rss-item" limit="5" pgonly="0" sort="Posted desc" />
</channel>
</rss>
3. In article-form rss-item:
<item>
<title><txp:title /></title>
<description><![CDATA[
<txp:article_image />
<txp:excerpt />
]]></description>
<link><txp:permlink /></link>
<pubDate><txp:jad_oldposted format="D, d M Y H:i:s" /> GMT</pubDate>
<dc:creator><txp:author /></dc:creator>
<guid><txp:permlink /></guid>
</item>
4. Create new section, like rss-recent and implent it with pagetemplate named rss. You should check all options of this section off. Now it’s done. In http://www.dinarius.com/ATF/rss-recent/ you have new nice feed layout. Continue styling it, and you would recieve miracles :-)
And now put to http://www.dinarius.com/commentable:
Pull that rss feed down your page by using bit_rss
Cheers!
Offline
Pages: 1