Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#13 2010-11-22 22:07:37
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: How to set an error page for my case (look at the post)
So ‘ferrarired1.html’ is an article title? Don’t blame me for assuming it was a static html page ;)
Just checking if I get it right now: you want to prevent that your visitors get to see your section landing page /car-articles/
and/or that Google indexes it?
Offline
#14 2010-11-22 23:33:46
- Bongo-man
- Member
- Registered: 2009-03-18
- Posts: 243
Re: How to set an error page for my case (look at the post)
Els wrote:
So ‘ferrarired1.html’ is an article title? Don’t blame me for assuming it was a static html page ;)
In that case my web site is static, but work as a blog.
I thought in text-pattern I could create a blog in html pages, so I have create all the names as filename.html, but each page is printed by a template and show dynamic links to other articles printed by a template, like in a dynamic site. Anyway, I don’t blame you. :-)
Els wrote:
Just checking if I get it right now: you want to prevent that your visitors get to see your section landing page
/car-articles/
and/or that Google indexes it?
I need both.
Last edited by Bongo-man (2010-11-22 23:34:30)
Offline
#15 2010-11-23 00:15:53
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: How to set an error page for my case (look at the post)
I’ll start with the second part, it’s easy ;) In the <head>
section of your page:
<txp:if_section name="car-articles">
<txp:if_article_list>
<meta name="robots" content="noindex,follow" />
<txp:else />
<meta name="robots" content="index,follow" />
</txp:if_article_list>
<txp:else />
<meta name="robots" content="index,follow" />
</txp:if_section>
The part after the second <txp:else />
assumes that all other pages should be indexed.
Now for the first part, there are several options.
You can display a special article on the section landing page with an introductory text, for example like this:
<txp:if_article_list>
<txp:article_custom id="123" form="yourform" /><!-- section landing page -->
<txp:else />
<txp:article form="yourform" /><!-- individual article -->
</txp:if_article_list>
Or you can redirect the section landing page to another page with the PHP header
function inside <txp:if_section name="car-articles"><txp:if_article_list>...</txp:if_article_list></txp:if_section>
tags.
Offline
#16 2010-11-23 05:03:51
- Bongo-man
- Member
- Registered: 2009-03-18
- Posts: 243
Re: How to set an error page for my case (look at the post)
To much complex. Can you tell me what’s make static my blog? It’s only the file name?
What can I do to solve this major problem?
Thanks
p.s. perhaps explaining the problem above, I forgot to tell the page ‘/car-articles/’ has also a CSS, not only a template, as occurrs for the home page.
Last edited by Bongo-man (2010-11-23 06:08:06)
Offline
#17 2010-11-23 18:11:11
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: How to set an error page for my case (look at the post)
Maybe I wasn’t clear enough using the word ‘static’. What I meant by ‘static page’ was an actual file (example.html), uploaded to the server. Textpattern articles are not files, they are stored in the database and displayed on your site by the Txp tags you use (= PHP).
The examples I gave you are not that complicated, but I’m afraid your understanding of how Textpattern works may not be sufficient. You might want to read through a couple of tutorials first.
Offline
#18 2010-11-23 22:12:24
- Bongo-man
- Member
- Registered: 2009-03-18
- Posts: 243
Re: How to set an error page for my case (look at the post)
Yes I know they are in the DB. I’m not talking about files uploaded to the server, I’m talking of a template + CSS to type DB data by means of <txp /> expressions.
I used textpattern because I didn’t know php, but if necessary I will also study php.
Besides I don’t use all the <txp /> expressions because I’m not a web-site developer and I also use <Txp/> only when I need to customize my web-site. Perhaps many other users can identy themselves in such occurrance.
Anyway asap I will read the two tutorials.
Thank you for your help.
Offline
#19 2010-11-23 23:43:29
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: How to set an error page for my case (look at the post)
OK :) But if you are not going to use the header redirect you don’t need to know PHP ;) You can easily ‘fake’ an error page by using my first two code examples here (where article #123 contains your ‘error’ message).
Offline
#20 2010-11-24 06:47:55
- Bongo-man
- Member
- Registered: 2009-03-18
- Posts: 243
Re: How to set an error page for my case (look at the post)
Ok, thank you,
maybe I need to refresh something in <txp /> TAGs, I think I willl profit of the new TAG reference book. :-)
Bye
Offline