Skip to Content Skip to Menu

[#5183] Hide Profile Fields / Tabs

9 years 8 months ago - 9 years 8 months ago #260162 by pranaydhruv
[#5183] Hide Profile Fields / Tabs was created by pranaydhruv
Hello Team,

1)I am trying to give the users an option where if they hide their Potrait field it doesn't disappear completely. It should show as an Blank Avatar that shows when no avatar image is uploaded by user. What is happening currently is that if a user hides his / Her potrait,it completely disappears even from the userlists which disturbs the page formatting.

2) How can a user Hide or show their Photos to specific users and not all?


Thanks
Pranay
Last edit: 9 years 8 months ago by krileon.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48541
  • Thanks: 8290
  • Karma: 1445
9 years 8 months ago #260167 by krileon
Replied by krileon on topic Hide Profile Fields / Tabs

1)I am trying to give the users an option where if they hide their Potrait field it doesn't disappear completely. It should show as an Blank Avatar that shows when no avatar image is uploaded by user. What is happening currently is that if a user hides his / Her potrait,it completely disappears even from the userlists which disturbs the page formatting.

CB Privacy completely removes the fields row from the API call. So it'll be as if the field doesn't exist. This is the intended behavior. For what you're wanting you may want to consider using a checkbox field and conditioning the fields display using a substitution if statement in the fields profile view layout.

2) How can a user Hide or show their Photos to specific users and not all?

If using CB Privacy there's a couple of whats to do this. Usergroup, View Access Level, or Connection Type privacy rules. Aside from that you can't hide from a specific single user.


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.

9 years 8 months ago #260291 by pranaydhruv
Replied by pranaydhruv on topic Hide Profile Fields / Tabs
Hello Kyle,

Please find my response below :-

1) I created a checkbox field but what IF statement do i use if i want to display the black default avatar image when the user does not choose any Avatar? and how can i display a Lock ikon on it to show it is hidden ?


2) How do i achieve this with Usergroup and View access level ?

Thanks
Pranay

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48541
  • Thanks: 8290
  • Karma: 1445
9 years 8 months ago #260324 by krileon
Replied by krileon on topic Hide Profile Fields / Tabs

1) I created a checkbox field but what IF statement do i use if i want to display the black default avatar image when the user does not choose any Avatar? and how can i display a Lock ikon on it to show it is hidden ?

Under Parameters there's a Layouts tab. There is where you can condition the various displays of the field. An example as follows.

Code:
[cb:if cb_avatarprivate="1"]<img src="http://YOUR_DOMAIN_HERE/components/com_comprofiler/plugin/templates/default/images/avatar/nophoto_n.png" class="cbImgPict cbFullPict img-thumbnail" />[/cb:if] [cb:if cb_avatarprivate!="1"][value][/cb:if]

Please see the below substitution tutorial for further substitution usage information.

www.joomlapolis.com/support/tutorials/107-use-cases/18353-using-substitutions-throughout-cb

2) How do i achieve this with Usergroup and View access level ?

The checkbox usage won't really work with usergroup or view access level. At any rate you can try by using an additional if substitution. Example as follows.

Code:
[cb:if viewaccesslevel !includes "2"]<img src="http://YOUR_DOMAIN_HERE/components/com_comprofiler/plugin/templates/default/images/avatar/nophoto_n.png" class="cbImgPict cbFullPict img-thumbnail" />[/cb:if] [cb:if viewaccesslevel includes "2"] [cb:if cb_avatarprivate="1"]<img src="http://YOUR_DOMAIN_HERE/components/com_comprofiler/plugin/templates/default/images/avatar/nophoto_n.png" class="cbImgPict cbFullPict img-thumbnail" />[/cb:if] [cb:if cb_avatarprivate!="1"][value][/cb:if] [/cb:if]

The above should ensure they've the view access level with an ID of 2 available to them. If not it should show the empty avatar image, but I've no idea if this will work as the above is untested and just an example.


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.

9 years 8 months ago #260352 by pranaydhruv
Replied by pranaydhruv on topic Hide Profile Fields / Tabs
Hello Kyle,

I tried the If statement but there is no change even when the user changes the potrait to Private.

http://localhost/components/com_comprofiler/plugin/templates/default/images/avatar/nophoto_n.png" class="cbImgPict cbFullPict img-thumbnail/>[/cb:if]

Also changed the position of this field to Potrait tab.

Thanks
Pranay

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48541
  • Thanks: 8290
  • Karma: 1445
9 years 8 months ago #260353 by krileon
Replied by krileon on topic Hide Profile Fields / Tabs
Yeah, you probably can't have an IF inside of an IF. Try my first example to see if that'll at least work.


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.

Moderators: beatnantkrileon
Powered by Kunena Forum