Skip to Content Skip to Menu

[SOLVED] Disable javascript links in userlists

  • svictor
  • svictor
  • OFFLINE
  • Posts: 13
  • Thanks: 1
  • Karma: 1
8 years 1 month ago - 8 years 1 month ago #285909 by svictor
Hi,

In CB 2.0.15 I encounter the following problem : my userlist rows have a kind of javascript link added on their whole length. I don’t know what causes this and how to disable it. Could it be a recent update to CB ?
Before, the only links in the list were html links on the user names. Now I still have a html link on the username but also another js link on the whole line (I think the link is added in js because I can’t see it when browsing the html code). I want to disable this js link.

In case it matters, the reason I want to do this is that I display several lists on the same page using a plugin called "include component". It used to work really nice when I had only html links. But the new js links get mixed up. The js links of the last list displayed always overwrite the others. So for example the line of user 1 of first list displayed links to the profile of user 1 of third list displayed. This only happens with the js link (the html one links to the right profile). I suppose it’s easier to just disable the js link and keep just the html one. Any hints on how I can do that ?

Cheers,
Victor
Last edit: 8 years 1 month ago by krileon. Reason: Added [SOLVED] tag to subject

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48437
  • Thanks: 8275
  • Karma: 1443
8 years 1 month ago #285942 by krileon
Replied by krileon on topic Disable javascript links in userlists
CB has always had this feature. You can disable it by editing your userlist and under Parameters > Linking set "Allow Link to Profile" to "No".


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

  • svictor
  • svictor
  • OFFLINE
  • Posts: 13
  • Thanks: 1
  • Karma: 1
8 years 1 month ago - 8 years 1 month ago #286029 by svictor
Replied by svictor on topic Disable javascript links in userlists
Thanks.

Setting "Allow link to profile" to No also disables the HTML link on the name. There is no way then to access the profile from the list.

I’m a bit surprised that CB always had this feature. On this older website I use CB 2.0.10 and the lists don’t have javascript links added. BTW "Allow link to profile" is set to Yes on those lists.

The site I’m currently working on is here . The link points directly to an example of the problem. There are two lists on that page. Clicking on a row in the first list (anywhere apart from a name or an avatar), directs to a member of the second list. The HTML links on the names and the avatars work fine. On the previous website, I used exactly the same technique to display several lists on the page and it was ok because there were no javascript links. I don’t need the js links and would like to just disable them, as on the previous site.
Last edit: 8 years 1 month ago by svictor.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48437
  • Thanks: 8275
  • Karma: 1443
8 years 1 month ago #286043 by krileon
Replied by krileon on topic Disable javascript links in userlists
Again, the JS links have always been there. Turning them off has always made userlist outputs with links to also disable their links. This behavior has not changed since CB 1.x. We simply moved the parameter from CB > Configuration to the userlist parameters for list by list usage. I'm guessing your old site has modified the core code as the jQuery for linking isn't loaded on the page at all or the parameter just wasn't working right on CB 1.x.

You can try using the below CB Auto Action to block the click event from the rows though.

Global
Triggers: onBeforeDisplayUsersList
Type: Code
User: Automatic
Access: Everybody
Action
Method: jQuery
Code:
Code:
$( '.cbUserListRow' ).click( function( e ) { if ( ! ( $( e.target ).is( 'a' ) || ( $( e.target ).is( 'img' ) && $( e.target ).parent().is( 'a' ) ) || $( e.target ).hasClass( 'cbClicksInside' ) || ( $( e.target ).parents( '.cbClicksInside' ).length > 0 ) || ( $( this ).attr( 'id' ) == '' ) ) ) { e.stopImmediatePropagation(); return false; } });


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
The following user(s) said Thank You: svictor

Please Log in or Create an account to join the conversation.

  • svictor
  • svictor
  • OFFLINE
  • Posts: 13
  • Thanks: 1
  • Karma: 1
8 years 1 month ago #286089 by svictor
Replied by svictor on topic Disable javascript links in userlists
Great! That works.B)
To get the default cursor on hovering the row (rather than the hand), I added
Code:
$('.cbUserListRow').attr('style','cursor: default');
On this occasion I also discovered the usefulness of the Auto Actions. Thanks!

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum