Skip to Content Skip to Menu

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

field radio gallery & autoactions

  • escalona
  • escalona
  • OFFLINE
  • Posts: 113
  • Thanks: 5
  • Karma: 1
11 years 9 months ago #219525 by escalona
field radio gallery & autoactions was created by escalona
Hello:
I have created a field radio images.
Now I want to profile Edition take a look similar to avatar gallery.
My knowledge of css are few and with many attempts I can not.
However i have found possible solucion:
Do field radio A (for view profile):
Values
1. http://localhost/lut2.3/images/fondos/fondomadera.jpg
2 http://localhost/lut2.3/images/fondos/fondomarmol.jpg

Do field radio B (for view edit profile)
Values
1.<img title "Fondo Madera" alt "" src "http://localhost/lut2.3/images/fondos/fondomadera.jpg">
2.<img title "Fondo Marmol" alt "" src "http://localhost/lut2.3/images/fondos/fondomarmol.jpg">

Fiield A hidden in profile Edit and field B hidden in view profile.
Now I only have to create 2 autoactions that value to field A according to the value in field B.

In this way I can use field A in profile and its display in edit as avatar gallery.

BUT here is my problem:
can't work autoaction with the value <img title "Fondo Madera" alt "" src "http://localhost/lut2.3/images/fondos/fondomadera.jpg">

IF [fielname]Equal To <img title "Fondo Madera" alt "" src "http://localhost/lut2.3/images/fondos/fondomadera.jpg">
DOES NOT WORK.

QUESTIONS:
1.-Could replace <img.......... > in autoaction for something as well as 'cell 1 is the selected" ?

2.-Is this good system to create radio field images similar to avatar gallery? or this can slow down load pages?

3.-Plugin autoaction shows these notices:
Warning: array_unshift() expects parameter 1 to be array, null given in C:\xampp\htdocs\lut2.3\components\com_comprofiler\plugin\user\plug_cbautoactions\models\k2.php on line 153

Warning: reset() expects parameter 1 to be array, null given in C:\xampp\htdocs\lut2.3\administrator\components\com_comprofiler\comprofiler.class.php on line 359

Warning: Invalid argument supplied for foreach() in C:\xampp\htdocs\lut2.3\administrator\components\com_comprofiler\comprofiler.class.php on line 370

TANKS.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48454
  • Thanks: 8280
  • Karma: 1443
11 years 9 months ago #219571 by krileon
Replied by krileon on topic field radio gallery & autoactions
You don't need auto actions for this (not sure how it'd help anyway?). Create your radio field (lets call it cb_testfield) with the following values.

Value 1: fondomadera
Value 2: fondomarmol

Now use the below CSS to style the values as images.
Code:
form.cb_form .cb_form_line div .cbSnglCtrlLbl input[type="radio"][value="fondomadera"] + label { background-image: url(http://localhost/lut2.3/images/fondos/fondomadera.jpg); width: 100px; height: 100px; display: inline-block; font-size: 0; line-height: 0; } form.cb_form .cb_form_line div .cbSnglCtrlLbl input[type="radio"][value="fondomarmol"] + label { background-image: url(http://localhost/lut2.3/images/fondos/fondomarmol.jpg); width: 100px; height: 100px; display: inline-block; font-size: 0; line-height: 0; }

This will give you image selection in profile edit. You'll need to adjust the width and heights to match the size of your images though. Next you'll need a delimiter field to actually display this on profile. Example of such usage as follows.

[cb:if cb_testfield="fondomadera"]<img src="http://localhost/lut2.3/images/fondos/fondomadera.jpg" />[/cb:if]
[cb:if cb_testfield="fondomarmol"]<img src="http://localhost/lut2.3/images/fondos/fondomarmol.jpg" />[/cb:if]

The above will now display the actual image on profile based off their selection.


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.

  • escalona
  • escalona
  • OFFLINE
  • Posts: 113
  • Thanks: 5
  • Karma: 1
11 years 9 months ago #219581 by escalona
Replied by escalona on topic field radio gallery & autoactions
OK, I think I understand.
His contribution this css well.
But I want to use cb_testfield in profile as:
background-image: [cb_testfield];
I think that does not work.

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

  • escalona
  • escalona
  • OFFLINE
  • Posts: 113
  • Thanks: 5
  • Karma: 1
11 years 9 months ago #219583 by escalona
Replied by escalona on topic field radio gallery & autoactions
cooktop solution ?

form.cb_form .cb_form_line div .cbSnglCtrlLbl input[type="radio"][value=" http://localhost/lut2.3/images/fondos/fondomadera.jpg"] + label {
background-image: url(http://localhost/lut2.3/images/fondos/fondomadera.jpg);
width: 100px;
height: 100px;
display: inline-block;
font-size: 0;
line-height: 0;
}
and no need for delimiter ?

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48454
  • Thanks: 8280
  • Karma: 1443
11 years 9 months ago #219590 by krileon
Replied by krileon on topic field radio gallery & autoactions
You still need the delimiter as it's just a URL and it needs to be changed to an image. The above example is tested working, make changes as you feel necessary, but I've no intentions of coding and testing another solution sorry.


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.

  • escalona
  • escalona
  • OFFLINE
  • Posts: 113
  • Thanks: 5
  • Karma: 1
11 years 9 months ago #219600 by escalona
Replied by escalona on topic field radio gallery & autoactions
Good, his CSS was for configuration view CB Div's.
I have modified for Tab's, have proved the value as I suggest, without delimiter, and... IT WORKS perfectly.

Thanks for your help.

Finally, please, give me your opinion about this message that appears in plugin autoactions:
Warning: array_unshift() expects parameter 1 to be array, null given in C:\xampp\htdocs\lut2.3\components\com_comprofiler\plugin\user\plug_cbautoactions\models\k2.php on line 153

Warning: reset() expects parameter 1 to be array, null given in C:\xampp\htdocs\lut2.3\administrator\components\com_comprofiler\comprofiler.class.php on line 359

Warning: Invalid argument supplied for foreach() in C:\xampp\htdocs\lut2.3\administrator\components\com_comprofiler\comprofiler.class.php on line 370

TANKS.

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

Moderators: beatnantkrileon
Powered by Kunena Forum