Skip to Content Skip to Menu

Problem with code auto action...

11 years 7 months ago - 11 years 7 months ago #213241 by zaratustra27
Problem with code auto action... was created by zaratustra27
Hi,

I'd like to display an inline css in my page, based in a user field, named cb_level, I'm using an Auto Action code-type. Unfortunately, I wasn't able to make it work:

cb_level has 2 possible options: 'Parent' or 'Child'

The field is mandatory, therefore it's defined for everybody.

The idea is, after user logins, CB must detect if it's 'Parent' or 'Child' and in the second case, adds the following CSS rule:
Code:
.spacer-buy-area { display: none; }

There is no need for any action for Parent members

All users are in the 'Registered' group.

Does this rule apply for all pages in the site as long as the user keeps logged in?

The condition is [cb_level] Equal to 'Child', should Child go between quotes (it's exactly spelled as in the field definition)?

I also have Virtuemart installed and all users belongs to default shoppers group

I attach a screenshot of current auto action settings

I'm using J2.5.6, CB 1.8.1, autoactions 3.1.0 and VM 2.0.10

Thanks in advance.
Attachments:
Last edit: 11 years 7 months ago by zaratustra27.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 47955
  • Thanks: 8170
  • Karma: 1434
11 years 7 months ago #213267 by krileon
Replied by krileon on topic Re: Problem with code auto action...
Remove the quotes from 'Child', there's no need for them and will cause the value to never match. The description doesn't mean to literally put quotes, it's just one of the ways to separate it from the rest of the description.

This also will not add your CSS to every page. It actually won't add anywhere. Directly after that trigger a Redirect takes place. You need to add it to a trigger like after profile 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.

11 years 7 months ago #213375 by zaratustra27
Replied by zaratustra27 on topic Re: Problem with code auto action...
Thank you, any sugestion about how to achieve what I'm trying to do?

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 47955
  • Thanks: 8170
  • Karma: 1434
11 years 7 months ago #213433 by krileon
Replied by krileon on topic Re: Problem with code auto action...
Add CSS to every page based off a field value? You'll need a custom Joomla system plugin for this. The plugin would then need to either query the database or use CB API and grab the CB user object. You'd then do your if/else statement an append CSS as needed through API.

Aside from that CB has nothing available to do this on every page; it's possible on profile, profile edit, registration, and userlists though as there is CB triggers for their displays.


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