List Info

Thread: Printable article page URLs?




Printable article page URLs?
country flaguser name
United States
2008-01-02 16:52:27
I really like Django's policy of readable URLs and one
authoritative 
page.  My question is how do I do printable versions of
those nice 
and authoritative urls?

Say I have this:
http://www.site.com
/articles/slug

I can think of two general ways:
http://www.si
te.com/print_articles/slug
http://w
ww.site.com/articles/slug?page=print

Each has issues.  The first one needs a robots.txt fix to
prevent the 
print versioned from being spidered, but at least it can be
done.   
The second one is not amenable to a robots.txt fix.  The
second one 
is also "ugly" in my subjective django-influenced
opinion.

So what do you folks suggest for printable versions of
article pages?  
Please don't suggest CSS, I know about it and it's not
really an 
option for me.

Thanks,
Mordy


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Printable article page URLs?
user name
2008-01-02 17:15:12
The second variant with GET query is the best. One resouce
has one uri
but with query you specify it's display properties.

On 3 ÑÎ×, 01:52, Mordy Ovits <mov...bloomberg.com> wrote:
> I really like Django's policy of readable URLs and one
authoritative
> page.  My question is how do I do printable versions of
those nice
> and authoritative urls?
>
> Say I have this:http://www.site.com
/articles/slug
>
> I can think of two general ways:http://www.site.com/print_art
icles/slughttp://www.site.com/articles/slug?page=print
>
> Each has issues.  The first one needs a robots.txt fix
to prevent the
> print versioned from being spidered, but at least it
can be done.
> The second one is not amenable to a robots.txt fix. 
The second one
> is also "ugly" in my subjective
django-influenced opinion.
>
> So what do you folks suggest for printable versions of
article pages?
> Please don't suggest CSS, I know about it and it's not
really an
> option for me.
>
> Thanks,
> Mordy
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Printable article page URLs?
country flaguser name
United States
2008-01-02 19:05:58
You could try not serving a different page at all: CSS can apply a different stylesheet when printing than when on the screen.š See http://www.alistapart.com/stories/goingtoprint/ for an introduction.

--Ned.
http://nedbatchelder.com

Alex Koshelev wrote:
i12g2000prf.googlegroups.com" type="cite">
The second variant with GET query is the best. One resouce has one uri
but with query you specify it's display properties.

On 3 ÑÎ×, 01:52, Mordy Ovits bloomberg.com"><mov...bloomberg.com> wrote:
  
I really like Django's policy of readable URLs and one authoritative
page.  My question is how do I do printable versions of those nice
and authoritative urls?

Say I have this:http://www.site.com/articles/slug

I can think of two general ways:http://www.site.com/print_articles/slughttp://www.site.com/articles/slug?page=print


Each has issues.  The first one needs a robots.txt fix to prevent the
print versioned from being spidered, but at least it can be done.
The second one is not amenable to a robots.txt fix.  The second one
is also "ugly" in my subjective django-influenced opinion.

So what do you folks suggest for printable versions of article pages?
Please don't suggest CSS, I know about it and it's not really an
option for me.

Thanks,
Mordy
    


  

-- 
Ned Batchelder, http://nedbatchelder.com

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Django users"; group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to django-users-unsubscribegooglegroups.com
For more options, visit this group at http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---
Re: Printable article page URLs?
country flaguser name
United States
2008-01-02 20:17:54
I also like /articles/slug/print, in that print modifies the

articles/slug url that precedes it.  Also, you can prevent
robot 
spidering other ways than robots.txt.  A <meta> tag in
the served 
content can direct the robot as well: see http://www.robotst
xt.org/meta.html

--Ned.
http://nedbatchelder.com


Mordy Ovits wrote:
> I really like Django's policy of readable URLs and one
authoritative 
> page.  My question is how do I do printable versions of
those nice 
> and authoritative urls?
>
> Say I have this:
> http://www.site.com
/articles/slug
>
> I can think of two general ways:
> http://www.si
te.com/print_articles/slug
> http://w
ww.site.com/articles/slug?page=print
>
> Each has issues.  The first one needs a robots.txt fix
to prevent the 
> print versioned from being spidered, but at least it
can be done.   
> The second one is not amenable to a robots.txt fix. 
The second one 
> is also "ugly" in my subjective
django-influenced opinion.
>
> So what do you folks suggest for printable versions of
article pages?  
> Please don't suggest CSS, I know about it and it's not
really an 
> option for me.
>
> Thanks,
> Mordy
>
>
> >
>
>   

