Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-01-19 17:34:12

diniscorreia
Member
From: Lisbon, Portugal
Registered: 2007-07-18
Posts: 19

A question about Section 'pages'

Hi there,

I’m building a web site for a client – very small site, with a couple of pages, most of them I have under two sections (‘About’ and ‘Recruitment’).

The thing is, I don’t really want the ‘About’ page (the section page) to have any content. Since it’s only static pages, i would prefer that the user would be redirect to, say, the ‘Facts’ article on the ‘About’ section.

I’ll probably change the main navigation to point to /about/facts/ instead of /about. Still, I’m thinking there should be an easier way to do this. Maybe a plugin that would allow us to choose which article should that section page be redirected.

My only issue with this is if the client ever messes the ‘Facts’ page – for example, changing the URL field – the navigation would be broken. Just saying this because I usually like to build a fool-proof system :)

Any thoughs? How do you people deal with this?

Thanks!

Offline

#2 2008-01-19 17:59:56

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,090
Website GitHub Mastodon Twitter

Re: A question about Section 'pages'

instead of the <txp:article /> tag you could use <txp:article_custom status="sticky" form="body" id="2" />

  • the form=“body” is an artcle form with just <txp:body /> in it
  • the article id is the id of the article you want the ‘about’ to be included.
  • sticky signifies static content

You just have to make sure that your client understands not to delete the particular article


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#3 2008-01-19 18:23:27

diniscorreia
Member
From: Lisbon, Portugal
Registered: 2007-07-18
Posts: 19

Re: A question about Section 'pages'

@colak,

That’s not really tge issue :) That’s what I have on my page template on that particular section. If I navigate to /about/ (section) it will show one of the articles on that section, however it won’t be on that article’s specific page. And my sub-navigation menu is build so that it highlights the items based on the current page.

See Jon Hick’s site – his About menu item links to /about/hicksdesing/ (‘about’ section, ‘hicksdesign’ article). If you click on it, there’s a submenu and ‘hicksdesign’ is highlighted. Yet if you just type /about/ on the URL, it will show an article from that section, but not an a single article page.

Don’t really know if I’m making myself clear :\

Offline

#4 2008-01-19 21:54:26

jm
Plugin Author
From: Missoula, MT
Registered: 2005-11-27
Posts: 1,746
Website

Re: A question about Section 'pages'

Not sure if this is what you wanted, but here’s how Hicks’ site probably works. The menu link to /about/hicksdesign/ is hardcoded HTML. To highlight the submenu, I imagine something like this is used:

<li<txp:if_article_list> class="active"</txp:if_article_list><txp:if_article_id id="X"> class="active"></txp:if_article_id>
	<txp:permlink id="X">About...</txp:permlink>
</li>

So in your case, if you want to redirect /about to /about/some-article (some-article’s ID=X), either use a meta/js/htaccess redirect, or just display the content from some-article on the page. From the page template, just use something like this:

<txp:if_article_list>
	<txp:article_custom id="X" />
<txp:else />
	<txp:article />
</txp:if_article_list>

Offline

Board footer

Powered by FluxBB