Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2010-08-27 05:25:54

ashground
Member
From: Vancouver, Canada
Registered: 2005-01-07
Posts: 63
Website

Same article, multiple sections?

Has anyone thought of a clever way to include an article in multiple sections? I have a number of articles that I’d like to present in two different ways, for example at both mywebsite.com/articles/something_i_made and mywebsite.com/portfolio/something_i_made.

What makes this easy: I want everything in the first section to appear in the second. So, I’m essentially just mirroring it. I tried to do this with just a bit of .htaccess trickery, rewriting everything from /portfolio/ to /articles/ (and then using PHP to figure out what URL was called), but Textpattern doesn’t seem to enjoy that at all.

Is there a pure-Textpattern solution for this? To make one article, accessible from both sections?

Offline

#2 2010-08-27 09:32:56

rathersplendid
Plugin Author
From: London
Registered: 2008-05-02
Posts: 163
Website

Re: Same article, multiple sections?

You should use article_custom, then specify the section from where you posted the article. Here’s an example I use form time to time.

<txp:article_custom limit="5" section="blog" wraptag="ul" break="" sort="Posted asc">
	<li>
	    <h2><txp:title /></h2>
	    <txp:body />
	    <txp:article_image />		
	</li>
</txp:article_custom>

Last edited by rathersplendid (2010-08-27 09:33:30)


Admin Themes Prometheus | Stung | <txp:coder/
My Portfolio | ɹǝpuɐz.com | @MrMartineau
<txp:coder /> – Convert your designs into Textpattern-based websites
jQuery Style | @jquerystyle

Offline

#3 2010-08-27 14:55:57

ashground
Member
From: Vancouver, Canada
Registered: 2005-01-07
Posts: 63
Website

Re: Same article, multiple sections?

That isn’t quite what I’m looking for. In the end, I want the article accessible from both sections. Using article_custom, I can list the articles from one section in another, but in order to view an individual article, you need you be in the section the article was posted in. I want to have the individual article accessible from both section URLs, so both mywebsite.com/articles/individual_article and mywebsite.com/portfolio/individual_article show the article.

Offline

#4 2010-08-27 17:07:09

merz1
Member
From: Hamburg
Registered: 2006-05-04
Posts: 994
Website

Re: Same article, multiple sections?

Despite that you define a sense of doing so I don’t see a sense at all :)
The good old duplicate content argument alone should be sufficient … except that you declare noindex for one section.

By Textpattern definition sections are ‘binary’ or ‘exclusive’.
Why don’t you use two categories or multiple keywords to cover the content/semantics?


Get all online mentions of Textpattern via OPML subscription: TXP Info Sources: Textpattern RSS feeds as dynamic OPML

Offline

#5 2010-08-27 17:54:04

ashground
Member
From: Vancouver, Canada
Registered: 2005-01-07
Posts: 63
Website

Re: Same article, multiple sections?

In short, because the URIs are important to me. I essentially want to have a subsite with overlapping content — an alternate landing page for my site with its own way of viewing the content. This section is for possible clients, and I want to show them things in that very specific content without having to view it elsewhere on the site.

Offline

#6 2010-08-27 20:52:47

ashground
Member
From: Vancouver, Canada
Registered: 2005-01-07
Posts: 63
Website

Re: Same article, multiple sections?

Okay, so I found a messy URL way to do this:

mywebsite.com/?id=999&s=portfolio

… forces the display of article ID 999 using the “portfolio” section.

But is there any way to do with this clean URLs?

Offline

#7 2010-08-28 00:32:12

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: Same article, multiple sections?

I don’t really sure if you really want — nor anyone. Seems like an undesired function on TXP’s side and possible a bit of a real issue as it could be used to actually override the section and reveal content which shouldn’t be displayed. Tho, it has always been there so… yeah. Good we have txp_die.

If you do want to rewrite the messy url to clean, you can. With Rewriterules. Something for example:

