Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2023-02-23 15:29:59
- lindabb
- Member
- Registered: 2023-02-17
- Posts: 132
one default page for all
Hello,
Is there any disadvantage to use just one default page for all articles including the main page ?
I use if statement to know which article to view on the default page.
example:
<if::section name="faq">
<txp:article_custom id="6" >
<h1><txp:title/></h1>
<p><txp:body/></p>
</txp:article_custom>
</if::section>
So on for other known articles, for all new articles will be listed under latest articles on same page.
Thank you
Offline
Re: one default page for all
It really depends on the page complexity. If you are comfortable using nested conditionals to handle the various situations, or you’re not using many special context like category, author, etc then a single page template can serve your site just as well as multiples.
I tend to treat the front page differently only because it tends to need different logic. Plus, it keeps the page template code shorter to have two.
Anything that is common to both templates (e.g. header, footer, scripts, etc) I use <txp:output_form>
to bring that content into both templates. And if the form itself needs to do something different depending if it’s in a front page or individual article or listing or special page context, I’ll employ conditionals there.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
#3 2023-02-23 18:06:01
- lindabb
- Member
- Registered: 2023-02-17
- Posts: 132
Re: one default page for all
Thank you
Offline
Pages: 1