JavaScript by Path

Events happening in the community are now at Drupal community events on www.drupal.org.
mrfelton's picture

JavaScript by Path allows custom, user defined JavaScript code to be added on a path by path basis. This is particularity useful for implementing various third party 'tracking codes' eg. Doubleclick.

To add JavaScript to a particular page or set of pages, you define a rule. This rule defines visibility settings (works the same as block.module), the desired scope of the JavaScript (header or footer), and provides 2 text areas where JavaScript code and noscript code may be entered.

Obviously, permission to use the module should be granted with care as it allows for potentially malicious code to be inserted into a page.

I found a need for it... perhaps others would. Or, perhaps this functionality is already provided by another module, in which case I just wasted a couple of hours! If not, I will release it on drupal.org.

Thoughts/comments/suggestions?

Thanks,
Tom

AttachmentSize
javascript_bypayh.png100.88 KB

Comments

Sounds a lot like a general

dave reid's picture

Sounds a lot like a general Statistics/Analytics module that I've been working on that can be a drop-in replacement for core's statistics.module. The base module would expose the interface for user/role/path/link tracking. Modules like Google Analytics would then just be small-sub module that tells 'what' to add. This way all the separate 'analytics' modules that need to add JS on certain pages don't need to re-implement code every single time. They'd all be controlled by one module and respect the same settings.

I'll add it to my CVS sandbox and post some screenshots here and see what you think.

Senior Drupal Developer for Lullabot | www.davereid.net | @davereid

Existing module

Released?

andershal's picture

Did you ever release this module?

No, I didn't bother because

mrfelton's picture

No, I didn't bother because js_injector does pretty much the exact same thing, except that it doesn't allow you to add noscript code and it won't automatically convert http urls to https like my one did. So, even though my one was slightly more feature rich, I only really needed those features on one particular site and have just used js_injector for everything else.

--
Tom
www.systemseed.com - drupal development. drupal training. drupal support.

Contributed Module Ideas

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

Hot content this week