rejetto forum

Comment language (HTML/BB)

Guest · 8 · 3208

0 Members and 1 Guest are viewing this topic.

Kochleffel

  • Guest
Hi,

could someone tell me which language will be used for comments when i wanna add an image or formated text inside the comment?




Offline Kochleffel

  • Occasional poster
  • *
    • Posts: 1
    • View Profile
i use your new live 3.01..


Access:
    You can access this item!
Added:
    02.07.2010 12:32:36
Hit Count:
    4
Comment:
    < strong > just a test < /strong >

i see it unformatted


Offline SilentPliz

  • Operator
  • Tireless poster
  • *****
    • Posts: 1298
  • ....... chut ! shh!
    • View Profile

Offline TSG

  • Moderator
  • Tireless poster
  • *****
    • Posts: 1935
    • View Profile
    • RAWR-Designs
That is because comments are not allowed to use HTML with Live 3.0.1.

If you had read the readme.txt about tooltips, I did outline this issue.

Code: [Select]
---------------------------------------------------------------------------
----- Tooltips.
---------------------------------------------------------------------------

  Live template has never been able to display the extra item information
  that HFS can provide (such as comments), until now.

  We have come up with a tooltip system, it integrates with the current
  interface and displays when you hover on items, or the server
  information in the footer. You can hover on the tooltip itself to pause
  and read the information.

  If you do not want tooltips you can turn them off in the
  template settings.
[color=red]
  HTML markup and Double Quotes are not allowed in the comment field
  of Live. A small HFS macro is used to prevent this issue from breaking
  the template.[/color]

Actually I will expand as to why that is here,

I use a custom attribute on each item, and fill the content of the tooltip dynamically with JavaScript. I can't use double quotes otherwise it breaks the attribute string, and I can't use HTML because it breaks the template, depends on the markup you use, but its bad to let it happen. You shouldn't need to use anything for the comments, Live is only designed to have small informative item comments anyway.
« Last Edit: September 11, 2010, 10:11:52 AM by TSG »


Offline SilentPliz

  • Operator
  • Tireless poster
  • *****
    • Posts: 1298
  • ....... chut ! shh!
    • View Profile
That is because comments are not allowed to use HTML with Live 3.0.1.
...

In this case, you should perhaps add a macro to prohibit display of comments containing <, >, </ ...
because, if a user has previously created comments containing HTML commands with HFS, the result in web page, with items containing such comments is rather ugly. :-\
« Last Edit: September 12, 2010, 04:58:13 AM by SilentPliz »


Offline TSG

  • Moderator
  • Tireless poster
  • *****
    • Posts: 1935
    • View Profile
    • RAWR-Designs
It was a quick fix, and it shows the error they have caused. I suppose a macro could be created to just remove all elements between < and >, so it simply hides it away.


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13438
    • View Profile
maybe {.replace|<|&lt;|>|&gt;|%item-comment%.}
but it shows the tags, it's ugly.

maybe {.regexp|<([^>]+>)([^<>]+)</\1|%item-comment%|replace=$2.}
it's supposed to keep only the content of the tags, but it works only with tag+closingTag.
after that you should remove remained tags

i'm not sure on the \1 and $2
just check it out, because i tested nothing i just posted
« Last Edit: September 12, 2010, 01:09:20 PM by rejetto »