Having bodyText inside a link tag, creates several links for each paragraph.
Sorta difficult to explain the problem in the topic, but here's to hoping it is understandable.
It's not that big of a problem, but would be nice to fix. On my site i have a simple news section, and the latest news articles are displayed on the front page, which links to the full news article.
In my xslt, all the information that is displayed like title and bodytext are wrapped in a link tag. But when generated, it splits it up into several link tags, like the header and first paragraph tag in one, and a second in another which looks confusing. Any idea what could cause this? Or do i have to live with it?
Try to check the View Source output - it sounds like you're viewing the Web Inspector / Firebug output.
If the generated HTML is OK (as in what you were expecting) it's not an XSLT problem.
It *could* be related to the fact that you're truncating the bodyText property - that one contains HTML tags, right? Shouldn't you be stripping them first? Otherwise you could easily be outputting the start tag for something but have the end tag stripped, which would ruin the layout of the rest of the page...
I am watching it with firebug, and you are correct, firefox displays the code differently when seeing page source. Though it mentions it violates nesting rules. And even so, if i highlight just one part of the text shouldnt everything be highlighted since its all inside the link tag?
And of course! Stripping the html, i knew it seemed wrong to have it all the way out in the list view. God i feel so stupid for not realizing stuff like this before. Well thats what happens when you code alone :p
Well all is well and good now, now everything looks just right.
Thank you again, i hope i start to realize stuff like this by myself soon, i have been making way too many posts like this haha.
No worries, Frederik - it's how we all learned to walk, talk, code and make pancakes :-)
I'd like to mention that if you're using an HTML5 doctype, the browser should allow wrapping a link around paragraphs etc. (which was not allowed in HTML4 and prvious)
I am indeed using html5 doctype (validated and all), so maybe the "view page source" in firefox doesnt recognize it? Funny, considering the broweser itself displays html5 just fine.
But it's nice to know should i ever come across something like this again :)
Having bodyText inside a link tag, creates several links for each paragraph.
Sorta difficult to explain the problem in the topic, but here's to hoping it is understandable.
It's not that big of a problem, but would be nice to fix. On my site i have a simple news section, and the latest news articles are displayed on the front page, which links to the full news article.
In my xslt, all the information that is displayed like title and bodytext are wrapped in a link tag. But when generated, it splits it up into several link tags, like the header and first paragraph tag in one, and a second in another which looks confusing. Any idea what could cause this? Or do i have to live with it?
Hi Frederik,
Try to check the View Source output - it sounds like you're viewing the Web Inspector / Firebug output.
If the generated HTML is OK (as in what you were expecting) it's not an XSLT problem.
It *could* be related to the fact that you're truncating the bodyText property - that one contains HTML tags, right? Shouldn't you be stripping them first? Otherwise you could easily be outputting the start tag for something but have the end tag stripped, which would ruin the layout of the rest of the page...
/Chriztian
Thank you for your reply.
I am watching it with firebug, and you are correct, firefox displays the code differently when seeing page source. Though it mentions it violates nesting rules. And even so, if i highlight just one part of the text shouldnt everything be highlighted since its all inside the link tag?
And of course! Stripping the html, i knew it seemed wrong to have it all the way out in the list view. God i feel so stupid for not realizing stuff like this before. Well thats what happens when you code alone :p
Well all is well and good now, now everything looks just right.
Thank you again, i hope i start to realize stuff like this by myself soon, i have been making way too many posts like this haha.
No worries, Frederik - it's how we all learned to walk, talk, code and make pancakes :-)
I'd like to mention that if you're using an HTML5 doctype, the browser should allow wrapping a link around paragraphs etc. (which was not allowed in HTML4 and prvious)
/Chriztian
I am indeed using html5 doctype (validated and all), so maybe the "view page source" in firefox doesnt recognize it? Funny, considering the broweser itself displays html5 just fine.
But it's nice to know should i ever come across something like this again :)
is working on a reply...