User Tools

Site Tools


en:user_advanced:gs3_custom_doc_display

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
en:user_advanced:gs3_custom_doc_display [2016/08/21 22:19] kjdonen:user_advanced:gs3_custom_doc_display [2021/05/23 23:24] kjdon
Line 5: Line 5:
 To customize the image slider. Look at the web/interfaces/default/js/document_scripts.js To customize the image slider. Look at the web/interfaces/default/js/document_scripts.js
 If you want to customise things in here for just one collection, add a file eg If you want to customise things in here for just one collection, add a file eg
-script/custom-document.js into the collection.+js/custom-document.js into the collection
 +document_scripts is included in the page by the "javascriptForDocumentView" template, in transform/pages/document.xsl. If you look at this you can see that it calls a template "customJavascriptForDocumentView". Implement this template in your collection to add in your custom javascript file.
 Add transform/pages/document.xsl to the collection if not already there. Add the following template to it, substituting your collection name for niupepa in the example. Add transform/pages/document.xsl to the collection if not already there. Add the following template to it, substituting your collection name for niupepa in the example.
 <code> <code>
-<xsl:template name="javascriptForDocumentView"+<xsl:template name="customJavascriptForDocumentView"> 
-  <script type="text/javascript" src="interfaces/{$interface_name}/js/document_scripts.js"><xsl:text> </xsl:text></script+  <!-- add in the local customisations --> 
-  <!-- add in the niupepa customisations --> +  <script type="text/javascript" src="sites/{$site_name}/collect/niupepa/js/custom-document.js"><xsl:text> </xsl:text></script>
-  <script type="text/javascript" src="sites/{$site_name}/collect/niupepa/script/custom-document.js"><xsl:text> </xsl:text></script>+
 </xsl:template> </xsl:template>
  
Line 20: Line 20:
 Note, you can do this for a site, or for a different interface. Just put the document.xsl and custom-document.js into the appropriate folders for site/interface, and modify the paths accordingly.  Note, you can do this for a site, or for a different interface. Just put the document.xsl and custom-document.js into the appropriate folders for site/interface, and modify the paths accordingly. 
  
-Note, if you are adding document.xsl to a new interface, then you should replace //{$interface_name}// with //default//, in the above code. 
 </code> </code>
- 
  
  
en/user_advanced/gs3_custom_doc_display.txt · Last modified: 2023/03/13 01:46 by 127.0.0.1