• Resolved bzpr123pt

    (@bzpr123pt)


    Hello!

    I would like to make a highlight based on a cell value in my table. But I don’t know how to write css :). There are accented letters in the Hungarian language. And of course there are spaces. For example:

    shortcode:

    [table id=1 highlight=”kék bársony||zöld szőnyeg” /]

    css:

    .tablepress .highlight-kék bársony {
    css: background-color: blue !important;
    }

    .tablepress .highlight-zöld szőnyeg {
    css: background-color: blue !important;
    }

    Of course, this does not work (due to accented letters or spaces or both?) . How could I solve this?

    And one more thing. I also want to display icons in the spreadsheet, but I have to not go. For example, if I type the heavy check html code into a cell, I get this message:! ERROR! illegal character.
    I see that this is only the case for codes longer than 5 digits, the shorter ones work. Is there a way to enter these icons with characters? Copying is not good, I upload the data from excel.

    Thanks for the help.

    • This topic was modified 2 years, 11 months ago by bzpr123pt.
    • This topic was modified 2 years, 11 months ago by bzpr123pt.
Viewing 13 replies - 1 through 13 (of 13 total)
  • Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    The letters with accents will normally get transformed to the letters without accent, and the space will become a hyphen. So, please try

    .tablepress .highlight-kek-barsony {
      css: background-color: blue !important;
    }
    .tablepress .highlight-zold-szonyeg {
      css: background-color: blue !important;
    }

    If that still does not work, please post a link to the page with the table where this problem happens, so that I can take a direct look. Thanks!

    For the error message: This indicates that you are using this inside a formula (or at least with a = at the beginning of the cell)?
    What exactly are you putting in the cell?

    Regards,
    Tobias

    Thread Starter bzpr123pt

    (@bzpr123pt)

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    thanks for the link!

    It looks like you’ll have to make a modification to the tablepress-cell-highlighting.php PHP file. In line 215, please change

    sanitize_title_with_dashes
    

    to

    sanitize_html_class
    

    For the other problem: What exactly did you type in the cell that now says “!ERROR! illegal character ”'”?

    Regards,
    Tobias

    Thread Starter bzpr123pt

    (@bzpr123pt)

    I also accidentally responded via email, sry.
    The link now has a print screen I hope is somewhat visible, there you can check it out. I thought it was better than describing it.

    Thread Starter bzpr123pt

    (@bzpr123pt)

    “sanitize_title_with_dashes
    to

    sanitize_html_class”

    Unfortunately it doesn’t work that way either.
    Thank you very much for your help. But don’t bother anymore and I’ll figure something out.

    Icons: Yes, you’re right, I only get an illegal caracter message with this “=”
    But if I just write e.g. & # 10003; (html-code) then I don’t get the check icon back. Just the same. However, if I write: & check; (html entity) then I get the icon back. What is the correct typing method for html code? pl: & # 10003; & # 10004; etc.? Need some other character?

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    this change was not meant to be deliver a working result immediately, it was just the next step! 🙂
    Could you please activate that link again? I’ll then find the next step.

    About the characters: Unfortunately, not all entities are possible at this time. The solution should however be easy: As you can use UTF-8 characters directly, just copy/paste the actual character and not the entity.

    Regards,
    Tobias

    Thread Starter bzpr123pt

    (@bzpr123pt)

    The link is active.

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    I only get a “It seems we can’t find what you’re looking for. Perhaps searching can help.” error?

    Regards,
    Tobias

    Thread Starter bzpr123pt

    (@bzpr123pt)

    sorry i messed up it should be good now

    Thread Starter bzpr123pt

    (@bzpr123pt)

    was set to sketch

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    thanks! Now I can see the table again.

    Ok, for the highlighting of “tét visszajár” and “félnyertes”, the CSS would be

    .tablepress .highlight-ttvisszajr {
      css: background-color: blue !important;
    }
    .tablepress .highlight-flnyertes {
      css: background-color: blue !important;
    }

    So, essentially, the special characters and the space simply don’t appear in the CSS class name.

    Regards,
    Tobias

    Thread Starter bzpr123pt

    (@bzpr123pt)

    It works, super. Thank you very much for your efforts. You give a disproportionate amount. It’s impossible to thank me enough. You do an incredible job. You are really great, even the greatest. And of course thanks for the plugin too. I have already evaluated, I gave five. I would have given six, but I couldn’t. All the best to you.

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    no problem, you are very welcome! 🙂 Good to hear that this helped!

    Best wishes,
    Tobias

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Highlight based on cell value + icons’ is closed to new replies.