Skip to Content Skip to Menu

Assign a CB Auto Action to one specific page?

1 hour 4 minutes ago #343964 by BobBriscoe
Replied by BobBriscoe on topic Assign a CB Auto Action to one specific page?

Field: Custom > Field Value
Custom Field Value: [cb:url location="itemid" /]
Operator: Equal To
Value: MENU_ID_HERE

I assume you meant the above to be the Condition for the onBeforeCompileHead trigger.
I couldn't find Custom > Field, so I assumed that was a slip of the brain for Custom > Value.

Whatever, this didn't work.
For the avoidance of doubt, I took the menu ID from the ID column of my list of menus (Joomla > Menus > Hidden Menu).

If I could, I'd upload a screenshot, but uploads of images always seem to fail for me.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 50441
  • Thanks: 8629
  • Karma: 1472
43 minutes ago #343967 by krileon
Replied by krileon on topic Assign a CB Auto Action to one specific page?

I couldn't find Custom > Field, so I assumed that was a slip of the brain for Custom > Value.

Yes.

For the avoidance of doubt, I took the menu ID from the ID column of my list of menus (Joomla > Menus > Hidden Menu).

It's not a guarantee. It just depends on what's available during that Joomla event. I've no idea what Joomla behavior has been initialized at onBeforeCompileHead exactly. I don't recall where in the rendering pipeline that event happens exactly so am unsure if routing has happened yet to allow access to routing details like the Itemid. Might be possible to extract with [get_Itemid] or [request_Itemid] to try and force it out of the URL, but probably won't work if routing hasn't reversed the URL yet.

onBeforeRender might be more reliable here since it's after routing and just before a component renders. So maybe worth giving that one a try instead. Joomla's event documentation is below, but it's relatively barebones. Everything listed there you can use in CB Auto Actions by just prefixing with "joomla_" but most if not all should be in the dropdown already.

manual.joomla.org/docs/next/building-extensions/plugins/plugin-events/

When I dig into implementing the Menu condition I'll be testing against extremely early and late trigger processes (e.g. before renderer) and putting workarounds in to handle it automatically, but for now you'll have to just use what's available.

If I could, I'd upload a screenshot, but uploads of images always seem to fail for me.

They should upload fine, but the preview will fail since we don't allow inline data URIs which Kunena is using for previews. If it fails entirely does it give any errors? If so please provide them and will let Beat know so he can take a look into it server side. Might be being caught by our security since we've security really high due to bots.


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