This question is not answered.


Permlink Replies: 20 - Pages: 2 [ 1 2 | Next ] - Last Post: 17-Jan-2020 22:43 Last Post By: JerryM Threads: [ Previous | Next ]
JerryM

Posts: 130
Registered: 19-Apr-2004
Comment and commentShort don't process HTML
Posted: 16-Jan-2020 21:03
 
  Click to reply to this thread Reply
Hi Laszlo !

Could please make, that of comment (and commentShort) "understand" html ?
I have html tags in comments, and in album the text is not displayed formated, but as row text.

Thank You.
Jerry

<div class="comment">${commentShort}</div>


Edited by: jGromit on 16-Jan-2020 15:55, to put "code" tag on the HTML
jGromit

Posts: 7,756
Registered: 31-Jan-2006
Re: Comment and commentShort don't process HTML
Posted: 16-Jan-2020 21:55   in response to: JerryM in response to: JerryM
 
  Click to reply to this thread Reply
I just tried a comment like this in Tiger:
A comment with <a href="http://example.com">a link</a> in it.
It works as expected, both in the thumbnail caption and the slide image caption. What kind of HTML are you trying to put into a comment?

ETA: If I enter a very long comment, the ${commentShort} processing does, in fact, start ignoring the HTML.
RobM

Posts: 3,210
Registered: 4-Aug-2006
Re: Comment and commentShort don't process HTML
Posted: 16-Jan-2020 22:04   in response to: jGromit in response to: jGromit
 
  Click to reply to this thread Reply
For short comments there must be a risk of having an open tag but no close one, or even just part of an open tag - unless you count characters while writing your comments.
jGromit

Posts: 7,756
Registered: 31-Jan-2006
Re: Comment and commentShort don't process HTML
Posted: 16-Jan-2020 22:07   in response to: RobM in response to: RobM
 
  Click to reply to this thread Reply
Yes, that's the inherent problem. Could make quite a hash out of the page if the ${commentShort} contained an opening <a> tag, but no closing </a>. Ugly.
JerryM

Posts: 130
Registered: 19-Apr-2004
Re: Comment and commentShort don't process HTML
Posted: 17-Jan-2020 01:17   in response to: jGromit in response to: jGromit
 
  Click to reply to this thread Reply
"What kind of HTML are you trying to put into a comment?"

Here they are, HTML tags:
https://cross-press.net/2019/

I try to create index page of all events for each year in jAlbum, because my old self made year-pages are obsolete i.e. not responsive:
https://cross-press.net/Docu/2019.htm

I know, you gonna flame me, but I have to put header tags in description -> to have css -> to format news-texts.

Because jAlbum still don't have text editor. :'(
jGromit

Posts: 7,756
Registered: 31-Jan-2006
Re: Comment and commentShort don't process HTML
Posted: 17-Jan-2020 01:25   in response to: JerryM in response to: JerryM
 
  Click to reply to this thread Reply
Well, just tell Tiger to show the whole comment on the thumbnail:
<div class="comment">${comment}</div>
ETA: But it looks like you're not putting actual HTML into the description/comment. It looks like you're trying to load it up with raw CSS attributes. That's never going to work.

Honestly, I can't figure out what you're doing, or why you're expecting it to work.
JerryM

Posts: 130
Registered: 19-Apr-2004
Re: Comment and commentShort don't process HTML
Posted: 17-Jan-2020 09:44   in response to: jGromit in response to: jGromit
 
  Click to reply to this thread Reply
OK, this is how it looks like with unshortend comment:
https://cross-press.net/2019/

Why I put css in "Comment" ? Because in my case the Comment is news, press-text, description of an event. And for this I need some basic formatting.

As there is no html text editor in jAlbum, I use external editor to write a news and than I copy and paste it in to "Comment".
Laza

Posts: 2,284
Registered: 6-Sep-2005
Re: Comment and commentShort don't process HTML
Posted: 17-Jan-2020 09:55   in response to: JerryM in response to: JerryM
Helpful
  Click to reply to this thread Reply
Jesus Christ! :)

First off, don't try to restyle basic HTML elements (body, p, img, etc.) or you'll ruin the whole page.

CSS code only works within <style> </style> tags, must go in the HEAD section of a document.

