Skip to Content Skip to Menu

🎃 Happy Halloween! Treat yourself with an awesome discount on memberships! Get 20% off now with code SPOOKY-2024!

[#6118] Can I Use Layout Parameters to Change Avatars in Login Module and Activity Plugin?

  • spock9458
  • spock9458
  • OFFLINE
  • Posts: 24
  • Thanks: 1
  • Karma: 3
8 years 3 months ago - 8 years 3 months ago #284078 by spock9458
I am using CB 2.0.14 with Joomla 3.6, and I have enabled the gender field which is mandatory for users. I have been successful (with help from this forum) in using Layout Parameters for the avatar field so that a male or female avatar shows up correctly in the Profile Layout, based on the setting of the gender field, using a few cb:if statements. Now I'm wondering if I can do the same thing for the Login Module, and for the Activity List, which appear to be using the generic thumbnail default avatars.

Under the Parameters tab of the avatar field, I notice an option that says: "Prepare Layouts using Content Plugins" but I don't know if this is the feature I need. If I set this to "yes" will there be options for Layout Parameters in the CB Activity plugin, and in the CB Login module? If not, is there a way to make use of thumbnail versions of my male/female avatars, depending on the gender selected in the gender field? I am including a screenshot to illustrate what I mean. Any help is greatly appreciated.

Rob Grinage
Smart Websites & Networking, LLC
Webmaster at www.nmlta.org
Attachments:
Last edit: 8 years 3 months ago by krileon. Reason: Added [#6118] tag to subject

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48459
  • Thanks: 8280
  • Karma: 1443
8 years 3 months ago #284107 by krileon
Login module, etc.. do properly output the avatar field but they're using the userlist layout which links to the users profile. You can replace this behavior, but you need to ensure you replicate the linking behavior. To do this you'd use the below inside your IF substitution.

Code:
<a href="[cb:url location="profile_view" /]">YOUR_IMAGE_HERE</a>

Basically just copy your profile value layout to userlist value layout and surround your gender specific defaults with the URL usage above.


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.

  • spock9458
  • spock9458
  • OFFLINE
  • Posts: 24
  • Thanks: 1
  • Karma: 3
8 years 3 months ago #284116 by spock9458
That worked perfectly! Now there is just one additional question - in the avatar field parameters, under Image Display, I have the Style set to "circle". This is working for uploaded photos, however for my generic male/female icons the setting is not working. (see attached screenshot) This is not a huge deal, but do you know the reason why it is behaving this way? Thanks! Rob

Rob Grinage
Smart Websites & Networking, LLC
Webmaster at www.nmlta.org
Attachments:

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48459
  • Thanks: 8280
  • Karma: 1443
8 years 3 months ago #284143 by krileon

That worked perfectly! Now there is just one additional question - in the avatar field parameters, under Image Display, I have the Style set to "circle". This is working for uploaded photos, however for my generic male/female icons the setting is not working. (see attached screenshot) This is not a huge deal, but do you know the reason why it is behaving this way? Thanks! Rob

That's just adding a CSS class to the image. Your images should properly mimic the CSS class usage. See the below for the CSS classes for each output using the circle display.

Profile Value Layout:
cbImgPict cbFullPict img-thumbnail img-circle

Userlist Value Layout:
cbImgPict cbThumbPict img-thumbnail img-circle

Those classes should be on your custom default images in their class attribute.


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.

  • spock9458
  • spock9458
  • OFFLINE
  • Posts: 24
  • Thanks: 1
  • Karma: 3
8 years 3 months ago #284157 by spock9458
Krileon - this is fantastic help! There is only one more little issue. The circle image now works almost everywhere - in the Login Module it works when the user first logs in, but then as soon as they navigate to any other page, it reverts to the square image. Please see the two screenshots for reference. Let me know if there is a fix for this. Thanks!

Rob Grinage
Smart Websites & Networking, LLC
Webmaster at www.nmlta.org
Attachments:

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48459
  • Thanks: 8280
  • Karma: 1443
8 years 3 months ago #284174 by krileon
Add <span class="cb_template">IMAGE_HERE</span> to the layouts. Looks like we're missing the default template class being around the avatar so our styling is lost. Have added a bug ticket to investigate further.

forge.joomlapolis.com/issues/6118


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