WordPress.org

Plugin Directory

R.W. Elephant Inventory Gallery

Gallery displays R.W. Elephant rental inventory on your website.

Customizing Templates

When modifying templates, create a rw-elephant-templates directory under your wp-content directory (/wp-content/rw-elephant-templates/). Then place modified templates directly in this folder, not in any sub-folder. You may copy from /wp-content/plugins/rw-elephant-inventory-gallery/templates/common/ or any of the included templates). Only copy template files you wish to modify; if a template does not exist in the rw-elephant-templates directory, the default will be used. Moving the template location outside the plugin directory prevents future updates from overwriting your modified templates.

The gallery is displayed on the chosen WordPress page by inserting it into the content of the page. If you wish to change the appearance of the page beyond the content area, such as to change the page width or change the way the page heading is displayed, change the page template in your WordPress theme. To select a different WordPress page template (if your Theme supports multiple page layouts): Pages->Edit->[Select your gallery page]->Template. You can modify or make a new page template by editing your WordPress theme. Normally you will want to use a full width page template.

The R.W. Elephant Inventory Gallery uses its own templates for the layout of the gallery pages. You can modify the provided templates. A template named custom with minimal styling is provided if you wish to use it to build your own template design. The gallery templates use placeholders which are be replaced with the appropriate gallery information when the pages are displayed on your website.

The included templates are located in the /wp-content/plugins/rwe-gallery/templates/ directory. In this directory you will find sub-directories named for each template style. The individual template files are located in each sub-directory. Some parts of templates are shared. The shared templates located in the common template directory. Do not modify the templates in this location (they will be overwritten when you update the plugin!). Instead place modified templates in /wp-content/rw-elephant-templates/ as described above.

Following is a list of templates and the placeholders available for each:

Common templates (located in `/templates/common/`)

category-list.php

This is a sub-template used to create the main category list. This template is used to display each category.

  • [category_name] = name of the category
  • [category_id] = id of category
  • [category_url] = the URL of the category
  • [category_thumbnail] = the category thumbnail, including the tag
  • [category_thumbnail_url] = the category thumbnail, the URL of the image only

item-list.php

This is a sub-template that creates lists of items. It is used for listing items in a category, items for a tag and for search results.

  • [item_name] = name of the item
  • [item_url] = full URL to the item
  • [item_quantity] = quantity of the item
  • [item_price] = price of the item
  • [item_dimensions] = dimensions of the item
  • [item_photo] = the item thumbnail, including the tag
  • [item_photo_url] = the URL of the item thumbnail image

kit-list.php

A sub-template for lists of items in a kit.

  • [item_name] = name of the item
  • [item_id] = the id of the item
  • [item_category_id] = the id of the item's category
  • [item_category_name] = the name of the item's category
  • [item_url] = full URL to the item
  • [item_quantity] = quantity of the item in the kit
  • [item_price] = price of the item
  • [item_photo] = the item thumbnail, including the tag
  • [item_photo_url] = the URL of the item thumbnail image

related-list.php

A sub-template for lists of related items.

  • [item_name] = name of the item
  • [item_id] = the id of the item
  • [item_category_id] = the id of the item's category
  • [item_category_name] = the name of the item's category
  • [item_url] = full URL to the item
  • [item_price] = price of the item
  • [item_photo] = the item thumbnail, including the tag
  • [item_photo_url] = the URL of the item thumbnail image

price.php

A sub-template for formatting the item prices (this template is used to create [formatted_price])

  • [price] = price of the item

search-form.php

This template is used to create the search form for searching your gallery. This template is included in other templates.

  • [gallery_name] => the name of the gallery
  • [gllery_url] => the URL of the main gallery page, submit the form to this location

script.js

This contains JavaScript to switch the item image when you click on an alternate image. You can include additional JavaScript in this file. This file is included on all gallery pages.

wishlist-extra-fields.php

This file allows additional form fields to be added to the wishlist submit page. Create additional form fields and the results will be passed to R.W. Elephant.

Individual templates (located in `/templates/*template_name*/`)

categories.php

