Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-11-04 22:02:52

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

Parsing URLs from an article/excerpt

Greetings,

I’m still working on my print styles and wondered if there is already a function or plugin caring for this particular problem:

I have an article with a couple of links inside the body as well as the excerpt. If I send that article to a printer, a lot of information will get lost. I’m not only talking about the links included in the text. Other html elements will also loose important information (for example the title and cite attribute).

For now I would be happy to get a grip on all included url or at least at the included links. It would be nice to have a function putting a number behind each link found inside the article, listing the actual URLs in a <ol> list at the end of the article?

Example:

A typical Lore Ipsum (1) textfragment. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.



(1) http://de.wikipedia.org/wiki/Lorem_ipsum

Any idea if there is already a solution for that problem around? Anyone willing to take up the challenge? I’m to busy at the moment with my other projects, but I would do it probably next year if there is an overwhelming public demand…

Greetings,

pepebe

Last edited by pepebe (2008-11-04 22:10:50)

Offline

#2 2008-11-04 22:16:45

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: Parsing URLs from an article/excerpt

hi pepebe,

a similar result can be achieved by using CSS pseudo-elements.
Here you have two print stylesheets that do the trick:

Hope that it helps you, in the meanwhile.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#3 2008-11-04 22:34:21

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

Re: Parsing URLs from an article/excerpt

Hi maniqui,

thanks for the links, they will surely help me to enhance my print stylesheets. Yet, as far as I can tell from a quick glance, they wont help me to solve the problem I have described above. The target of a link remains invisible to the eye. The only way to actually see them is on mouseover or by reading the source (programmers do that, others usually don’t…).

What I had on my mind was different. I’m looking for a way to automatically create footnotes at the end of an article displaying all the links included in the article’s body and excerpt. Also there should be a key. I think a superscripted number in brackets would be neat.

Example:

If you have a question about Textpattern 1 , go and visit the Textpattern Forum 2 .

At the foot of the article the function would create an ordered list including the targets of each link:

Example:

Links in this Article:
1 http://www.textpattern.com
2 http://forum.textpattern.com

I hope this explained better what I had on my mind.

CU,

pepebe

P.S. Of course it would be possible to achieve a similar (but not equal) effect with some well placed <span class=“print”> tags enclosing additional url strings. Setting .print{display:none} in all stylesheets except print.css would hide them until needed. Yet this would cause an awful lot of work which I would like to avoid…

Last edited by pepebe (2008-11-04 22:47:09)

Offline

#4 2008-11-04 22:52:42

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: Parsing URLs from an article/excerpt

Hi Pepebe,

not sure if I understand what you mean with “the target of a link remains invisible “.
This rule:

bc. /* show address after links */ a:link[href^=“http://”]:after, a[href^=“http://”]:visited:after { content: “ (” attr(href) “) “; }

makes the URL of a link to appear next to the link. Try it to see what I mean.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#5 2008-11-06 20:57:53

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

Re: Parsing URLs from an article/excerpt

Now I catch your drift. css3+. Well, Im’ sure that this will one day become a solution that will meet my customer’s needs. Yet right now I see a problem with all those people lacking the necessary nerdiness that people like us have.

In my opinion there are too many of those IE6 and 7 users around to consider this a reasonable solution. I’m also a fan of trancending css , but I also believe that it can’t be a wrong to tend for the special needs of the “user client challenged”. Apart from that I think that the links should show up at the end of an article and not in between. This is a technique that most people are familiar with and it is so much easier to read.

Thanks anyway. It’s always good to be reminded, that there are standards that will make our work one day much easier.

Kind regards,

pepebe

Offline

#6 2008-11-06 23:15:34

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Parsing URLs from an article/excerpt

A workaround would be to add the URLs as footnotes and style them with display: none; in your screen css.

Offline

#7 2008-11-07 08:53:11

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

Re: Parsing URLs from an article/excerpt

Els wrote:

A workaround would be to add the URLs as footnotes and style them with display: none; in your screen css.

This was exactly my point. Yet searching for all URLs myself, writing individual numbers behind each one and then writing a numbered list at the bottom of the article displaying the targets of the links above is not very productive. Everytime you change parts of the text, you have to start all over it again.

This was the reason why I was asking for a plugin or at least some ideas regarding this problem.

I’m searching for a plugin or dieas how to change the structure and or content of an individual article on the fly without touching the article itself.

Analyzing an article and adding stuff to it could help in many ways.

How about a function that searches through an article for specific tags (for example <h2></h2> ). First it could create a container with an unordered list of anchored links to each one of those <h2> in the article. Next it could insert a link to “top of page” BEFORE each<h2> tag. Float it to the right, give it width:50% and you have a handy internal link list. A visitor to this page could instantly get a good idea what to find there. Wouldn’t it be much more comfortable for the user?

Other idea. Perhaps interesting for commercial sites. A function that adds another article at certain places. You could use it to add an advert before each <h2> in the article. Make it context sensitive so only articles with the same category/tags will be inserted.

Any further ideas?

pepebe

Last edited by pepebe (2008-11-07 08:56:20)

Offline

#8 2008-11-07 09:49:18

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,912
Website

Re: Parsing URLs from an article/excerpt

Hi pepebe,

At the moment the only thing you can do is manually create the footnotes, but I know that’s not what you want.

There is no standard way for marking up footnotes, but the W3C does have some recommendations starting (HTML 5 is the only version to consider them to date), and I would suggest to anyone thinking of making a plugin in this direction that they employ any recommendations as much as possible.

As a side, there is a CSS2 version of maniqui’s rules (from Eric Meyer’s, Going to Print), but again they don’t work in all browsers:

a:link:after, 
a:visited:after { content: " (" attr(href) ") "; }

Offline

Board footer

Powered by FluxBB