RewriteRule foo/(.*)/bar ?id=$1&s=bar

Small example. Not tested. Requires that the URL has article id (foo/id/bar).

Last edited by Gocom (2010-08-28 00:54:27)

Offline

#8 2010-08-28 00:50:34

ashground
Member
From: Vancouver, Canada
Registered: 2005-01-07
Posts: 63
Website

Re: Same article, multiple sections?

Okay, so let’s take a look at the real (and functioning) test case.

My personal website is at http://aaronhildebrandt.com. I blog there, and have links to some of my work.

I’d like to have a second landing page for prospective clients. Instead of linking them to my blog, I link them to http://aaronhildebrandt.com/portfolio/ (currently unfinished, but I hacked in the functionality). It’s a more focused presentation, repackaging the content to suit the specific audience.

The content displayed by /portfolio/ belongs to the section “motion”. By displaying one article in both sections, I can keep both the blog side and the professional side updated without having to maintain multiple articles.

Everything works, except I can only hack it together using messy urls to force the section and article ID. I can probably piece together a new mod_rewrite to generate clean URLs, but so far everyone in this thread seems to think I’m committing a sin by approaching the content management this way.

So, what exactly is inherently wrong with what I’m doing? If everyone is opposed to the way I’m going about this, are there any suggestions for how I should handle separate personal / professional presentations?

Last edited by ashground (2010-08-28 00:50:59)

Offline

#9 2010-08-28 01:05:20

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: Same article, multiple sections?

ashground wrote:

So, what exactly is inherently wrong with what I’m doing? If everyone is opposed to the way I’m going about this, are there any suggestions for how I should handle separate personal / professional presentations?

Nothing really, than actually creating different content for both? I wrote an example of URL rewriting to my last post.

Or alternatively you could change the actually article pages display. For example:

<!--
	Get ?pro from the URL.
-->
<txp:variable name="pro" value='<txp:php> echo gps("pro"); </txp:php>' />
<!--
	Check the ?pro and display different content
	based on the value
-->
<txp:variable name="pro" value="">
	<!--
		Pro is empty. You are normal visitor
	-->
	Hi normal visitor. You are viewing <txp:title />
<txp:else />
	<!--
		Hello pro
	-->
	<txp:title />
	<txp:body />
</txp:variable>

Or you could use the article_custom to display the article on different sections:

<txp:article_custom id="1" />

Offline

#10 2010-08-28 01:18:21

ashground
Member
From: Vancouver, Canada
Registered: 2005-01-07
Posts: 63
Website

Re: Same article, multiple sections?

Sorry, I had read your reply in my e-mail and didn’t see your example. That’s probably the route I’ll take — though digging into TXP a bit so the URL can be the article title instead of the ID.

Offline

#11 2010-08-28 19:05:24

merz1
Member
From: Hamburg
Registered: 2006-05-04
Posts: 994
Website

Re: Same article, multiple sections?

… seems to think I’m committing a sin by approaching the content management this way.

A ‘sin’ only in the way that Textpattern is not built that way. Of course TXP is flexible enough to allow workarounds as you can see.

  • Basically the TXP sections are shut off against each other on purpose.
  • Literally the (standard) question before creating a new section is Is the content different enough?.
  • The publishing workflow is straight forward and the basic rule is Every article belongs to one section and only one section.

A CMS which allows to fulfill your needs out of the box is eg Pivot or PivotX :)


Get all online mentions of Textpattern via OPML subscription: TXP Info Sources: Textpattern RSS feeds as dynamic OPML

Offline

#12 2010-08-28 23:15:37

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: Same article, multiple sections?

@ashground:

have you think on this dirty approach?
Create a new article and in its body, you can put:

<txp:article_custom id="XXX" /><txp:body /></txp:article_custom>

The only issue I can think of is that two articles should’n use the same URL title (the one generated when publishing an article) but even if there are two articles with duplicated URLs, both may work when published on different sections.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

Board footer

Powered by FluxBB