This template displays the main categories. It is the home page of your gallery.

  • [gallery_name] = the name of the gallery
  • [gallery_url] = the URL of the main gallery page
  • [search_form] = displays the search form
  • [category_list] = this is the list of categories, created by the template common/category-list.php
  • [category_thumbnail_size] = the size of category thumbnail in pixels: 100, 200 or 300
  • [error] = displays error message on the page, if there is an error
  • [view_wishlist] = view wishlist button
  • [wishlist] = wishlist status messages and contents

category.php

Lists the items in a selected category.

  • [gallery_name] = the name of the gallery
  • [gallery_url] = the URL of the main gallery page
  • [search_form] = displays the search form
  • [category_name] = the name of the category
  • [category_id] = id of the category
  • [category_items] = the list of items, created by the template `common/item-list.php'
  • [category_thumbnail_size] = the size of category thumbnail in pixels: 100, 200 or 300
  • [error] = displays error message on the page, if there is an error
  • [page_url] = the URL of the current page (the category)
  • [view_wishlist] = view wishlist button
  • [wishlist] = wishlist status messages and contents

item-detail.php

An individual item page.

  • [gallery_name] = the name of the gallery
  • [gallery_url] = the URL of the main gallery page
  • [search_form] = displays the search form
  • [item_name] = name of the item
  • [item_id] = the ID of the item
  • [item_description] = item description
  • [item_quantity] = quantity
  • [item_category_name] = the name of the item's category
  • [item_category_id] = the id the item's category
  • [item_category_url] = the URL of the item's category
  • [item_photo] = main photo, in img tag
  • [item_photo_url] = the URL to the main photo
  • [item_thumbnails] = the alternate images, each img is inside li a tags and linked to its corresponding large image.
  • [item_thumbnails_url] = a comma separated list of URL for the alternate images
  • [item_thumbnail_size] = the size of category thumbnail in pixels: 100, 200 or 300
  • [item_tags] = a list of tags for the item, inside li element and linked to the corresponding tag page
  • [item_dimensions] = dimensions of the item in format X x Y x Z
  • [item_price] = the price of the item
  • [formatted_price] = the price as formatted by price.php template, will only display if prices are enabled in R.W. Elephant
  • [error] = displays error message on the page, if there is an error
  • [page_url] = the URL of the current page (the item)
  • [social_links] = a div containing the sharing links enabled via plugin settings.
  • [add_to_wishlist] = Add to wishlist button
  • [view_wishlist] = view wishlist button
  • [wishlist] = wishlist status messages and contents

search-results.php

A list of search results.

  • [gallery_name] = the name of the gallery
  • [gallery_url] = the URL of the main gallery page
  • [search_form] = displays the search form
  • [search_terms] = the search term(s) for these search results
  • [search_items] = a list of items that match the search, created by the template `common/item-list.php'
  • [category_thumbnail_size] = the size of category thumbnail in pixels: 100, 200 or 300
  • [error] = displays error message on the page, if there is an error
  • [page_url] = the URL of the current page (the search results)
  • [view_wishlist] = view wishlist button
  • [wishlist] = wishlist status messages and contents

tag.php

List of items for a tag.

  • [gallery_name] = the name of the gallery
  • [gallery_url] = the URL of the main gallery page
  • [search_form] = displays the search form
  • [tag_name] = the name of the tag
  • [tag_items] = a list of items for this tag, created by the template `common/item-list.php'
  • [category_thumbnail_size] = the size of category thumbnail in pixels: 100, 200 or 300
  • [error] = displays error message on the page, if there is an error
  • [page_url] = the URL of the current page (the tag)
  • [view_wishlist] = view wishlist button
  • [wishlist] = wishlist status messages and contents

style.css

The style sheet for the template. This file is included on all gallery pages.

Requires: 3.0 or higher
Compatible up to: 4.1.1
Last Updated: 2015-2-25
Active Installs: 30+

Ratings

0 out of 5 stars

Support

Got something to say? Need help?

Compatibility

+
=
Not enough data

0 people say it works.
0 people say it's broken.

100,1,1