Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-10-27 23:21:06

driz
Member
From: Huddersfield, UK
Registered: 2008-03-18
Posts: 441
Website

Messy Structure

I was just thinking about this, but doesn’t Textpattern make sites kind of messy. I mean say I created an about page, and how some content it saying About, Team, FAQ’s.

I would get domain.com/about/ with this content on
BUT

I would also get domain.com/about/team and that would display the actual team article,

sooo you end up with two addresses for the same content? Is their a way to just have /about/ ???


~ Cameron

Offline

#2 2008-10-28 00:08:40

tye
Member
From: Pottsville, NSW
Registered: 2005-07-06
Posts: 859
Website

Re: Messy Structure

Have a look at ‘Permanent link mode’ in your basic preferences – you can just use the ‘/title’ setting

Offline

#3 2008-10-28 01:04:56

johnstephens
Plugin Author
From: Woodbridge, VA
Registered: 2008-06-01
Posts: 999
Website

Re: Messy Structure

My site uses /section/title/ for permanent link mode, and I get the landing page exactly right with no duplicate content.

Here’s how it works:

<txp:if_article_list>
	<txp:article limit="1" status="sticky" />
	<txp:else/>
	<txp:article />
</txp:if_article_list>

On my about page, mysite.dev/about/, I see only the “sticky” content— an article I’ve designated for the landing page. For some sections, that’s all.

But maybe I also have other pages in that section: mysite.dev/about/john-stephens, and mysite.dev/about/team— for those pages, the if_article_list evaluates false, so the “sticky” content is skipped, and I get only the individual article content.

My site will go online soon, I promise. The live version is a bit embarrassing, but I can’t resist tweaking my development version further rather than posting it online.

Last edited by johnstephens (2008-10-28 01:05:10)

Offline

#4 2008-10-30 10:14:00

driz
Member
From: Huddersfield, UK
Registered: 2008-03-18
Posts: 441
Website

Re: Messy Structure

If I have a page called /about and have a sticky article called ‘about company’ and ONLY want that article to show at that about page.
At the moment it can be accessed at both /about and /about/about-company

So the content can be accessed at two links. How do I fix this? x


~ Cameron

Offline

#5 2008-10-30 13:42:33

driz
Member
From: Huddersfield, UK
Registered: 2008-03-18
Posts: 441
Website

Re: Messy Structure

Any updates?


~ Cameron

Offline

#6 2008-10-30 13:52:51

kevinpotts
Member
From: Ghost Coast
Registered: 2004-12-07
Posts: 370

Re: Messy Structure

driz wrote:

If I have a page called /about and have a sticky article called ‘about company’ and ONLY want that article to show at that about page.
At the moment it can be accessed at both /about and /about/about-company

So the content can be accessed at two links. How do I fix this? x

I’m not sure you can “fix” this, as it is not really broken. The easiest thing to do is just not link to that article directly — just link to the section landing page (like using <txp:section /> versus <txp:permlink />). I understand your confusion, though, as I run into the same issue on almost all of my sites. Several time I have set up permanent redirects in .htaccess to manually force the issue. For instance:

Redirect 301 /about/about-company http://www.yoursite.com/about

That way anyone hitting /about/about-company (like from a search result) will be immediately routed to /about.

If someone has a more elegant solution for this, I am all ears.

Last edited by kevinpotts (2008-10-30 13:54:29)


Kevin
(graphicpush)

Offline

#7 2008-10-30 13:56:32

driz
Member
From: Huddersfield, UK
Registered: 2008-03-18
Posts: 441
Website

Re: Messy Structure

^^^

Yeah it totally throws out the structure, I mean if my about page has two links, then that’s confusing as hell! Surely their is a semantic way of getting around this???

The only way I can think of is to make sections into a hub so you show the excerpt and then say add a link saying read more, and then followed by a team link, that sort of thing. It wouldn’t work in every situation, sometimes you might want that article and nothing else, and NOT have no links showing the exact same content. x

Last edited by driz (2008-10-30 14:05:43)


~ Cameron

Offline

#8 2008-10-30 14:37:14

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

Re: Messy Structure

and NOT have no links showing the exact same content

As kevinpotts suggested, the simplest way is just not linking to that page. If someone discovers the permanent link, well, then they can access to it and link to it too, if they want. Nothing to do about that, currently, from inside Texpattern.
But then, you can also use kevinpotts’s trick on .htaccess.

It may be an interesting (although confusing) feature: to disable the permanent link for particular articles. But no, I don’t think it’s a good idea, really.

Finally, an interesting read: demystifying duplicate content penalty


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#9 2008-10-30 14:56:43

johnstephens
Plugin Author
From: Woodbridge, VA
Registered: 2008-06-01
Posts: 999
Website

Re: Messy Structure

Maybe I don’t understand the problem— what I think you mean is that you want your about section page to display the content of one article without having that article content elsewhere. Is that right?

If that’s the case, this should work:

I make an article called “Company” and mark it as “sticky” in the right column of the Write tab, assign it to the section “about”, and click publish.

In my “about” page, I use this article tag: <txp:article limit="1" status="sticky" />

And I when I navigate to mysite.dev/about I see the “Company” article I posted. If I navigate to mysite.dev/about/company, there’s nothing there— I see a 404 page.

Does that solve your problem?

This solution also works if your section has additional articles that you want to give there own pages— just use the code block I posted above on your “about” page. mysite.dev/about will display only the article you mark as sticky, and any articles marked as “live” will appear at their own URLs:

  • About (Company article, sticky): mysite.dev/about
  • About our Team (Team article, live): mysite.dev/about/team
  • About me (Bio article, live): mysite.dev/about/me

You can even use the same page template for sections that have just one sticky article and sections with multiple articles— using the code block above in tandem with a conditional tag that will output a list of other articles in you need one (in 4.0.6, I would use the plugin chh_if_data, but in 4.0.7 you can use Textpattern’s if_variable tag).

Offline

#10 2008-10-30 14:59:24

johnstephens
Plugin Author
From: Woodbridge, VA
Registered: 2008-06-01
Posts: 999
Website

Re: Messy Structure

maniqui wrote:

It may be an interesting (although confusing) feature: to disable the permanent link for particular articles. But no, I don’t think it’s a good idea, really.

Seems to me the permanent link is automatically disabled for sticky articles, when your template for individual article pages doesn’t designate “sticky.”

Offline

#11 2008-10-30 15:05:14

johnstephens
Plugin Author
From: Woodbridge, VA
Registered: 2008-06-01
Posts: 999
Website

Re: Messy Structure

Okay I’ve read Kevin’s post more carefully, and I think I see the problem better.

Using this:

<txp:if_article_list>
	<txp:article limit="1" status="sticky" />
	<txp:else/>
	<txp:article />
</txp:if_article_list>

will disable permanent links to “sticky” articles, because the individual article can only be displayed by the <txp:article /> tag after the else statement. Does that make sense?

Last edited by johnstephens (2008-10-30 15:05:33)

Offline

#12 2008-10-30 15:08:07

johnstephens
Plugin Author
From: Woodbridge, VA
Registered: 2008-06-01
Posts: 999
Website

Re: Messy Structure

The same thing might be achieved by this (opposite order):

<txp:if_individual_article>
	<txp:article />
	<txp:else/>
	<txp:article limit="1" status="sticky" />
</txp:if_individual_article>

Offline

Board footer

Powered by FluxBB