Skip to Content Skip to Menu

CB User List - Creating Link to Different List With Users Having Similar Field Value

  • mhs_cb
  • mhs_cb
  • OFFLINE
  • Posts: 53
  • Thanks: 0
  • Karma: 0
10 years 5 months ago #245302 by mhs_cb
I have users who share the same value for a specific field on their profile.

I would like to show this field value on a user list, and have that field value be clickable to another list that would include all users with that specific value in that field.

Example:
I have 6 users who share a the same value for a field. I do a search and find one of those users. On that user list, that specific field shows (as I have specified it to show on that list). When I click on that value it takes me to a list with all the users that have that same value.


I'm thinking I can use the "URL for search link to this list:" and append the value of this field to that link in order to open a new list.

Is there a way to do this?

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48478
  • Thanks: 8282
  • Karma: 1443
10 years 5 months ago #245365 by krileon
Depends on the type of field. If the field is a select type with limited values you can do this using IF substitutions in a delimiter field to display the field. Then add the delimiter field to your userlist. Example as follows.

Code:
[cb:if FIELD_NAME="VALUE1"] <a href="USERLIST_URL1">[FIELD_NAME]</a> [/cb:if] [cb:if FIELD_NAME="VALUE2"] <a href="USERLIST_URL2">[FIELD_NAME]</a> [/cb:if] [cb:if FIELD_NAME="VALUE3"] <a href="USERLIST_URL3">[FIELD_NAME]</a> [/cb:if]


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.

  • mhs_cb
  • mhs_cb
  • OFFLINE
  • Posts: 53
  • Thanks: 0
  • Karma: 0
10 years 5 months ago #245366 by mhs_cb
What if it's text based?

Can't I use a delimiter field and use substitutions twice? once as the text and the second as part of the href of the search URL?

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

  • mhs_cb
  • mhs_cb
  • OFFLINE
  • Posts: 53
  • Thanks: 0
  • Karma: 0
10 years 5 months ago #245372 by mhs_cb
So for example if it's a text based ID of sorts that other users share, I would render the substitution in the delimiter twice. Once as the link's text, and again as part of the search URL.

How do I make sure it renders the field value of that specific user that is being listed (not the one who is viewing? Do I have to do anything special or just use a normal substitution?

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48478
  • Thanks: 8282
  • Karma: 1443
10 years 5 months ago #245377 by krileon
If it's a text field then it won't work very well, because you're trying to condition specific userlists based off user supplied content. I suppose one way you could do this is force the userlist into search mode and re-supply the search criteria. Example as follows.

Code:
<a href="index.php?option=com_comprofiler&view=userslist&listid=LIST_ID_HERE&searchmode=1&FIELD_NAME=[FIELD_NAME]">[FIELD_NAME]</a>

This will cause the userlist with the supplied LIST_ID_HERE to be display and be pre-searched with the field of your choosing as its criteria.

How do I make sure it renders the field value of that specific user that is being listed (not the one who is viewing? Do I have to do anything special or just use a normal substitution?

Just a normal substitution in a delimiter field.


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.

  • mhs_cb
  • mhs_cb
  • OFFLINE
  • Posts: 53
  • Thanks: 0
  • Karma: 0
10 years 5 months ago #245378 by mhs_cb
In theory that's exactly what I wanted and I would think it will work fine. Why do you say it won't work very well? Anything I should be cautious of?

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

Moderators: beatnantkrileon
Powered by Kunena Forum