Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2007-05-13 13:21:21
- arye
- Member
- Registered: 2007-05-09
- Posts: 11
404 and "<< previous"
Hi all
first thanks for your support.
2nd , i got these to annoying problems
1. whenever i write garbage in the URL to see the 404 page error i get
these error lines:
Notice: error_article_context in /home/xxx/public_html/textpattern/lib/txplib_misc.php on line 1821
Notice: error_article_context in /home/xxx/public_html/textpattern/lib/txplib_misc.php on line 1821
Notice: error_article_context in /home/xxx/public_html/textpattern/lib/txplib_misc.php on line 1821
? :/
2. In my first page i would like to have only 2 last articles. I know i can use recent articles tag but i would like to have it
with the article tag with the limit of 2
but it shows me in the end the “<< previous” link … how can i get rid of it?
thank you.
Offline
#2 2007-05-13 19:13:06
- els
- Moderator

- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: 404 and "<< previous"
arye wrote:
1. whenever i write garbage in the URL to see the 404 page error i get
these error lines:
It’s just a notice, not an error. It will go away when you change Production status to Live (in Admin > Preferences)
2. In my first page i would like to have only 2 last articles. I know i can use recent articles tag but i would like to have it
with the article tag with the limit of 2
but it shows me in the end the “<< previous” link … how can i get rid of it?
The code is on the default page template, should be something like this:
<txp:if_individual_article>
<p><txp:link_to_prev><txp:prev_title /></txp:link_to_prev>
<txp:link_to_next><txp:next_title /></txp:link_to_next></p>
<txp:else />
<p><txp:older>Previous</txp:older>
<txp:newer>Next</txp:newer></p>
</txp:if_individual_article>
Offline
#3 2007-05-13 19:16:14
- arye
- Member
- Registered: 2007-05-09
- Posts: 11
Re: 404 and "<< previous"
Thanks for you help mate, but the thing is that i want it to disappear completly no next no previous no nothing :)
Offline
#4 2007-05-13 19:21:15
- els
- Moderator

- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: 404 and "<< previous"
Okay, then just change that code to
<txp:if_individual_article>
<p><txp:link_to_prev><txp:prev_title /></txp:link_to_prev>
<txp:link_to_next><txp:next_title /></txp:link_to_next></p>
</txp:if_individual_article>
Or if you also don’t want links to previous and next articles when viewing an individual article, delete that entire piece of code :)
Offline
#5 2007-05-13 19:46:02
- arye
- Member
- Registered: 2007-05-09
- Posts: 11
Re: 404 and "<< previous"
Ok!
thanks for your help but i found the problem in the template i choose
thanks a lot man.
Offline
#6 2007-05-13 19:51:04
- arye
- Member
- Registered: 2007-05-09
- Posts: 11
Re: 404 and "<< previous"
hi again it seems i still get those error messages (as i said in the first post) and i am in LIVE mode
any ideas?
Offline
#7 2007-05-13 22:00:39
- els
- Moderator

- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: 404 and "<< previous"
Sorry for the wrong answer :/
Do these notices appear on the error page? Can you post the code in your error page?
Offline
#8 2007-05-14 00:15:01
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: 404 and "<< previous"
I just updated the lang file (go to your language tab and updated) and created a new FAQ entry.
Offline
#9 2007-05-14 08:42:36
- arye
- Member
- Registered: 2007-05-09
- Posts: 11
Re: 404 and "<< previous"
@Mary: i don’t see your post relation to my problem but thanks anyway.
@Els: you can see here:
http://www.premiumfocus.com/type-any-thing-you-want-to-get-404
see the errors?
Offline
#10 2007-05-14 15:06:19
- els
- Moderator

- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: 404 and "<< previous"
Look at the FAQ Mary pointed to. Are you using tags like <txp:body />, <txp:title /> or other tags that can only be used in an article form directly on that page? If you can’t find anything wrong, switch to debugging mode and post your tag trace.
Offline
#11 2007-05-15 06:54:33
- arye
- Member
- Registered: 2007-05-09
- Posts: 11
Re: 404 and "<< previous"
well i am sorry but i don’t get it.
I did a debug mode and it told me that i can’t use articles tag outsite of the article tag.
here is the default page source:
<?xml version=“1.0” ?>
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN”
“http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=“http://www.w3.org/1999/xhtml” xml:lang=“en” lang=“en”>
<head>
<!—charset—>
<meta http-equiv=“content-type” content=“text/html; charset=utf-8” />
<!—title—>
<txp:if_category>
<title><txp:ob1_title order=”%category,%sitename” separator=” | “/></title>
<txp:else />
<title>my title</title>
</txp:if_category>
<!—meta tags—>
<meta name=“description” content=”<txp:site_slogan />” />
<meta name=“keywords” content=”<txp:keywords />” />
<meta name=“robots” content=“index,follow” />
<meta name=“allow-search” content=“yes” />
<meta name=“expires” content=“never” />
<meta name=“audience” content=“all” />
<meta name=“author” content=”<txp:author />” />
<meta name=“publisher” content=”<txp:author />” />
<meta http-equiv=“imagetoolbar” content=“no” />
<meta name=“content-language” content=“en” />
<!—css—>
<link rel=“stylesheet” href=”<txp:css n=“default” />” type=“text/css” />
<!—feeds (rss, atom)—>
<link rel=“alternate” href=”/?rss=1” title=“XML Feed” type=“application/rss+xml” />
<link rel=“alternate” type=“application/rss+xml” title=“RSS 0.92” href=”/?rss=1” />
<link rel=“alternate” type=“application/atom+xml” title=“Atom 0.3” href=”/?atom=1” />
<!—valid textile-help—>
<meta http-equiv=“Content-Script-Type” content=“text/javascript” />
</head>
<body id=”<txp:section />”><div id=“paging”>
<ul id=“access”><!—normally hidden—>
<li><a href=”#navig” accesskey=“1” title=“Skip to main navigation”>Skip to main navigation</a></li>
<li><a href=”#content” accesskey=“2” title=“Skip to content”>Skip to content</a></li>
<li><a href=”#sidebar” accesskey=“3” title=“Skip to sidebar”>Skip to sidebar</a></li>
</ul>
<h1 id=“heading”><a href=”<txp:site_url />” title=“Link to home”><txp:sitename /></a></h1>
<div id=“fullnavig”>
<ul id=“navig”>
<li><a href=”<txp:site_url />” id=“navig1” accesskey=“h” tabindex=“1” title=“Premium Focus Home”><span class=“underline”>H</span>ome</a></li>
<li><a href=”/articles/” id=“navig2” accesskey=“a” tabindex=“2” title=“Premium Focus Articles”><span class=“underline”>A</span>rticles</a></li>
<li><a href=”/archives/” id=“navig3” accesskey=“i” tabindex=“3” title=“Premium Focus Arhives”><span class=“underline”>A</span>rchives</a></li>
<li><a href=”/contact/” id=“navig4” accesskey=“c” tabindex=“4” title=“Premium Focus Contact”><span class=“underline”>C</span>ontact</a></li>
</ul></div><!—/#fullnavig—>
<hr class=“clearleft” />
<div id=“box”>
<div id=“content”>
<txp:if_category>
<h1 id=“cat-heading”>Category <txp:category title=“1” /></h1>
</txp:if_category>
<txp:if_search>
<txp:article pgonly=“1” />
<h1><txp:search_result_count text=“result(s)” /> for “<txp:q />”</h1>
</txp:if_search>
<!—MY ARTICLE TAG …—>
<txp:article listform=“default” form=“Single” limit=“2” />
<!—MY ARTICLE TAG …—>
<txp:if_individual_article>
<h3>Read more</h3>
<p>
<txp:link_to_prev><txp:prev_title /></txp:link_to_prev>
<txp:link_to_next><txp:next_title /></txp:link_to_next>
</p>
</txp:if_individual_article>
</div><!—/#content—>
<div id=“sidebar”> <h2>Search</h2> <txp:search_input section=“search” label=”“ button=“find” />
<h2>Categories</h2> <txp:category_list class=“cats” break=“li” wraptag=“ul” /><txp:if_individual_article>
<h2>Related Posts</h2>
<txp:related_articles limit=“10” break=“li” wraptag=“ul” /></txp:if_individual_article>
<h2>Feeds</h2>
<ul class=“feeds”>
<li><txp:feed_link label=“RSS” flavor=“rss” title=“RSS-Feed” /></li>
<li><txp:feed_link label=“Atom” flavor=“atom” title=“Atom-Feed” /></li>
</ul>
</div><!—/#sidebar—>
<hr class=“clearboth” />
</div><!—/#box—>
<div id=“footer”>
<p><!—do not remove the credit links please—><a href=“http://www.textpattern.com” title=“Textpattern”>Textpattern</a>-Template <a href=“http://www.hartl.info/textpattern-templates-demo-h1/” title=“Textpattern Template h1”>h1</a> by <a href=“http://www.hartl.info” title=“Robert Hartl”>Robert Hartl</a></p>
</div><!—/#footer—>
</div><!—/#paging—>
</body>
</html>
thanks for your support :)
Offline
#12 2007-05-15 07:21:40
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: 404 and "<< previous"
The author and keywords tags are some of those tags that only work in an individual article context.
Change this:
<meta name="keywords" content="<txp:keywords />" />
<meta name="author" content="<txp:author />" />
<meta name="publisher" content="<txp:author />" />
to this:
<txp:if_individual_article>
<meta name="keywords" content="<txp:keywords />" />
<meta name="author" content="<txp:author />" />
<meta name="publisher" content="<txp:author />" />
</txp:if_individual_article>
This is a good example of why everyone should be working in the “Production mode” of “Debugging” when creating/porting templates for others to use.
Offline