Skip to Content Skip to Menu

[SOLVED] Gender badges

  • chanteur94
  • chanteur94
  • OFFLINE
  • Posts: 302
  • Thanks: 13
  • Karma: 1
9 years 9 months ago - 9 years 8 months ago #258865 by chanteur94
[SOLVED] Gender badges was created by chanteur94
Hi

I would like to use gender badges nophoto_m, nophoto_f, nophoto_n on my avatar field, depending of another field.

I find this :

[cb:if avatar~"/(nophoto_n|tnnophoto_n)\.png$/" && cb_gender="woman"]<img src=" www.monsite.fr/components/com_comprofiler/plugin/templates/default/images/avatar/nophoto_f.png " alt="woman" /][/cb:if]
[cb:if avatar~"/(nophoto_n|tnnophoto_n)\.png$/" && cb_gender="man"]<img src=" www.monsite.fr/components/com_comprofiler/plugin/templates/default/images/avatar/nophoto_m.png " alt="man" /][/cb:if]

I put these substitution in Layout Profil and Layout User List

I have 2 problems :
- If the user have already a photo, his photo diseappear (replace by nophoto_).
- for display user profil, the avatar is not in the right place



I notice it exist a genderbadge tutorial but i haven't found it.

Thank you.
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 9 months ago - 9 years 9 months ago #258902 by krileon
Replied by krileon on topic Gender badges
That's not a gender badges solution. That replaces the default empty image of the avatar field with a gender based one, but it won't work for layouts as it's missing a condition to show the original avatar. The following should work.

Code:
[cb:if avatar!~"/(nophoto_n|tnnophoto_n)\.png$/"][value][/cb:if] [cb:if avatar=~"/(nophoto_n|tnnophoto_n)\.png$/" and cb_gender="female"]FEMALE DEFAULT IMAGE HERE[/cb:if] [cb:if avatar=~"/(nophoto_n|tnnophoto_n)\.png$/" and cb_gender="male"]MALE DEFAULT IMAGE HERE[/cb:if]

The only tutorial we have for a gender badge (or overlay for the avatar) is the following.

www.joomlapolis.com/forum/153-professional-member-support/227139-overlay-image-over-image-tip-request?limitstart=0#252551


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: 9 years 9 months ago by krileon.
The following user(s) said Thank You: rae2

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

  • chanteur94
  • chanteur94
  • OFFLINE
  • Posts: 302
  • Thanks: 13
  • Karma: 1
9 years 9 months ago #258943 by chanteur94
Replied by chanteur94 on topic Gender badges
Hi, thank you for the answer.

Fist of all i think the regex was not correct (~ don't work... i put =~ )

Then, for List, ,no problem. It works.

For Edit profil, I cannot edit users who have nophoto_

For View Profil, when I have nophoto_ , the position of the portrait is not good. (see captures)

Thank you.
Attachments:

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48541
  • Thanks: 8290
  • Karma: 1445
9 years 9 months ago - 9 years 9 months ago #259013 by krileon
Replied by krileon on topic Gender badges
Yes, it should be =~. I've fixed my post. I've no idea if this will work with the Canvas Portrait position. The CSS for that position is extremely strict. Your img elements also need to have the correct CSS classes. Example as follows.

<img src="IMG_URL_HERE" class="cbImgPict cbFullPict img-thumbnail" />

I already have a ticket to improve the CSS for that position further so it can tolerate additional usages.


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: 9 years 9 months ago by krileon.
The following user(s) said Thank You: rae2

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

  • chanteur94
  • chanteur94
  • OFFLINE
  • Posts: 302
  • Thanks: 13
  • Karma: 1
9 years 9 months ago #259071 by chanteur94
Replied by chanteur94 on topic Gender badges
Sorry, but I don't find the correct CSS.

When I change position of 'nophoto_' (.cbPosCanvasPhoto) , whose who already have avatar change too in a wrong position.

It seems to be a position for nophoto__ and for avatars..but i don't find.

Tx

PS : notice that cbProfileTitle is also in the wrong positionw with nophoto_

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48541
  • Thanks: 8290
  • Karma: 1445
9 years 9 months ago #259085 by krileon
Replied by krileon on topic Gender badges
Sorry, I don't understand what your issue is. All of your substitutions should be in the avatar fields Profile View Layout parameter to override its display.


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