Skip to Content Skip to Menu

[SOLVED] canvas and avatar: gender?

  • jojo12
  • jojo12
  • OFFLINE
  • Posts: 957
  • Thanks: 109
  • Karma: 25
10 years 2 months ago - 10 years 1 month ago #251211 by jojo12
[SOLVED] canvas and avatar: gender? was created by jojo12
Hi,
I need a hint, I've seen you have different background-image colors and avatars for male and female (nophoto_m, nophoto_f, nophoto_n). Earlier I used a core patch to mark the gender in the avatar. I am using the custom HTML field genderbadge (in your tutorial) with gender icons. But I would like to use these background colors. But how to? Can you give a hint. I think other would be interested too! Thanks in advance.
Last edit: 10 years 1 month ago by krileon.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48671
  • Thanks: 8312
  • Karma: 1446
10 years 2 months ago #251237 by krileon
Replied by krileon on topic canvas and avatar: gender?
Best I can suggest is to override their output using the new Layouts feature. You'd add a substitution IF statement to determine their gender then alter the display of the fields as needed. This could be just a matter of adding a CSS class so you can customize the output further using CSS based off gender or it could be used to render an entirely different field, it's up to you. I recommend playing with the Layouts parameters of your avatar and canvas fields.


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.

  • jojo12
  • jojo12
  • OFFLINE
  • Posts: 957
  • Thanks: 109
  • Karma: 25
10 years 2 months ago - 10 years 2 months ago #252094 by jojo12
Replied by jojo12 on topic canvas and avatar: gender?
Hi, I tried in canvas with:
[cb:if canvas =" mypage.ch/components/com_comprofiler/plugin/templates/default/images/canvas/nophoto_n.png " cb_gender="_UE_FEMALE"]<img src=" mypage.ch/components/com_comprofiler/plugin/templates/default/images/canvas/nophoto_f.png " alt="woman symbol" />[/cb:if]

[cb:if canvas =" mypage.ch/components/com_comprofiler/plugin/templates/default/images/canvas/nophoto_n.png " cb_gender="_UE_MALE"]<img src=" mypage.ch/components/com_comprofiler/plugin/templates/default/images/canvas/nophoto_m.png " alt="man symbol" />[/cb:if]
[cb:if canvas !=" mypage.ch/components/com_comprofiler/plugin/templates/default/images/canvas/nophoto_n.png " ] [cb:userfield field="canvas" /] [/cb:if]



it gives me the male/female canvas, when there is no personal canvas. But in the profiles with no personal canvas, there is shown NO CANVAS.

What is wrong?

EDIT:
when I create a new image field in an other tab. Then it works fine! Why not in canvas?
Last edit: 10 years 2 months ago by jojo12.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48671
  • Thanks: 8312
  • Karma: 1446
10 years 2 months ago #252137 by krileon
Replied by krileon on topic canvas and avatar: gender?
You mean your 3rd condition is failing? To condition if there is no image or there is an image please see the below.

[cb:if avatar!~"/(nophoto_n|tnnophoto_n)\.png$/"]Show if there is an Avatar[/cb:if]
[cb:if avatar~"/(nophoto_n|tnnophoto_n)\.png$/"]Show if there is not an Avatar[/cb:if]

This usage can be applied to any image field. You can also setup the canvas field to have no default image and then you could condition 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.
The following user(s) said Thank You: nant

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

  • jojo12
  • jojo12
  • OFFLINE
  • Posts: 957
  • Thanks: 109
  • Karma: 25
10 years 2 months ago - 10 years 2 months ago #252146 by jojo12
Replied by jojo12 on topic canvas and avatar: gender?
when I use this
[cb:if avatar!~"/(nophoto_n|tnnophoto_n)\.png$/"]Show if there is an Avatar[/cb:if]
[cb:if avatar~"/(nophoto_n|tnnophoto_n)\.png$/"]Show if there is not an Avatar[/cb:if]

I get an error notice:
Forbidden

You don't have permission to access /administrator/index.php on this server.
and the whole server breaks /for about 10 Minutes.
Last edit: 10 years 2 months ago by jojo12.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48671
  • Thanks: 8312
  • Karma: 1446
10 years 2 months ago #252166 by krileon
Replied by krileon on topic canvas and avatar: gender?
Your server shouldn't breaking from some regex. Are you sure you're using it exactly as I've specified above? I've retested the substitution and it's working fine. If the regex is wrong or has been escaped then you might have a fatal PHP error due to invalid regex. It could also be mod_security usage from your host causing it to break.


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.
The following user(s) said Thank You: jojo12

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

Moderators: beatnantkrileon
Powered by Kunena Forum