CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • General Discussion (please no support requests here!) (Moderator: Michał Mach) »
  • A Feeler for Custom Javascript Usage
Pages: [1]

Author Topic: A Feeler for Custom Javascript Usage  (Read 1092 times)

jmturner

  • I’m new here
  • *
  • Posts: 9
  • Karma: 1
A Feeler for Custom Javascript Usage
February 08, 2011, 11:15:50 am
I was wondering how many developers have had the need to customize/add any Javascript or add any jQuery features to custom templates. 

I recently ran into this issue and was wondering if there might be a critical mass of developers who have also run into this.  If there are, there might be cause to suggest implementing a "Custom Javascript Path Directory" in the Upload Directory portion of the Settings.

I really like how CiviCRM accommodates custom Templates and PHP files and could see potential value in allowing similar support for custom Javascript.

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: A Feeler for Custom Javascript Usage
February 08, 2011, 11:34:54 am
I have added jQuery functionality more than once to CiviCRM installs, but I always have done that via the Drupal theme or a custom module. All I was doing was adding functionality, however, not modifying any existing files, so your particular issue never came up for me.

That's my 2 cents. :)
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: A Feeler for Custom Javascript Usage
February 08, 2011, 12:58:24 pm
Yep, added, modified, removed sliced, cursed and everything in between ;)

we aren't systematic enough to have a css selector for each form, so be careful by using a common jquery, you might modify forms you didn't think about on another side of civi (been there).

My recommended way is to use custom templates, move whatever.tpl to yourcustom/whatever.original.tpl

In the whatever.tpl do you jquery magic and {include whatever.original.tpl}. Apply a layer of git/mercurial that think at every step and you're good to go.

Last one: Use {crmAPI} instead of the /civicrm/ajax/rest if this is about loading an extra info you want at everytime, faster and less requests.

X+
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • General Discussion (please no support requests here!) (Moderator: Michał Mach) »
  • A Feeler for Custom Javascript Usage

This forum was archived on 2017-11-26.