Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-02-16 13:39:18

Peter Mount
Member
From: Melbourne, Australia
Registered: 2004-08-30
Posts: 12
Website

How do I have each page as a dynamic page?

Instead of just having one page as a blog page (and having another page show a list of articles) how do I make every page a dynamic page and have the whole site searchable?

For example I could have the following pages:

home page
about page
products page
news page

None of the pages would be static html. How do I use the txp tags to differentiate the articles for each page? I want to be able to let a user use a search box to search for text on any page.

Thanks

Offline

#2 2009-02-16 14:27:32

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: How do I have each page as a dynamic page?

  1. Setup a section for each “page” (so an “about” section, “news” section, etc).
  2. Stick an article with the actual text content in each section.
  3. Use code like the following in your “default” page template:
 <txp:if_section name="">
	<!-- if on front page, show "home" section article -->
	<txp:article_custom section="home" />
<txp:else />
	<!-- we're not on the front page, so show article for this section -->
	<txp:article />
</txp:if_section>

Offline

Board footer

Powered by FluxBB