Jump to content

Hide @ from user mentions

Featured Replies

Posted

Hi,

when I mention a user in the forum by @Member, the resulting blue box in the final post still contains the @-sign. Is it possible to hide the @-sign in the final post? This would improve the flow of reading.

Kind regards,

Stefan

Hello,

CSS

a[data-mentionid] {
    text-indent: -17px;
}

or

jquery

$('a[data-mentionid]').html($('a[data-mentionid]').html().substring(1));

 

  • Author

Hi,

thank you for the code. I've tried the jquery way, which does not work correctly. It removes the @, but multiple mentions on a page are replaced by the first username.

Kind regards,

Stefan

Edit: I've changed the jquery code from implicit to explicit iteration and this works:

$('a[data-mentionid]').each(function() {
  $(this).html($(this).html().substring(1));
});

 

Edited by Stefan Werner

  • 3 months later...
On 11/13/2018 at 8:24 PM, Stefan Werner said:

Hi,

thank you for the code. I've tried the jquery way, which does not work correctly. It removes the @, but multiple mentions on a page are replaced by the first username.

Kind regards,

Stefan

Edit: I've changed the jquery code from implicit to explicit iteration and this works:


$('a[data-mentionid]').each(function() {
  $(this).html($(this).html().substring(1));
});

 

does it still work, and if so, where should i put this code(tried globalTemplate, didn't worked)?

  • 2 weeks later...
  • Author

Hi,

On 2/14/2019 at 9:54 AM, ~Jakso.` said:

does it still work, and if so, where should i put this code(tried globalTemplate, didn't worked)?

for me it works most of the times, I'm using IPS 4.3. It does not fully work in quotes.

I've added the code to a custom js file and uploaded it to my theme ("Manage resources" -> "Add resource"). Then I included the js file in the globalTemplate

<script src='{resource="Theme.js" app="core" location="front"}'></script>

Kind regards,

Stefan

Archived

This topic is now archived and is closed to further replies.

Recently Browsing 0

  • No registered users viewing this page.