About Features Downloads Getting Started Documentation Events Support GitHub

Love VuFind®? Consider becoming a financial supporter. Your support helps build a better VuFind®!

Site Tools


Warning: This page has not been updated in over over a year and may be outdated or deprecated.
legacy:vufind_1.x_developer_manual:building_a_smarty_plugin

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
building_a_plugin [2007/11/20 20:42] asnagylegacy:vufind_1.x_developer_manual:building_a_smarty_plugin [2015/12/11 19:15] – ↷ Page moved and renamed from building_a_plugin to legacy:vufind_1.x_developer_manual:building_a_smarty_plugin demiankatz
Line 1: Line 1:
-====== Building Plugin ======+====== Building a Smarty Plugin ======
  
-VuFind uses the [[http://smarty.php.net/|Smarty Template Engine]] to control the HTML templates.  Smarty has the ability to create plugins to be intergrated in with the templates.  If you would like to create a Plugin to enhance VuFind - for example a SQL Query to your ILS Database for additional data on the Record View Page or a new query to the SOLR data store - you could simply create a PHP file that lives within the /web/interface/plugins directory.  Please follow the [[http://smarty.php.net/manual/en/plugins.php|Smarty Documentation]] on how to create a plugin.+VuFind uses the [[http://www.smarty.net/|Smarty Template Engine]] to control the HTML templates.  Smarty has the ability to create plugins to be intergrated in with the templates.  If you would like to create a Plugin to enhance VuFind - for example a SQL Query to your ILS Database for additional data on the Record View Page or a new query to the Solr data store - you could simply create a PHP file that lives within the /web/interface/plugins directory.  Please follow the [[http://www.smarty.net/manual/en/plugins.php|Smarty Documentation]] on how to create a plugin.
  
-Here is an arbitrary example of a plugin that interacts with the SOLR data store:+Here is an arbitrary example of a plugin that interacts with the Solr data store:
  
 <code php> <code php>
Line 11: Line 11:
  * Smarty plugin  * Smarty plugin
  * -------------------------------------------------------------  * -------------------------------------------------------------
 + * File:     function.showqauthors.php
  * Type:     function  * Type:     function
  * Name:     Show Q Authors  * Name:     Show Q Authors
Line 26: Line 27:
     // Create Output     // Create Output
     $html = "<ul>\n";     $html = "<ul>\n";
-    foreach ($result as $author) { +    foreach ($result['record'as $record) { 
-        $html .= "<li>$author</li>\n";+        $html .= '<li>' . $record['author'] . "</li>\n";
     }     }
     $html .= "</ul>\n";     $html .= "</ul>\n";
legacy/vufind_1.x_developer_manual/building_a_smarty_plugin.txt · Last modified: 2018/12/19 14:12 by demiankatz