{"id":519,"date":"2017-10-18T13:14:41","date_gmt":"2017-10-18T17:14:41","guid":{"rendered":"http:\/\/amy.imarketbeta.com\/blog\/?page_id=519"},"modified":"2017-11-14T12:20:38","modified_gmt":"2017-11-14T20:20:38","slug":"template-variables","status":"publish","type":"page","link":"http:\/\/amy.imarketbeta.com\/blog\/part-2-staff-user-guide\/creating-and-editing-pages-and-weblinks\/template-variables\/","title":{"rendered":"Template Variables"},"content":{"rendered":"<h1>Template Variables<\/h1>\n<p>A template variable is a custom field that extends the default attributes for a Page. In other words, template variables allow you to make custom changes to an individual page&#8217;s behavior. Certain template variables exist by default across all iMarket sites. Site-specific template variables are added by Development to add functionality based on the site&#8217;s design. We&#8217;ll explore both default and custom template variables below.<\/p>\n<h2>Location of Template Variables<\/h2>\n<p>To modify a page&#8217;s template variables, first open it for editing (<a href=\"http:\/\/amy.imarketbeta.com\/blog\/part-2-staff-user-guide\/creating-and-editing-pages-and-weblinks\/editing-pages\/\">instructions about editing pages can be found here<\/a>). Template Variables appear in the General Tab under the Main Content section.<\/p>\n<p><img loading=\"lazy\" class=\"alignnone size-full wp-image-1246\" src=\"http:\/\/amy.imarketbeta.com\/blog\/wp-content\/uploads\/2017\/10\/templatevariables-location.jpg\" alt=\"\" width=\"876\" height=\"629\" srcset=\"http:\/\/amy.imarketbeta.com\/blog\/wp-content\/uploads\/2017\/10\/templatevariables-location.jpg 876w, http:\/\/amy.imarketbeta.com\/blog\/wp-content\/uploads\/2017\/10\/templatevariables-location-300x215.jpg 300w, http:\/\/amy.imarketbeta.com\/blog\/wp-content\/uploads\/2017\/10\/templatevariables-location-768x551.jpg 768w\" sizes=\"(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 905px, 1075px\" \/><\/p>\n<h2>Default Template Variables<\/h2>\n<p>The iMarket CMS has default template variables that appear on every site and are used for SEO purposes. For example, every site has the option to exclude a page from the XML sitemap.<\/p>\n<p>There are additional default fields highlighted below, with descriptions to follow.<\/p>\n<figure id=\"attachment_1245\" aria-describedby=\"caption-attachment-1245\" style=\"width: 883px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" class=\"size-full wp-image-1245\" src=\"http:\/\/amy.imarketbeta.com\/blog\/wp-content\/uploads\/2017\/10\/templatevariables.jpg\" alt=\"\" width=\"883\" height=\"1229\" srcset=\"http:\/\/amy.imarketbeta.com\/blog\/wp-content\/uploads\/2017\/10\/templatevariables.jpg 883w, http:\/\/amy.imarketbeta.com\/blog\/wp-content\/uploads\/2017\/10\/templatevariables-216x300.jpg 216w, http:\/\/amy.imarketbeta.com\/blog\/wp-content\/uploads\/2017\/10\/templatevariables-768x1069.jpg 768w, http:\/\/amy.imarketbeta.com\/blog\/wp-content\/uploads\/2017\/10\/templatevariables-754x1050.jpg 754w\" sizes=\"(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 905px, 1075px\" \/><figcaption id=\"caption-attachment-1245\" class=\"wp-caption-text\">These highlighted fields are template variables included in all iMarket sites.<\/figcaption><\/figure>\n<ul>\n<li><strong>duplicate_content_id<span class=\"tooltips \" style=\"\" title=\"Should only be used by SEO or Development.\"><\/span><\/strong> = Using this in conjunction with an iMarket-specific shortcode will allow you to make a duplicate version of a page. This is often used for pages that appear in multiple sections of a website (for example: A Heat Pumps page that appears under both Heating and Plumbing.)<\/li>\n<li><strong>xml_sitemap_exclude<span class=\"tooltips \" style=\"\" title=\"Should only be used by SEO or Development.\"><\/span><\/strong> = Checking this box excludes the page from the XML sitemap.<\/li>\n<li><strong>Meta Description<span class=\"tooltips \" style=\"\" title=\"Should only be used by SEO or Development.\"><\/span><\/strong> = Content entered in here will make up the Meta Description of the page, which is used for SEO purposes.<\/li>\n<li><strong>Meta Keywords<span class=\"tooltips \" style=\"\" title=\"Should only be used by SEO or Development.\"><\/span><\/strong> = Content entered in here will make up the Meta Keywords of the page. In the past this feature was used for SEO purposes, but it is done less so now.<\/li>\n<li><strong>Any additional meta tags<span class=\"tooltips \" style=\"\" title=\"Should only be used by SEO or Development.\"><\/span><\/strong> = As the name implies, this field can be used for additional meta tags.<\/li>\n<li><strong>Meta Robots<span class=\"tooltips \" style=\"\" title=\"Should only be used by SEO or Development.\"><\/span><\/strong> = This is typically used to add NOINDEX,NOFOLLOW robots to a page, which is used for SEO purposes.<\/li>\n<\/ul>\n<h2>Custom Template Variables<\/h2>\n<p>Every site has custom template variables that are included by Development during the initial site build. Most often these template variables give an iMarketStaff user the ability to toggle on\/off certain blocks from the Subpage template.<\/p>\n<p><strong>It is now a best practice for Developers to include template variables to toggle off any\/all subpage sidebar blocks, however, older sites may not have this functionality included.<\/strong><\/p>\n<p>Since each site has a different selection of custom template variables based on its design, let&#8217;s look at one site as an example:<\/p>\n<p><img loading=\"lazy\" class=\"alignnone size-full wp-image-1264\" src=\"http:\/\/amy.imarketbeta.com\/blog\/wp-content\/uploads\/2017\/10\/grmetro-subpage.jpg\" alt=\"\" width=\"1363\" height=\"2955\" srcset=\"http:\/\/amy.imarketbeta.com\/blog\/wp-content\/uploads\/2017\/10\/grmetro-subpage.jpg 1363w, http:\/\/amy.imarketbeta.com\/blog\/wp-content\/uploads\/2017\/10\/grmetro-subpage-138x300.jpg 138w, http:\/\/amy.imarketbeta.com\/blog\/wp-content\/uploads\/2017\/10\/grmetro-subpage-768x1665.jpg 768w, http:\/\/amy.imarketbeta.com\/blog\/wp-content\/uploads\/2017\/10\/grmetro-subpage-484x1050.jpg 484w\" sizes=\"(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 905px, 1075px\" \/><\/p>\n<p>If we open this page in the iMarket CMS manager, we&#8217;ll see that the highlighted elements have template variables included for customization (pictured below).<\/p>\n<p><img loading=\"lazy\" class=\"alignnone size-full wp-image-1260\" src=\"http:\/\/amy.imarketbeta.com\/blog\/wp-content\/uploads\/2017\/10\/grmetro-tvs.jpg\" alt=\"Template Variables that correspond with the Subpage Template.\" width=\"887\" height=\"1128\" srcset=\"http:\/\/amy.imarketbeta.com\/blog\/wp-content\/uploads\/2017\/10\/grmetro-tvs.jpg 887w, http:\/\/amy.imarketbeta.com\/blog\/wp-content\/uploads\/2017\/10\/grmetro-tvs-236x300.jpg 236w, http:\/\/amy.imarketbeta.com\/blog\/wp-content\/uploads\/2017\/10\/grmetro-tvs-768x977.jpg 768w, http:\/\/amy.imarketbeta.com\/blog\/wp-content\/uploads\/2017\/10\/grmetro-tvs-826x1050.jpg 826w\" sizes=\"(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 905px, 1075px\" \/><\/p>\n<p>The functionality of each template variable should be evident in the title\/description, but some may be a little less clear. Let&#8217;s look at each one individually:<\/p>\n<ul>\n<li><strong>Use image in page design automatically:<\/strong><br \/>\nThis refers to the Featured Image of the subpage. Checking &#8220;off&#8221; will hide the image (and in this case, will also hide the Hero text).<\/li>\n<li><strong>Exclude text for hero image<br \/>\n<\/strong>As the description explains, checking this box will hide the hero text from the featured image (in this case, the &#8220;Heating&#8221; text with the white box background).<\/li>\n<li><strong>Text for hero image<\/strong><strong><br \/>\n<\/strong>By default, this site uses a shortcode to automatically fill in the Hero Text with the Menu Title. An iMarketStaff user could remove this shortcode and add custom text in this field.<\/li>\n<li><strong>Checkbox to Exclude All Sidebar Content<br \/>\n<\/strong>Checking this box excludes the entire sidebar <em>and makes the top and main content full-width.<\/em><\/li>\n<li><strong>Checkbox to Exclude Promotions Sidebar<br \/>\n<\/strong>Checking this box excludes the promotions block from the sidebar.<\/li>\n<li><strong>Checkbox to Exclude Testimonial Sidebar<br \/>\n<\/strong>Checking this box excludes the reviews block from the sidebar.<\/li>\n<li><strong>Checkbox to Exclude Service Area Section from Sidebar<br \/>\n<\/strong>Checking this box excludes the service areas block from the sidebar.<strong><br \/>\n<\/strong><\/li>\n<li><strong>Checkbox to Exclude Newsletter Signup Sidebar<br \/>\n<\/strong>Checking this box excludes the newsletter signup block from the sidebar.<strong><br \/>\n<\/strong><\/li>\n<\/ul>\n<p>Since each site design is custom, there will likely be other template variables you come across that are not illustrated in this example. Reading the title and description of the\u00a0template variable should give you a clue about how it functions. If something is unclear, please open a ticket to Development.<\/p>\n<p>Otherwise, iMarketStaff users should feel free to use the available template variables to customize pages based on client requests.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>How to use template variables to customize website functionality on a page-by-page basis. <\/p>\n","protected":false},"author":1,"featured_media":0,"parent":500,"menu_order":25,"comment_status":"closed","ping_status":"closed","template":"","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"http:\/\/amy.imarketbeta.com\/blog\/wp-json\/wp\/v2\/pages\/519"}],"collection":[{"href":"http:\/\/amy.imarketbeta.com\/blog\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"http:\/\/amy.imarketbeta.com\/blog\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"http:\/\/amy.imarketbeta.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/amy.imarketbeta.com\/blog\/wp-json\/wp\/v2\/comments?post=519"}],"version-history":[{"count":1,"href":"http:\/\/amy.imarketbeta.com\/blog\/wp-json\/wp\/v2\/pages\/519\/revisions"}],"predecessor-version":[{"id":1660,"href":"http:\/\/amy.imarketbeta.com\/blog\/wp-json\/wp\/v2\/pages\/519\/revisions\/1660"}],"up":[{"embeddable":true,"href":"http:\/\/amy.imarketbeta.com\/blog\/wp-json\/wp\/v2\/pages\/500"}],"wp:attachment":[{"href":"http:\/\/amy.imarketbeta.com\/blog\/wp-json\/wp\/v2\/media?parent=519"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/amy.imarketbeta.com\/blog\/wp-json\/wp\/v2\/categories?post=519"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/amy.imarketbeta.com\/blog\/wp-json\/wp\/v2\/tags?post=519"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}