joshkosmala / silverstripe-tenon

Check the accessibility of your SilverStripe site with this module that integrates with Tenon
Other
16 stars 3 forks source link

Including tenon_post.js on every page. #3

Open camfindlay opened 9 years ago

camfindlay commented 9 years ago

I note in your readme it suggests to include /tenon/javascript/tenon_post.js on every public page.

Quick question is tenon designed to be used on a production server or is it more for a UAT or local development environment?

You could perhaps use the SilverStripe requirements configuration to automatically include this javascript in each page which is one less step for the developer.

I may have a tinker with this and raise a pull request unless you have some reservation about this javascript being included by default?

leighelse commented 9 years ago

The design intention was to include the javascript on every page, and that's what we're doing in our installations. So yes, it would be a good step to include this using configuration rather than the developer having to add it manually.

leighelse commented 9 years ago

Closed in error.

camfindlay commented 9 years ago

I had a go at working out how to do this over the weekend using the SilverStripe Requirements class. However I found that you had to do it different ways depending on your theme development or whether you are using the CWP basic recipe vs. vanilla SilverStripe. Depending how coupled you want to make this module to the CWP it might be possible to add the tenon js by overloading the getBaseStyles method in the CWP BasePage (using a DataExtension). Then of course it would be less usable in other non-CWP projects. Perhaps instead we can put together some good documentation which covers both use cases?

leighelse commented 9 years ago

Thanks Cam; providing documentation for the options seems a good approach.

camfindlay commented 9 years ago

For adding the js to the CWP basic recipe you could also reference this documentation https://www.cwp.govt.nz/guides/core-technical-documentation/common-web-platform-core/en/customising-the-default-theme#adding-js-and-css-files

And for more generic documentation: http://docs.silverstripe.org/en/developer_guides/templates/requirements/

Probably a section with both options documented would make sense - Do generic first then CWP section :+1:

Happy to peer review your document if you do this update via a pull request process.