Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-06-26 12:43:38

msteinruck
Member
Registered: 2004-07-14
Posts: 44

Two sites and swapping information...can it be done?

I’ll try to make this is as clear as possible as it’s still sort of a blur in my own mind. I have two separate TXP websites that are currently running on separate installations of TXP, including separate databases. We’ll call them Site 1 and Site 2 for illustration purposes.

Site 1 is a standard website with information on static pages that are rarely updated.

Site 2 is a blog format site.

As part of Site 1, I want to pull some of the blog posts from Site 2 without duplicating them in the Site 1 database. It would be a lot easier to post them once and have both sites updated, especially since this little feature will disappear from Site 1 as soon as it’s redesigned.

Furthermore, I don’t really want to write custom PHP scripts to pull the information from Site 2’s database. It seems like there should be an easy way to grab that information and still be able to use TXP tags.

Is there?

Offline

#2 2006-06-26 12:54:25

ramanan
Plugin Author
From: Toronto
Registered: 2004-03-12
Posts: 323
Website

Re: Two sites and swapping information...can it be done?

You’d have to write custom PHP scripts as far as I can tell. You can use the various TXP support libraries to help you out.

Out of curiosity, why do you think it should be easy to move data between two disparate TXP installs?

Offline

#3 2006-06-26 12:56:13

msteinruck
Member
Registered: 2004-07-14
Posts: 44

Re: Two sites and swapping information...can it be done?

ramanan,
That’s just the dreamworld I live in, that’s all. I don’t really think it’s that easy, I just wish it would be. :)

Offline

#4 2006-06-26 13:51:47

wet
Developer Emeritus
From: Vöcklabruck, Austria
Registered: 2005-06-06
Posts: 3,393
Website GitHub Mastodon

Re: Two sites and swapping information...can it be done?

You could pull in article from Site1 into Site2 by reading and parsing each other site’s feed. see bit_rss for a helpful plugin.

Offline

#5 2006-06-26 15:53:00

msteinruck
Member
Registered: 2004-07-14
Posts: 44

Re: Two sites and swapping information...can it be done?

wet,
Brilliant suggestion, thanks. Here’s the only problem that I’m running into now. My client wants to take only the articles published to specific categories on Site 2 and pull them into Site 1.

Here’s what I’ve done so far. Using the chh_article_custom plugin, I was able to pull those article specific to specified categories. Now I need to get an RSS feed that pulls only those articles that are being displayed.

Apparently my knowledge of RSS is lacking, because I thought that if I set up the following line, it would pull only the content printed in the rssfeed section.

<code>
<txp:feed_link label=“XML” flavor=“rss” section=“rssfeed” limit=“20” />
</code>

But that outputs nothing. All of the articles are published to the “blog” section, but I’m using rssfeed as a hidden section (not linked to anywhere on the site) to specifically pull the list of articles that I want.

Can anyone help with what I’m doing wrong?

Last edited by msteinruck (2006-06-26 15:53:14)

Offline

#6 2006-06-26 16:02:58

wet
Developer Emeritus
From: Vöcklabruck, Austria
Registered: 2005-06-06
Posts: 3,393
Website GitHub Mastodon

Re: Two sites and swapping information...can it be done?

msteinruck wrote:

Can anyone help with what I’m doing wrong?

You are probably looking at the wrong places. Wouldn’t that be a perfect fit?

Offline

#7 2006-06-26 16:32:00

msteinruck
Member
Registered: 2004-07-14
Posts: 44

Re: Two sites and swapping information...can it be done?

wet,
Does it matter that the articles are published to the “blog” section, but I’m pulling them in via an article tag to the “rssfeed” section? I doesn’t seem to be outputting any feeds when I set the section=“rssfeed”, even after I installed and am using that plugin.

Offline

#8 2006-06-26 17:16:23

wet
Developer Emeritus
From: Vöcklabruck, Austria
Registered: 2005-06-06
Posts: 3,393
Website GitHub Mastodon

Re: Two sites and swapping information...can it be done?

msteinruck wrote:

Does it matter that the articles are published to the “blog” section, but I’m pulling them in via an article tag to the “rssfeed” section?

How would you achieve this (I assume you are still talking just about the situation on Site1)? Articles are published in one section. I cannot understand how you pull articles into a second section by any means. What tags do you use to achive this with article_custom?

Why don’t you just assign a specific category to the artrcles which are designated to “cross the bridge” and use a feed for that category?

Offline

#9 2006-06-26 20:46:47

msteinruck
Member
Registered: 2004-07-14
Posts: 44

Re: Two sites and swapping information...can it be done?

Here’s what I’ve got:
<code>
<txp:chh_article_custom section=“blog” listform=“blogPosts” category=“HIVAIDS,Economic-Empowerment,Slavery-Human-Trafficking,Disaster-Recovery” />

<txp:ajw_clean_feed_link label=“XML” flavor=“rss” section=“rssfeed” />
</txp:if_section>
</code>

This pulls the articles from the section “blog” and puts them in the “rssfeeds” section. The problems with assigning a special category those posts are that: 1) The posts are already assigned to multiple categories. 2) Those categories actually appear on the site and I don’t have a way to eliminate that one particular category that would just tell the post to work in the RSS feed.

So that’s where I’m stuck. If I could just get the RSS feed to grab the articles in the rssfeed section, I’m be set, but it’s just not working!

Offline

#10 2006-06-27 04:43:11

wet
Developer Emeritus
From: Vöcklabruck, Austria
Registered: 2005-06-06
Posts: 3,393
Website GitHub Mastodon

Re: Two sites and swapping information...can it be done?

msteinruck wrote:

This pulls the articles from the section “blog” and puts them in the “rssfeeds” section.

I do not think so. ajw_clean-feeds, from my understanding, is just a way of having section- and category-specific URLs for feeds. It does not change the organisation of articles, and it does not pull anything to place it hasn’t been before.

Offline

#11 2006-06-27 13:11:02

msteinruck
Member
Registered: 2004-07-14
Posts: 44

Re: Two sites and swapping information...can it be done?

wet,
What I meant was that the code below prints out the articles as I want them in the “rssfeeds” section.

<code>
<txp:chh_article_custom section=“blog” listform=“blogPosts” category=“HIVAIDS,Economic-Empowerment,Slavery-Human-Trafficking,Disaster-Recovery” />
</code>

What I don’t understand is why, when I set the ajw_clean_feed to “section=rssfeed”, it still only pulls the last five feeds from the blog section and not the rssfeed section.

Offline

#12 2006-06-27 15:38:02

msteinruck
Member
Registered: 2004-07-14
Posts: 44

Re: Two sites and swapping information...can it be done?

I figured it out!

The biggest problem was pulling an RSS feed with articles that were assigned only to several specific categories. By using the rss_unlimited_categories plugin, I was able to use that to select the categories that would output on the page and be visible in the “Posted in” line that shows what categories the article is under.

Then using the standard Textpattern category dropdowns I assigned articles to the “RSS Feed” category because they are to be part of the RSS feed. The great part about doing it this way is that the RSS Feed category will be hidden from the “Posted in” line of text due to the use of the special rss_unlimited_categories_fileunder tag.

Okay, so from there it was just a matter of using a standard TXP feed_link tag and selecting the RSS Feed category (because the TXP feed_link looks at the TXP categories, not the ones in the new table created by the rss_unlimited_categories plugin). And then as suggested, I used the bit_rss plugin to pull the new feed into the other page.

Shew! It only two 1 1/2 days, but I got it. :)

Offline

Board footer

Powered by FluxBB