You can safely skip those styling, I guess. If you need some styling use the following hook and add it to the "Settings / Tiger / Site / Custom code / CSS" box:
.thumbnails .column .card .caption .comment {
	.... your styling goes here ....
}
.thumbnails .column .card .caption .comment p {
	.... styling paragraphs ....
}
RobM

Posts: 3,210
Registered: 4-Aug-2006
Re: Comment and commentShort don't process HTML
Posted: 17-Jan-2020 09:58   in response to: Laza in response to: Laza
Helpful
  Click to reply to this thread Reply
JerryM

Posts: 130
Registered: 19-Apr-2004
Re: Comment and commentShort don't process HTML
Posted: 17-Jan-2020 12:05   in response to: Laza in response to: Laza
 
  Click to reply to this thread Reply
" Jesus Christ! :) "

Yes, I know dear Laszlo, my programming knowledge is horrible. :(
Realy stupid, that I didn't get an idea to put css in Custom code / CSS.

Thank You, I'll give it a try. :)
JerryM

Posts: 130
Registered: 19-Apr-2004
Re: Comment and commentShort don't process HTML
Posted: 17-Jan-2020 12:07   in response to: RobM in response to: RobM
 
  Click to reply to this thread Reply
Thank You, RobM !
jGromit

Posts: 7,756
Registered: 31-Jan-2006
Re: Comment and commentShort don't process HTML
Posted: 17-Jan-2020 12:22   in response to: JerryM in response to: JerryM
 
  Click to reply to this thread Reply
This really isn't the place to be trying to teach someone HTML and CSS, but there's a process you should be following that will make it manageable. What you're doing now is throwing an entire plate of spaghetti against the wall, and hoping that somehow, miraculously, you'll end up with an impressionist masterpiece.

First, just copy and paste the text you want to use into the comment field.
This is the first line of text.
 
The second line should be green.
 
The third line should be in 16px font.
Make the album, and look at the result. Of course, it won't look the way you want it to. The next step is to start attaching some class names to the text. You need to be careful here. You can't use a class name of comment for example - Tiger already has that class, so if you change it, you'll collide with the skin. Choose class names that are guaranteed to be unique:
This is the first line of text.
 
<span class="jm-green">The second line should be green.</span>
 
<span class="jm-size16">The third line should be in 16px font.</span>
Now you can head for Tiger > Site > Custom code > CSS, and tell the browser how to display your text:
.jm-green {color: green;}
.jm-size16 {font-size: 16px;}
Take it one step at a time, making the album and looking at the result as you go along.

ETA: BTW, no spaces in class names!!
jGromit

Posts: 7,756
Registered: 31-Jan-2006
Re: Comment and commentShort don't process HTML
Posted: 17-Jan-2020 12:26   in response to: jGromit in response to: jGromit
Correct
  Click to reply to this thread Reply
BTW, in case anyone is interested, in my own skins I use class and ID names that are designed to be unique to the skin. In Pluto, for example, almost all the class and ID names are pl-something. I do that so that users who start doing their own CSS styling don't have to worry about running into the skin's own classes.

I believe that Laza can't use the same trick because he's using some development frameworks, where that kind of customizing would be laborious, if it were possible at all. I'm doing everything by hand.
JerryM

Posts: 130
Registered: 19-Apr-2004
Re: Comment and commentShort don't process HTML
Posted: 17-Jan-2020 13:31   in response to: JerryM in response to: JerryM
 
  Click to reply to this thread Reply
Hi !

I've put CSS into "Custom CSS" and deleted header tags (it was silly!) from Comment. And it works. :)

But now there is an OPPOSITE :D :D :D problem.

When I add webpage into year-index page (nice, that it works also per drag'n dorp), jA strips HTML code from Comment and keeps just text, as You see in left column. Of course, text should look like as it is right column, where I put HTML coded Comment manually.

https://cross-press.net/2019/
JerryM

Posts: 130
Registered: 19-Apr-2004
Re: Comment and commentShort don't process HTML
Posted: 17-Jan-2020 13:35   in response to: jGromit in response to: jGromit
 
  Click to reply to this thread Reply
"This really isn't the place to be trying to teach someone HTML and CSS ..."

Thank You, dear Gee Jey, that You are doing this anyway ! <3
Legend
Forum admins
Helpful Answer
Correct Answer

Point your RSS reader here for a feed of the latest messages in all forums