Skip to Content Skip to Menu

[SOLVED] A link on profile page for a certain user only

  • krileon
  • krileon
  • ONLINE
  • Posts: 48444
  • Thanks: 8277
  • Karma: 1443
12 years 5 months ago #200011 by krileon
The field it self can't be conditioned like that. Only the fields contents. I suppose you can set CB to hide empty fields and see if that does the trick within CB > Configuration > User Profile.


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.

12 years 5 months ago #200025 by TailorMadeSites
Replied by TailorMadeSites on topic Re: A link on profile page for a certain user only
What I made is [cb:if user_id="42"]<a href="#">link here</a>[/cb:if], and I setted the the title of the field not to be shown , so basicaly ONLY the <a href="#">link</a> is shown in profile, no title no nothing...

So is there a way so ONLY the user, in this example (id="42") can see this link, and NOBODY else who visits his profile can see it ?

Thanks

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48444
  • Thanks: 8277
  • Karma: 1443
12 years 5 months ago - 12 years 5 months ago #200029 by krileon
Yes, as my tutorial explains you can use the below.

[cb:if user_id="myid"]This is Me being displayed.[/cb:if]

Believe you can also restrict it certain users with the id column (e.g. id="42"), but haven't tried.

If you need to condition based off the person displayed and the person viewing you can do a nested IF substitution. Example as follows.

[cb:if user_id="myid"][cb:if user_id="42" or user_id="48" or user_id="50"]CONTENT[/cb:if][/cb:if]

Please review the substitution tutorial found in Tutorials within my signature.


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.
Last edit: 12 years 5 months ago by krileon.
The following user(s) said Thank You: TailorMadeSites

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

12 years 5 months ago #200040 by TailorMadeSites
Replied by TailorMadeSites on topic Re: A link on profile page for a certain user only
Thanks a lot, it works how I need now. Did like you wrote:

[cb:if user_id="myid"][cb:if user_id="42"]CONTENT[/cb:if][/cb:if]

and the content is viewable ONLY to the person with id="42" now.

Thank you

PS. Writing only id="42" works too

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

Moderators: beatnantkrileon
Powered by Kunena Forum