Templates

Revision for “Templates” created on July 22, 2014 @ 07:26:16

Title
Templates
Content
<h2>What are templates?</h2> Templates are the files NextCellent uses to display your content (e.g. galleries, slideshows, etc.). The default templates are located in wp-content/plugins/nextcellent-gallery/view/. <a title="The template list" href="http://wpgetready.com/wiki/the-template-list/">A full list of templates can be found here.</a> <h2>Custom templates</h2> Of course, you can add custom templates. This way you can edit the way NextCellent outputs the shortcodes. With custom templates, you can add as many as you want. Custom templates are also upgrade-safe, i.e. they will not be removed with a plugin update. <h3>Using templates</h3> Templates are used by adding <strong>template=template_name</strong> to the shortcode. For example: <pre>[[gallery id=9 template=template_name]]</pre> <h3>Naming templates</h3> NextCellent templates are named according to with which <a title="Shortcodes: basic tips before proceed" href="http://wpgetready.com/wiki/nextcellent-plugin/common-shortcodes/">shortcode</a> they can be used, and then by adding <strong>-template_name</strong>. <ul> <li>Albums: album-template_name.php</li> <li>Galleries: gallery-template_name.php</li> <li>Image browsers: imagebrowser-template_name.php</li> <li>Single pictures: singlepic-template_name.php</li> </ul> <h3>Loading and saving templates</h3> Assuming our template is called gallery-template_name.php, NextCellent tries to load the template in this order: <ol> <li>The <a title="Nextcellent Filter List" href="http://wpgetready.com/wiki/nextcellent-plugin/nextcellent-filter-list/">ngg_render_template</a> filter. This is for plugin and theme authors. Click the filter for more information.</li> <li>In the <strong>nggallery</strong> folder inside your theme folder (e.g. wp-content/themes/twentyfourteen/nggallery/). This is where you can add your custom templates.</li> <li>If NextCellent can't find gallery-template_name.php, it will look for the file in the view folder (wp-content/plugins/nextcellent-gallery/view/).</li> <li>If nothing is found there, NextCellent will go through this cycle again, but looking for gallery.php this time.</li> </ol> Themes and plugins should add templates using the filter <a title="Nextcellent Filter List" href="http://wpgetready.com/wiki/nextcellent-plugin/nextcellent-filter-list/">ngg_render_template</a>. If you want to add a template yourself, add them in the <strong>nggallery</strong> folder (<a title="Creating a custom template" href="http://wpgetready.com/wiki/nextcellent-plugin/templates/creating-a-custom-template/">or follow this guide</a>).
Excerpt


OldNewDate CreatedAuthorActions
July 22, 2014 @ 07:26:16 Niko Strijbol
May 2, 2014 @ 14:33:38 Niko Strijbol
May 2, 2014 @ 14:32:26 Niko Strijbol
May 2, 2014 @ 14:26:50 Niko Strijbol
May 2, 2014 @ 14:23:00 Niko Strijbol
May 2, 2014 @ 14:20:25 Niko Strijbol
May 2, 2014 @ 14:17:24 Niko Strijbol
May 2, 2014 @ 14:06:05 Niko Strijbol
May 2, 2014 @ 13:58:13 Niko Strijbol