How do you update the script when changes are made? You will have to remember each location and update the CEWP. No thank you.
I started out this way and quickly realized that I was going down a road that would lead to insanity, keeping track and managing all the CEWP with the code.
Can this be done? YES.
This image shows me using the Content link to link back to the central location that I have JQuery solutions in text files. When I update the file tip-document-right.txt with an updated script all location where I have deployed this way will be instantly updated. The is GREAT!
Now there are two wonderful things about this.
- One is that we can add a CEWP anywhere and link to the script file in a central place.
- Two is that you can export the CEWP and create a webpart that can be used by anyone. This webpart would have the link to the central script site.
You now can let everyone use the script solution or webpart AND have the ability to update the script and know that the update will be populated every where the CEWP/webpart and link was deployed.
You will then have the freedom to let others utilize the solution and be able manage the script. Your site will then begin to look like this:
Christophe at pathtosharepoint.wordpress.com has a great article on how to implement something similar. His solution is about having a single script file that is used across sites. This works well when you want to have the same scripts available to multiple sites. Check out his post here: http://pathtosharepoint.wordpress.com/2009/02/15/a-content-editor-web-part-for-every-home/
My post is about how do you let your users have access to these solutions, add only the ones they want, still maintain control of managing the script, be able to update the script and have all site instantly benefit from the update.
Hope this helps,