Skip to Content Skip to Menu

[SOLVED] CB 2.0b4 1 question 1 issue

  • KatoKalin
  • KatoKalin
  • OFFLINE
  • Posts: 265
  • Thanks: 11
  • Karma: -5
  • Add-ons
10 years 5 months ago - 10 years 4 months ago #245691 by KatoKalin
[SOLVED] CB 2.0b4 1 question 1 issue was created by KatoKalin
The question is, how does the feature to show an image instead of field value supposed to work? I have a select gender field. Field value is either male or female. If male CB to display a male icon, if female I want a female icon to get displayed.

The issue is with the userlist as well. Until know I had a description field which is a searchable text field. On user list search when I searched with empty description field all users were displayed. Now when I search with empty user field none users get displayed.
When I enter a value into the description field to look for, then it returns correctly the value. It seems that an empty field is no longer a placeholder for value all/*.
Last edit: 10 years 4 months ago by krileon.

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 #245738 by krileon
Replied by krileon on topic CB 2.0b4 1 question 1 issue

The question is, how does the feature to show an image instead of field value supposed to work? I have a select gender field. Field value is either male or female. If male CB to display a male icon, if female I want a female icon to get displayed.

It uses substitutions in the same way you'd use substitutions in a delimiter field. However the exception being you place the substitutions directly in the fields layout parameter, which alters the actual fields output anywhere that calls getFields. This allows your layout to affect all of that fields usages throughout CB (assuming the usages are using getFields). In the case of delimiter field (now Custom HTML) you had to shut off the original field and replace its output on profile using it.

The issue is with the userlist as well. Until know I had a description field which is a searchable text field. On user list search when I searched with empty description field all users were displayed. Now when I search with empty user field none users get displayed.
When I enter a value into the description field to look for, then it returns correctly the value. It seems that an empty field is no longer a placeholder for value all/*.

That shouldn't happen. Does it do this with all text fields or just that field specifically.


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.

  • KatoKalin
  • KatoKalin
  • OFFLINE
  • Posts: 265
  • Thanks: 11
  • Karma: -5
  • Add-ons
10 years 5 months ago #245769 by KatoKalin
Replied by KatoKalin on topic CB 2.0b4 1 question 1 issue

krileon wrote: It uses substitutions in the same way you'd use substitutions in a delimiter field. However the exception being you place the substitutions directly in the fields layout parameter, which alters the actual fields output anywhere that calls getFields. This allows your layout to affect all of that fields usages throughout CB (assuming the usages are using getFields). In the case of delimiter field (now Custom HTML) you had to shut off the original field and replace its output on profile using it.

This is weird because I have copied the exact code from the delimiter field into the new layout field. The code is working fine for the delimiter field but not as layout code.

krileon wrote: That shouldn't happen. Does it do this with all text fields or just that field specifically.

This happends for this specific field only so far. When I use "*" as input value then it seems that it shows all users. It seems that the asterisk is the place holder for any.

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 #245778 by krileon
Replied by krileon on topic CB 2.0b4 1 question 1 issue

This is weird because I have copied the exact code from the delimiter field into the new layout field. The code is working fine for the delimiter field but not as layout code.

Please read the description icon information carefully for layouts. The [value] substitution must be present or the layout will be ignored. We'll be reviewing before stable if this requirement should stay or not.

This happends for this specific field only so far. When I use "*" as input value then it seems that it shows all users. It seems that the asterisk is the place holder for any.

Is it a custom text field from a plugin or just a normal text field created in CB > Field Management? I've retested in both J2.5 and J3.x and could not confirm your issue. In all my tests a blank text field is ignored when searching. Using a * with the search mode set to simple any will result in the query being set to "LIKE '%'", which means it'll match any user that has a value in that 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.

  • KatoKalin
  • KatoKalin
  • OFFLINE
  • Posts: 265
  • Thanks: 11
  • Karma: -5
  • Add-ons
10 years 5 months ago #245807 by KatoKalin
Replied by KatoKalin on topic CB 2.0b4 1 question 1 issue

krileon wrote: Please read the description icon information carefully for layouts. The [value] substitution must be present or the layout will be ignored. We'll be reviewing before stable if this requirement should stay or not.

I have read it but I have no idea what the description is trying to say.

krileon wrote: Is it a custom text field from a plugin or just a normal text field created in CB > Field Management? I've retested in both J2.5 and J3.x and could not confirm your issue. In all my tests a blank text field is ignored when searching. Using a * with the search mode set to simple any will result in the query being set to "LIKE '%'", which means it'll match any user that has a value in that field.

It is a regular textarea field.

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

  • nant
  • nant
  • OFFLINE
  • Posts: 12339
  • Thanks: 1467
  • Karma: 877
10 years 4 months ago - 10 years 4 months ago #245833 by nant
Replied by nant on topic CB 2.0b4 1 question 1 issue
Here is the layout code I used to overlay a gender image over the profile avatar lower right corner.

I edited my CB avatar field -> Parameters tab -> Profile Value Layout:
Code:
<div class="cbImageOverlay"> [value] [cb:if cb_gender="male"]<img src="images/gender_male.png" class="overlayImg" alt=""/>[/cb:if] [cb:if cb_gender="female"]<img src="images/gender_female.png" class="overlayImg" alt=""/>[/cb:if] </div>

I also created a CB gender field (radio button) with acceptable values:

Value: male, Label: Male
Value: female, Label: Female

that had following layout settings (to just show a small image on profile instead of the value):

Profile Value Layout:
Code:
<!--[value]--><p>[cb:if cb_gender="male"]<img src="images/gender_male.png" alt="man symbol" />[/cb:if] [cb:if cb_gender="female"]<img src="images/gender_female.png" alt="woman symbol" />[/cb:if]</p>

As you can see in this code I actually included a commented our [value] parameter to fool the system.

I hope this helps you understand the process and the power.
Last edit: 10 years 4 months ago by nant.

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

Moderators: beatnantkrileon
Powered by Kunena Forum