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

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

I have plenty of ways to add javascript to the body. However, unless it's in the head, users see the original page, then a flash to a new page (because the script does a redirect after encoding an extra attribute in the URL)....early in the head
So, telling me "you'd need to add a condition" is what I've already done, and the question was asking how it should be done without a condition.I ... wrapped my code in an 'if' ... But this surely can't be the proper approach
Please Log in or Create an account to join the conversation.

That Joomla event isn't page specific. It fires on every page every time the head is compiled. You have to use a condition. Conditions in CB Auto Actions will stop the execution of the auto action. So your condition would prevent the JavaScript from being output entirely. No need for an IF statement in the JavaScript.So, telling me "you'd need to add a condition" is what I've already done, and the question was asking how it should be done without a condition.
It can. As I said use a condition to check what URL you're on.If it can't be done with CB, pls just say.
Please Log in or Create an account to join the conversation.

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

The module has to be in a position. Joomla does not run modules in "none" position. Place it in a footer position on your page for example. It won't output any content to that footer (unless you add text/HTML to the Content parameter), but it'll let Joomla run the module. You can also go a step further here if you like and under Advanced Options set "Module Style" to "none", but shouldn't be necessary. That's just how modules work in Joomla so while seams a bit silly is required for the module to be ran by Joomla. We're actually using this method ourselves to customize some chunks of our own site and works pretty reliably.Position: ::none:: (Default) (you say js is inherently injected into the head, and I couldn't see any position relevant to the head)
Conditions originally only supported fields. So the terminology was correct at the time. Since then custom condition types have been added and the terminology was left untouched since all our existing customers are already used to the UX. It probably does need to be renamed, but not sure what to rename it to at this point. Will have to think on that for future major releases for a better name.Sorry, for doubting you before, but you have to admit that the CB terminology here is counter-intuitive:
a condition based on a 'Field' sounds like it's only to do with form fields (which implied to me that the body would already have had to load)
Joomla refers to Content as Articles or basically and text/html. This however is same situation as Conditions. Originally the module only output just text/HTML with substitution support. It has since expanded to support much more than that. Renaming an extension is not an easy task as it completely destroys all existing branding so the name was left as is. I don't really see what else to call it here regardless. I guess we could split it up into like 6 different modules, but I'd imagine that'd just annoy everyone and create a backwards compatibility problem then requiring a migration. Something we can consider for CB 3.0 maybe as these multi-featured modules I agree can be confusing (CB GroupJive Module is another one with a ton of modes).the term 'Content Module' sounds like it's to do with media content - the term 'content' is occasionally used for a script, but only one that customizes content (not the case for script in general).
You can match parts of a URL as I've done in my example above. The "Does Contain" and "Does Not Contain" operators can do partial string matches. "Begins With" and "Ends With" conditions are also available and they do the same thing except partial start/end matching. To replicate your JavaScript condition you'd use the below.From what I can find in the documentation about the CB Auto Action > Conditions > Custom field, it can only match against whole URLs, not solely the pathname part of the URL. So I would have to write a complex regex to avoid a false positive match, given arbitrary query strings or fragments in the URL or a backend page of similar name.
Please Log in or Create an account to join the conversation.