[#5600] use the Request Connection Javascript link for other uses

8 years 5 months ago #273812 by krileon
That's the field edit view. You need to add those substitutions to a Custom HTML field then view the users profile. You'll then be able to see what value CB Conditional will see and ultimately try to condition against. CB Conditional will always fallback to database value if it fails to find a value and since CB Privacy doesn't actually empty the field CB Conditional may act as if the field was never hidden. Specifically add the below substitutions for example.

[avatar]
<br />
[cb:userfield field="avatar" /]
<br />
[cb:usertab tab="11" /]

Now view a users profile that has avatar or that tab hidden. This will give you an idea of what that field or tab is outputting so it can be conditioned against. As you're using CB Privacy to hide the fields you have to condition against the profile view of the field so userfield substitutions will likely have to be used and the below might work.

Display: Field conditional self
Field: Custom > Value
Value: [cb:userfield field="avatar" /]
Translate Value: No
Operator: Equal To
Value: (leave empty)
Translate Value: No
Mode: Show

Again though you're using 2 different condition based plugins to control field visibility and this likely will not 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 to join the conversation.

8 years 5 months ago - 8 years 5 months ago #273869 by pranaydhruv
Hello Kyle,

I tried to substitute [cb:usertab tab="11" /]in HTML Field and check the output on the Profile page and it breaks down the page the page gets repeated, though it does display the tab somewhere in the middle.
I tried to substitute these values and get the error in screenshot :-

[cb:usertab tab="11" user="REPLACEMENT" /]

if i can substitute the tab in HTML field then instead of using conditional can't i just use some PHP if syntax directly in the custom HTML field and display the button links from there ? instead of conditioning the HTML filed i can then condition the specific button or links ?

Thanks
Pranay

Thanks
Pranay
Attachments:

Please Log in to join the conversation.

8 years 5 months ago #273896 by krileon

I tried to substitute [cb:usertab tab="11" /]in HTML Field and check the output on the Profile page and it breaks down the page the page gets repeated, though it does display the tab somewhere in the middle.
I tried to substitute these values and get the error in screenshot :-

That's because the tab substitution is outputting the tab it self. If you put the Custom HTML field on the tab you're substituting then you're getting stuck in a loop.

if i can substitute the tab in HTML field then instead of using conditional can't i just use some PHP if syntax directly in the custom HTML field and display the button links from there ? instead of conditioning the HTML filed i can then condition the specific button or links ?

A substitution IF usage is going to see the same values as the CB Conditional usage so it really doesn't matter which you use. CB Privacy does not reset a fields value, but just hides its HTML output. This makes conditioning against it difficult. Most importantly you're trying to condition off the output of the avatar field and you need to review that output using a Custom HTML field with the above substitution usage in my previous reply.

I don't know what more to suggest. Please PM backend super administrator login credentials and include details of the fields you're conditioning and will take a look.


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 to join the conversation.

8 years 5 months ago #273924 by krileon
You're conditioning the same field 3 times. As explained earlier you can not do this. A field can only be conditioned once by CB Conditionals. Remove all the conditions being applied except 1. There also appears to be a space before your avatar substitution condition so it's currently set to " [cb:userfield field="avatar" /]", which could cause the is empty condition to always fail. The avatar substitution condition should be the only condition applied to the Custom HTML field that displays your PM link.

Is it possible to use IF statements to Hide and show the Buttons instead of the whole field?

Yes, you can use IF substitutions directly in a Custom HTML field (or anywhere substitutions are supported). Please see the substitution tutorial below. Several example usages at bottom of the page.

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

Is it possible to put the PHP code in the custom HTML field directly.

No, not without a 3rd party Joomla content plugin that can parse inline PHP. You'd then need to enable content prepare under the Custom HTML fields parameters.


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 to join the conversation.

8 years 5 months ago - 8 years 5 months ago #273937 by pranaydhruv
Dear Kyle,

were you able to check the privacy issue also? it's only workign for one user who can Hide parts of his profile and not other.

I am using this in the custom HTML field,andthe avatar field is hidden, but the button/ link is not visible. I have also enabled Content prepare option. BTW - i am using Sourcerer to parse the PHP code in Joomla.

<p>{source}</p>
<p>[cb:if avatar=""]print<a href="index.php?option=com_comprofiler&amp;view=pluginclass&amp;plugin=cbautoactions&amp;action=action&amp;actions=47&amp;Itemid=488&amp;users=[user_id]">PM</a>[/cb:if] {/source}</p>

Thanks
Pranay
Attachments:

Please Log in to join the conversation.

8 years 5 months ago #273969 by krileon

were you able to check the privacy issue also? it's only workign for one user who can Hide parts of his profile and not other.

What do you mean by it's not working? They can't select privacy options at all? The privacy option selected doesn't save? The privacy option selected doesn't even work? Please note CB Moderators and the profile owner themselves are exempt and can always see tabs/fields regardless of privacy setting. As you did not give super administrator permissions there's only so much I can review and test (e.g. I've no access to CB > Configuration to see if moderator view access level is set incorrectly).

I am using this in the custom HTML field,andthe avatar field is hidden, but the button/ link is not visible. I have also enabled Content prepare option. BTW - i am using Sourcerer to parse the PHP code in Joomla.

If substitutions use raw database value. They don't do access checks. So your condition will always fail because it will always have a value if an avatar has been uploaded otherwise it needs to condition against the default image as follows.

[cb:if avatar=~"/(nophoto_n|tnnophoto_n)\.png$/" or avatar=""]CONTENT[/cb:if]

Again, I doubt combining the two is going to work and that appears to be exactly the case. You most likely need to have a checkbox field that you can condition against to hide the avatar and show the PM link.


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 to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.195 seconds

Facebook Twitter LinkedIn