Skip to main content
A feature request : Easily add a custom javascript in header or footer Started by kucing · · Read 8302 times 0 Members and 1 Guest are viewing this topic. previous topic - next topic

A feature request : Easily add a custom javascript in header or footer

Hi, so I want to add a tracking/analytics code[1] in ElkArte and failed to do so until this day.  :'(

Now I'm inspired by my wordpress site that included a slot for inserting additional script in header or footer. This will help if anybody want any script loaded in ElkArte without modifying the template files directly and redo every modification if overwritten.

Is this reasonable? or better as mod?
I followed how to insert google analytics code manually in smf2

Re: A feature request : Easily add a custom javascript in header or footer

Reply #1

I could see this being useful for the reasons you pointed out. Would you rather it be a global option that when set it shows in all themes? Or allow each theme the option to set it's own?
Success is not the result of spontaneous combustion, you must set yourself on fire!

Re: A feature request : Easily add a custom javascript in header or footer

Reply #2

personally I think global is good enough because I will use it to insert analytics code in header or footer and it will be a hassle to setup the code for each theme. I seldom change my theme though.

Thanks!
192.MY.ID: Forum ISP Indonesia.

Re: A feature request : Easily add a custom javascript in header or footer

Reply #3

We should track this at gitHub as a feature request I think

Re: A feature request : Easily add a custom javascript in header or footer

Reply #4

Added:
https://github.com/elkarte/Elkarte/issues/1201
Success is not the result of spontaneous combustion, you must set yourself on fire!

Re: A feature request : Easily add a custom javascript in header or footer

Reply #5

A mod should be rather easy to implement I think: a couple of hooks and save the header into the settings table...the most annoying thing would be setup the package-info LOL ... heck me is tempted to do some changes on that respect...
Bugs creator.
Features destroyer.
Template killer.


Re: A feature request : Easily add a custom javascript in header or footer

Reply #7

is this solved? is it possible to add  google analytics to elkarte?

imho I think it should be as a mod, many users are using Google Analytics
sorry for my bad english