Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-11-04 15:06:29

pepebe
Member
From: Mannheim, Germany
Registered: 2005-02-07
Posts: 74

URL and Stylesheet

Quick question about urls and stylesheets.

Let’s say that I have an article “A” in “section a” with stylesheet “a”. Now I want to create a link, that opens article “A” with stylesheet “g” instead, ignoring the standard stylesheet for “A” section. Is there any way to do that?

The reason for my question is that I want to add a link to each article that lead to new page showing a print layout of the article in question.

Thanks,
pepebe

P.S. I don’t want to insult anybody here, but this is nagging me for quite a long time and so I have to say it: The search function in this forum s****! Really. I’m either too dumb to use the “advanced search” feature properly or it just isn’t “advanced” enough for my humble needs. Example: As far as I understand there is no way to search for a word or expression in a threads subject. Wouldn’t it be wonderful to search for the word stylesheet in the subject of postings? I’m sure it wound cut down search time (and therefore querries) by half…

.

Offline

#2 2008-11-04 15:43:10

pepebe
Member
From: Mannheim, Germany
Registered: 2005-02-07
Posts: 74

Re: URL and Stylesheet

Well, after using google search to search the forum, I found this post by Gocom in the archive. This was exactly what I was looking for.

Thanks, pepebe

Offline

#3 2008-11-04 16:42:12

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,091
Website GitHub Mastodon Twitter

Re: URL and Stylesheet

I know you found the php answer but would the txp one work for you?


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#4 2008-11-04 21:17:43

pepebe
Member
From: Mannheim, Germany
Registered: 2005-02-07
Posts: 74

Re: URL and Stylesheet

Greetings colak

<txp:if_article_id> ? I don’t understand what are you aiming for. I’m curious, please explain.

Thanks, pepebe

Offline

#5 2008-11-05 01:34:58

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: URL and Stylesheet

pepebe, colak is just misunderstanding your question, methinks :) <txp:if_article_id> has nothing to do with the case.

But with the help of rah_if_gps we get:

<txp:rah_if_gps att="style" val="print">
	<link rel="stylesheet" href="path/to/print.css" media="all" />
<txp:else />
	<link rel="stylesheet" href="path/to/default.css" media="all" />
</txp:rah_if_gps>

And then we could access print styled page by linking it with ?style=print (or adding that end of the URL). In example <a href="?style=print">View print version</a>

Hope that helps :P

Last edited by Gocom (2008-11-05 01:36:00)

Offline

#6 2008-11-05 06:24:31

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,091
Website GitHub Mastodon Twitter

Re: URL and Stylesheet

yep… Remider to myself. Read the forum post twice before posting:)


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#7 2008-11-05 12:53:09

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: URL and Stylesheet

Um… why not use media=“print” in the style sheet, so the user can do CTRL+P to print the page in the correct print style while still viewing using the normal style in the browser?

Offline

#8 2008-11-05 18:16:16

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: URL and Stylesheet

Um… why not use media=“print” in the style sheet, so the user can do CTRL+P to print the page in the correct print style while still viewing using the normal style in the browser?

Possibly because the idea is to provide page that looks like paper/pdf/A4 ;) – with pressing the link it opens the page inside the default browser window and doesn’t send it to the printer.

Offline

#9 2008-11-06 21:36:26

pepebe
Member
From: Mannheim, Germany
Registered: 2005-02-07
Posts: 74

Re: URL and Stylesheet

Your right Gocom. I was also thinking about different print layouts you could choose from.
Of course pdf, but also

  • Full color print
  • Optimized for grayscale
  • With/Without images
  • Perhaps even different paper formats

More ideas?

It’s just an idea right now, but personaly I prefer to have things on good old paper. It’s more reliable and you can take it with you to the bathroom, to the subway, etc.

Pen and paper addict that I am, I would be happy to have the choice.

pepebe

Last edited by pepebe (2008-11-06 21:37:51)

Offline

Board footer

Powered by FluxBB