Skip to Content Skip to Menu

Assign a CB Auto Action to one specific page?

1 month 3 weeks 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: 50584
  • Thanks: 8663
  • Karma: 1473
1 month 3 weeks 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.

1 month 3 weeks ago #343975 by BobBriscoe
Replied by BobBriscoe on topic Assign a CB Auto Action to one specific page?

onBeforeRender might be more reliable

Using onBeforeRender as the trigger doesn't work either.

Might be possible to extract with [get_Itemid] or [request_Itemid] to try and force it out of the URL

I'm not sure what 'force it out of the URL' meant here. But, I think you might have meant 'avoid depending on the URL'.
I tried all six combinations of the 2x3 matrix below and none worked:
  • Trigger: onBeforeCompileHead || onBeforeRender
  • Custom Value: [cb:url location="itemid" /] || [get_Itemid] || [request_Itemid]
Can we give up now? I'll just use headtag. It took a few minutes to configure and worked straight away.

If [screenshot upload] fails entirely does it give any errors?

I click [+ Add Files], use the file selector, click [Open], then in the box beneath [+ Add Files] I just get:
_______________
| Filename.png |
| Upload failed |
A .txt file uploads OK, but .png and .jpg fail (I haven't exhaustively tried all the listed file extensions). Perhaps it could be something to do with moderation falling into a black hole?
 

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 50584
  • Thanks: 8663
  • Karma: 1473
1 month 3 weeks ago #343976 by krileon
Replied by krileon on topic Assign a CB Auto Action to one specific page?

I tried all six combinations of the 2x3 matrix below and none worked:

Ok, thank you. Will look into this further when implementing the Menu condition option to be sure it also covers your usecase of being inside of an iframe.

Can we give up now? I'll just use headtag. It took a few minutes to configure and worked straight away.

You're welcome to use whatever you like. Use what works best for you. 👍

A .txt file uploads OK, but .png and .jpg fail (I haven't exhaustively tried all the listed file extensions). Perhaps it could be something to do with moderation falling into a black hole?

I'm not sure. We've had scattered reports of some users having issues uploading. I don't know if it's a problem in Kunena or our server rejecting it. Possibly something to do with filenames even. I've let Beat know and might be able to figure something out from logs.


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.

  • krileon
  • krileon
  • ONLINE
  • Posts: 50584
  • Thanks: 8663
  • Karma: 1473
1 month 3 weeks ago - 1 month 3 weeks ago #343992 by krileon
Replied by krileon on topic Assign a CB Auto Action to one specific page?
Went ahead and improved CB Auto Actions with a Menu condition in latest CB Auto Actions build release. You're welcome to still use whatever extension you like for this, but just wanted to let you know this is now implemented. Below is an example showing it working on page view and inside an iframe.

Condition
 

Action
 

Page
 

iFrame
 

Just turned the background red using CSS so it's easy to see it works. The menu detection is entirely dependent on Joomla's own Application->getMenu()->getActive() function.

Anyway, again just use whatever you're most comfortable with and just wanted to let you know your feedback helped improved CB Auto Actions and is appreciated!


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.
Last edit: 1 month 3 weeks ago by krileon.

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

1 month 3 weeks ago #343993 by BobBriscoe
Replied by BobBriscoe on topic Assign a CB Auto Action to one specific page?
Thanks for letting me know.
That background clashes awfully with your shirt ;)

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

Moderators: beatnantkrileon
Powered by Kunena Forum