Move template to src/templates MKWS-314 MKWS-315
[mkws-moved-to-github.git] / doc / mkws-manual.markdown
index 5491775..a52eeb3 100644 (file)
@@ -188,7 +188,8 @@ following lower-level widgets provided instead:
 
 Customisation of MKWS searching widgets can also be achieved by
 overriding the styles set in the toolkit's CSS stylesheet. The default
-styles can be inspected in `mkws.css` and overridden in any
+styles can be inspected in [mkws.css](mkws.css)
+and overridden in any
 styles that appears later in the HTML than that file. At the simplest
 level, this might just mean changing fonts, sizes and colours, but
 more fundamental changes are also possible.
@@ -211,7 +212,7 @@ the system. For details of Handlebars template syntax, see [the online
 documentation](http://handlebarsjs.com/).
 
 The templates used by the core widgets can be viewed in [our git
-repository](http://git.indexdata.com/?p=mkws.git;a=tree;f=src/mkws.templates;).
+repository](http://git.indexdata.com/?p=mkws.git;a=tree;f=src/templates;).
 Parameters are documented in a comment at the top of each template so
 you can see what's going where. If all you want to do is add a CSS class to
 something or change a `span` to a `div` it's easy to just copy the existing
@@ -221,24 +222,24 @@ Overriding templates
 --------------------
 
 To override the template for a widget, include it inline in the document
-as a `<script>` tag marked with a class of `mkwsTemplate_Foo` where Foo is the
+as a `<script>` tag marked with a class of `mkws-template-foo` where foo is the
 name of the template you want to override (typically the name of the widget).
 Inline Handlebars templates are distinguished from Javascript via a
 `type="text/x-handlebars-template"` attribute. For example, to override the
-Pager template you would include this in your document:
+pager template you would include this in your document:
 
-    <script class="mkwsTemplate_Pager" type="text/x-handlebars-template">
+    <script class="mkws-template-pager" type="text/x-handlebars-template">
       ...new Pager template
     </script>
 
 The Facet template has a special feature where you can override it on a
 per-facet basis by adding a dash and the facet name as a suffix eg.
-`Facet-Subjects` rather than `Facet`. (So `class="mkwsTemplate_Facet-Subjects"`)
+`facet-subjects` rather than `facet`. (So `class="mkws-template-facet-subjects"`)
 
 You can also explicitly specify a different template for a particular instance
 of a widget by providing the name of your alternative (eg. SpecialPager) as the
 value of the `template` key in the MKWS config object for that widget:
-for example, `<div class="mkwsPager" template="specialPager"/>`.
+for example, `<div class="mkws-pager" template="special-pager"/>`.
 
 Templates for MKWS can also be
 [precompiled](http://handlebarsjs.com/precompilation.html). If a precompiled
@@ -251,8 +252,7 @@ Inspecting metadata for templating
 MKWS makes requests to Service Proxy or Pazpar2 that perform the actual
 searching. Depending on how these are configured and what is available from the
 targets you are searching there may be more data available than what is
-presented by the default templates. In this case, you can redefine the
-`Record` template to include more fields in the full-record popup.
+presented by the default templates.
 
 Handlebars offers a convenient log helper that will output the contents of a
 variable for you to inspect. This lets you look at exactly what is being
@@ -278,7 +278,7 @@ Rather than use the included AJAX helpers to render record details inline,
 here's a Records template that will link directly to the source via the address
 provided in the metadata as the first element of `md-electronic-url`:
 
-    <script class="mkwsTemplate_Records" type="text/x-handlebars-template">
+    <script class="mkws-template-records" type="text/x-handlebars-template">
       {{#each hits}}
         <div class="{{containerClass}}">
           <a href="{{md-electronic-url.[0]}}">
@@ -315,33 +315,6 @@ day, a welcome message or a help page. This can be done by placing an
 search is made.
 
 
-Responsive design
------------------
-
-Metasearching applications may need to appear differently on
-small-screened mobile devices, or change their appearance when
-screen-width changes (as when a small device is rotated). To achieve
-this, MKWS supports responsive design which will move the termlists to
-the bottom on narrow screens and to the sidebar on wide screens.
-
-To turn on this behaviour, set the `responsive_design_width` to the desired
-threshhold width in pixels. For example:
-
-        <script type="text/javascript">
-            var mkws_config = {
-                responsive_design_width: 990
-            };
-        </script>
-
-If individual result-related widgets are in use in place of the
-all-in-one mkwsResults, then the redesigned application needs to
-specify the locations where the termlists should appear in both
-cases. In this case, wrap the wide-screen `mkwsTermlists` element in a
-`mkwsTermlists-Container-wide` element; and provide an
-`mkwsTermlists-Container-narrow` element in the place where the narrow-screen
-termlists should appear.
-
-
 Popup results with jQuery UI
 ----------------------------