Insert elements in head of page

This is a forum to suggest new features for mojoPortal. 

This thread is closed to new posts. You must sign in to post in the forums.
2/4/2014 12:27:49 PM
Gravatar
Total Posts 2158

Insert elements in head of page

Hi Joe,

I've had several customers request this lately and currently the only solution is to create a custom skin with the desired elements/code in the head.

We have the ability to add meta tags, which is great but we would like the ability to add elements (primarily script and link) to the head of the document. Usually this is to support an external support chat service of some kind which requires script to be added in the head. This being an advanced feature, disabled by default, would be fine as far as we're concerned. I think this would be better than needing to create a separate skin just for something like this.

Thanks,
Joe D.

2/4/2014 12:35:26 PM
Gravatar
Total Posts 18439

Re: Insert elements in head of page

Hi Joe,

One easy solution is make a custom module that doesn't render anything but just registers the needed script and add it to the center column.

In fact the url for the script could be a module setting to make it reusable.

It would be so easy maybe I'll make a new built in module named Custom Script for this purpose.

Best,

Joe

2/4/2014 3:08:29 PM
Gravatar
Total Posts 2158

Re: Insert elements in head of page

Well, that would work just fine! The ability to store actual script or use a url would be best.

If you haven't already done this, I'll tackle it and send you the source.

Thanks!
Joe D.

2/4/2014 3:19:46 PM
Gravatar
Total Posts 18439

Re: Insert elements in head of page

Hey Joe,

I'm working on something else at the moment so feel free if you'd like to implement it and send me the files. Probably should be a setting also for IsStartup in which case ScriptManager.RegisterStartupScript would be used rather than ScriptManager.RegisterClientScriptBlock

If you need a module to add something other than a script, page meta data might work or another module could use code like: 

Page.Header.Controls.Add(..);

to inject some extra markup.

Since the script module would be fairly minimal it can just go into the /Modules folder.

Thanks,

Joe

You must sign in to post in the forums. This thread is closed to new posts.