-- 
Ned Batchelder, http://nedbatchelder.com


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Printable article page URLs?
country flaguser name
United States
2008-01-02 21:11:35
> You could try not serving a different page at all: CSS
can 
> apply a different stylesheet when printing than when on
the
> screen. See http:
//www.alistapart.com/stories/goingtoprint/
> for an introduction.

While I agree with Ned that CSS is an excellent if not the
best way to go...The OP (Mordy) wrote

>>> Please don't suggest CSS, I know about it and
it's not
>>> really an option for me.



Another option I've used is to put the content-form in the
extension.  I can then serve the resource

http://example.com/foo

as

HTML -> http://example.com/foo.ht
ml
JSON -> http://example.com/foo.js
on
XML -> http://example.com/foo.xml

CSV -> http://example.com/foo.csv

tab-delimited -> http://example.com/foo.tab

plain-text -> http://example.com/foo.txt

PDF -> http://example.com/foo.pdf

SVG -> http://example.com/foo.svg


(I usually only implement HTML and a serialized format such
as JSON/XML/tab-delimited but the above shows the
flexibility of the scheme)

If the URI is a collection, then one can have
/foos.<ext>
for represenations of the collection in <ext> format
and
then use /foos/my-foo-slug.<ext> for the contained
resources in their own flavor of format.

In the OP's case, printable versions can be URL'd as
http://example.com/foo.prn
 or
http://example.com/fo
o.prn.html or what have you.  Or maybe
use .xhtml for XHTML content, and .htm for a pre-CSS
version
that would render nicely on printers and handhelds.  One
could even use an extension like .mobi or .wap for those
content types.

-tim



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Printable article page URLs?
country flaguser name
United States
2008-01-03 06:26:52
D'oh! Sorry.š I hate those kind of replies! (At least I also contributed answering the asked questions in another post...)

--Ned.

Tim Chase wrote:
tim.thechases.com" type="cite">
You could try not serving a different page at all: CSS can 
apply a different stylesheet when printing than when on the
screen. See http://www.alistapart.com/stories/goingtoprint/
for an introduction.
    

While I agree with Ned that CSS is an excellent if not the
best way to go...The OP (Mordy) wrote

  
Please don't suggest CSS, I know about it and it's not
really an option for me.
        



Another option I've used is to put the content-form in the
extension.  I can then serve the resource

http://example.com/foo

as


HTML -> http://example.com/foo.html
JSON -> http://example.com/foo.json
XML -> http://example.com/foo.xml
CSV -> http://example.com/foo.csv
tab-delimited -> http://example.com/foo.tab
plain-text -> http://example.com/foo.txt
PDF -> http://example.com/foo.pdf
SVG -> http://example.com/foo.svg

(I usually only implement HTML and a serialized format such
as JSON/XML/tab-delimited but the above shows the
flexibility of the scheme)


If the URI is a collection, then one can have /foos.<ext>
for represenations of the collection in <ext>; format and
then use /foos/my-foo-slug.<;ext> for the contained

resources in their own flavor of format.


In the OP's case, printable versions can be URL'd as
http://example.com/foo.prn or
http://example.com/foo.prn.html or what have you.  Or maybe
use .xhtml for XHTML content, and .htm for a pre-CSS version
that would render nicely on printers and handhelds.  One
could even use an extension like .mobi or .wap for those
content types.

-tim






  

-- 
Ned Batchelder, http://nedbatchelder.com

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Django users"; group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to django-users-unsubscribegooglegroups.com
For more options, visit this group at http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---
Re: Printable article page URLs?
country flaguser name
United States
2008-01-03 08:41:58
On Wednesday 02 January 2008 06:15 pm, Alex Koshelev wrote:
> The second variant with GET query is the best. One
resouce has one
> uri but with query you specify it's display
properties.

I agree, and have modified my dev site to match that, using
Ned 
Batchelder's tip of meta tags to solve the robots issue. 
Template 
inheritance is so superb; it made implementing that both 
conditionally and universally a breeze.  I'm also
considering adding 
Tim Chase's PDF option in a later version (no database
changes!).

Thanks for all the suggestions,
Mordy

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---


[1-7]

about | contact  Other archives ( Real Estate discussion Medical topics )