Skip to Content Skip to Menu

Using Cb autoaction to modify CSS style

  • chanteur94
  • chanteur94
  • OFFLINE
  • Posts: 302
  • Thanks: 13
  • Karma: 1
4 years 5 months ago #318083 by chanteur94
Using Cb autoaction to modify CSS style was created by chanteur94
Hi

Is it possible to modify a CSS STYLE after CB LOGIN for example ?


Example : OnAfterLogin, #mypersonalid { display:none ; }

Thank you.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48437
  • Thanks: 8275
  • Karma: 1443
4 years 5 months ago #318099 by krileon
Replied by krileon on topic Using Cb autoaction to modify CSS style
You want to dynamically insert CSS? Yes, that's doable but you'd need to provide where you want the CSS to be output as it needs to be output on the page actually displayed. The login triggers are all during processes so a redirect is made and your CSS won't do anything during those.


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.

  • chanteur94
  • chanteur94
  • OFFLINE
  • Posts: 302
  • Thanks: 13
  • Karma: 1
4 years 5 months ago #318104 by chanteur94
Replied by chanteur94 on topic Using Cb autoaction to modify CSS style
You're totally right.
So perhaps I can add lines dynamicly in my custom.css just before login and remove them just before logout?

How is possible?

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48437
  • Thanks: 8275
  • Karma: 1443
4 years 5 months ago #318107 by krileon
Replied by krileon on topic Using Cb autoaction to modify CSS style
You won't be able to modify a file specifically for a user after login like that. You need to tell me where this CSS is supposed to be applied and to what exactly. I don't know what mypersonalid is or where it is so I can't advise you on what trigger to use. You could use CB Content Module if mypersonalid is just some HTML since CB Content Module supports substitutions and it can output substitution supported CSS on any page the module is output on. If mypersonalid isn't supposed to be displayed when a user is logged in I recommend just not outputting it at all. That's doable using Joomlas built in Guest ACL shown below.

docs.joomla.org/J3.x:Access_Control_List_Tutorial#Allowing_Guest-Only_Access_to_Menu_Items_and_Modules


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.

  • chanteur94
  • chanteur94
  • OFFLINE
  • Posts: 302
  • Thanks: 13
  • Karma: 1
4 years 5 months ago #318110 by chanteur94
Replied by chanteur94 on topic Using Cb autoaction to modify CSS style
My goal is to change a menu item display before and after Login.

For example, before login I have a MENU with 3 items
After LOGIN I want my MENU with 4 items
And when I logout, MENU with 3 items
I know that with CSS I can display or not a MENU item

So ?

PS : i have a file named custom.css who keeps all my particular CSS for the website.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48437
  • Thanks: 8275
  • Karma: 1443
4 years 5 months ago #318122 by krileon
Replied by krileon on topic Using Cb autoaction to modify CSS style
If the 4th menu item is supposed to be visible after login just set that 4th menu item to have an Access of Registered so it's only visible to logged in users. If you want menu items to only be visible to non-logged in users use the Guest ACL as shown in the link provided in my previous reply. Using dynamically output CSS would be the wrong approach here.


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