Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2011-09-26 20:36:10
- dreamer
- Member
- Registered: 2007-06-08
- Posts: 242
quick question about 404 pages
i see the cms gives us an error_default page. i simply copied the html elements from another template onto this and then inserted
<h1><txp:error_status /></h1>
<p><txp:error_message /></p>
in the content div. It is not outputting the proper stylesheet though. what’s missing?
Offline
Re: quick question about 404 pages
Have you checked that you are using absolute paths (rather than relative paths) to refer to the stylesheets? (assuming you are using static files for stylesheets)
Offline
#3 2011-09-26 21:33:52
- dreamer
- Member
- Registered: 2007-06-08
- Posts: 242
Re: quick question about 404 pages
I’m not using static file stylesheets at all.
I am literally using the same exact page template with the exception of just having the txp error message tag
Last edited by dreamer (2011-09-26 21:34:43)
Offline
Re: quick question about 404 pages
Just a quick reality check before diving any further into this: does your <txp:css>
tag have name="name-of-your-stylesheet"
in it? On error (i.e. section-less) pages there’s no concept of default style so you need to explicitly name the one you want to use.
Last edited by Bloke (2011-09-26 21:42:00)
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
#5 2011-09-26 21:45:24
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: quick question about 404 pages
The error page contains this tag: <txp:css name="default" format="link" />
. Just remove or change the attribute name="default"
if you are using another style sheet.
Edit: late again… ;)
Last edited by els (2011-09-26 21:45:45)
Offline
#6 2011-09-27 06:00:04
- dreamer
- Member
- Registered: 2007-06-08
- Posts: 242
Re: quick question about 404 pages
haha. bloke’s reality check about section-less page templates helped.
Although my stylesheet was named ‘default’ to begin with. (thought not using the default stylesheet that comes with the CSS obviously) So I don’t see how renaming it would solve the issue you guys were referring to? What I did do though is put the stylesheet outside of my if_section tag that I had in my head because as bloke referenced, an error page is not considered a section so I had to explicitly put the stylesheet outside of the if_section tag as shown below
<txp:css format="link" name="default" media="all" />
<txp:if_section name="default">
<txp:css format="link" name="home" media="all" />
<txp:else />
<txp:css format="link" name="default" media="all" />
<txp:css format="link" name="contact" media="all" />
</txp:if_section>
I tried the same technique for another site but it didn’t work. So for that site, I had to remove the entire if_section tag all together and just insert the stylesheet. I wonder why?
Offline
Pages: 1