{"id":580,"date":"2011-05-13T00:57:38","date_gmt":"2011-05-12T23:57:38","guid":{"rendered":"http:\/\/muttznutz.net\/muttzblog\/?p=580"},"modified":"2011-06-07T00:06:32","modified_gmt":"2011-06-06T23:06:32","slug":"keyword-classes-pt-3-using-the-keywords","status":"publish","type":"post","link":"https:\/\/muttznutz.net\/muttzblog\/post-processing\/keyword-classes-pt-3-using-the-keywords","title":{"rendered":"Keyword classes Pt. 3 &#8211; Using the keywords"},"content":{"rendered":"<p>The <a title=\"First article - about image metadata and keywords\" href=\"https:\/\/muttznutz.net\/muttzblog\/post-processing\/introduction-to-keywords-classes\">first of these articles<\/a> I talked about image metadata, and explained why I decided I needed a way of treating different keywords in different ways. I explained how keywords are now accessible in lots of different software packages.<\/p>\n<p>The <a title=\"Keyword classes - setting 'em up\" href=\"https:\/\/muttznutz.net\/muttzblog\/post-processing\/setting-them-up\">second article<\/a> went through the main constraints I found in setting things up, and how I worked around some of the pitfalls.<\/p>\n<p>This article explains the different phases through which my website evolved, as new technologies became available.It shows practical examples of how Keyword Classes can be deployed in an image-oriented website.<\/p>\n<h3>Website evolution<\/h3>\n<p>Before I get too into using the keyword classes, it&#8217;s probably worth going through the three stages through which my website evolved.<\/p>\n<p>I&#8217;ll be looking at these pages primarily from the perspective of loading image pages.<\/p>\n<h4>Hand-crafted<\/h4>\n<p>This involves building web pages individually. You can do this by hand-coding HTML or by using a web tool such as HTML-KIT, or (most commonly) using tools such as Word and <a title=\"Frontpage help page\" href=\"http:\/\/office.microsoft.com\/en-us\/frontpage-help\/create-a-web-site-with-frontpage-RZ006179028.aspx\">FrontPage<\/a>.<\/p>\n<p>The main disadvantages of this approach are that each page needs to be built separately &#8211; and needs to be individually integrated. Links need to be tested. And &#8211; most importantly &#8211; when you bring a new page into the site, then all of the other pages need to be reloaded. This maintenance overhead makes it unsuitable for all but the most simple of sites &#8211; with more than about a dozen pages, then updates become very hard work.<\/p>\n<p>Keyword classes have little relevance here &#8211; there are no automated processes to use the information.<\/p>\n<h4>Static HTML pages<\/h4>\n<p>The next stage was to use a tool that generates an HTML album &#8211; typically with thumbnails and detail pages. That album is generated in its entirety, and is typically produced, and then uploaded, as a complete folder. To make changes, you typically need to regenerate and reload the entire album.<\/p>\n<p>Typically, image processing software will include an album generator &#8211; Photoshop Elements and Paint Shop Pro both supported album software, and Lightroom still offers one of these options.<\/p>\n<p>The problem with most of these is that they don&#8217;t allow customisation from the basic available templates &#8211; so you&#8217;re limited to being able to change a few colours, or choose how many\u00a0 columns to have on a page.<\/p>\n<p>One tool stood out in this class, however. <a title=\"JAlbum homepage\" href=\"http:\/\/jalbum.net\/en\/\">JAlbum<\/a> provides a framework, and is written in a standard, openly available programming language (Java) so developers could change the look-and-feel of the albums. These are released as &#8220;skins&#8221; &#8211; and skilled users can personalise the appearance through the <a title=\"W3 Schools CSS tutorial home\" href=\"http:\/\/www.w3schools.com\/css\/default.asp\">CSS<\/a>.<\/p>\n<p>Those with development skills can &#8211; as I did &#8211; can delve into the code and change the code to incorporate conditional processing to handle keywords (<em>I had a development background, but had to teach myself Java<\/em>). For my implementation, I integrated JAlbum with a MySQL database with the log of all my dives. There are still a <a title=\"UK 2005 - example album\" href=\"https:\/\/muttznutz.net\/images\/ukdiving2005\/index.html\">couple of legacy albums<\/a> on my site that were built with JAlbum.<\/p>\n<p>Again, however, if you wanted to update your site, then you had to regenerate and reload all the HTML pages. A bit of a grind (<em>I&#8217;ve now got 4,000 images online)<\/em> but much more feasible than the first option.<\/p>\n<h4>Dynamic HTML pages<\/h4>\n<p>This method uses a web scripting language. I use <a title=\"php home page\" href=\"http:\/\/www.php.net\/\">php<\/a>, which is a cross-platform tool &#8211; so I can develop on a PC, Mac or Linux machine (my web server runs Linux). There are Microsoft alternatives, but they tend to involve integrating several different tools.<\/p>\n<p>Now the database can be held on the server, and I query it interactively.<\/p>\n<p>But the most important thing is that the page generation is scripted, so (for example) introducing a new sidebar icon may involve changing only one file &#8211; and all of the pages will be updated. I&#8217;m guaranteed the same behaviour for all pages. Much less hard work.<\/p>\n<h3>Using the Keywords<\/h3>\n<p>OK, let&#8217;s get on with the serious stuff. How can we use these keywords ?<br \/>\nLet&#8217;s break down how I&#8217;ve got it to work for <a title=\"Example page\" href=\"https:\/\/muttznutz.net\/images\/abudabab201011\/slide\/abu_B050216.html\">one of my pages<\/a> :<\/p>\n<div id=\"attachment_590\" style=\"width: 410px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/muttznutz.net\/muttzblog\/wp-content\/uploads\/2011\/05\/keywords6.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-590\" class=\"size-medium wp-image-590\" title=\"Example web page\" src=\"https:\/\/muttznutz.net\/muttzblog\/wp-content\/uploads\/2011\/05\/keywords6-400x280.png\" alt=\"Example web page\" width=\"400\" height=\"280\" srcset=\"https:\/\/muttznutz.net\/muttzblog\/wp-content\/uploads\/2011\/05\/keywords6-400x280.png 400w, https:\/\/muttznutz.net\/muttzblog\/wp-content\/uploads\/2011\/05\/keywords6.png 1018w\" sizes=\"auto, (max-width: 400px) 100vw, 400px\" \/><\/a><p id=\"caption-attachment-590\" class=\"wp-caption-text\">Example web page<\/p><\/div>\n<p>First &#8211; check out the names showing the fish &#8211; the positioning is set by the Keyword class &#8211; and the [spf] actually creates a link to another site<\/p>\n<div id=\"attachment_584\" style=\"width: 410px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/muttznutz.net\/muttzblog\/wp-content\/uploads\/2011\/05\/keywords1.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-584\" class=\"size-medium wp-image-584\" title=\"Use keywords for conditional formatting \/ positioning\" src=\"https:\/\/muttznutz.net\/muttzblog\/wp-content\/uploads\/2011\/05\/keywords1-400x112.png\" alt=\"Use keywords for conditional formatting \/ positioning\" width=\"400\" height=\"112\" srcset=\"https:\/\/muttznutz.net\/muttzblog\/wp-content\/uploads\/2011\/05\/keywords1-400x112.png 400w, https:\/\/muttznutz.net\/muttzblog\/wp-content\/uploads\/2011\/05\/keywords1.png 723w\" sizes=\"auto, (max-width: 400px) 100vw, 400px\" \/><\/a><p id=\"caption-attachment-584\" class=\"wp-caption-text\">Use keywords for conditional formatting \/ positioning<\/p><\/div>\n<p>I can set the page title to the value in the Dive Site name &#8211; keyed from the &#8220;dn&#8221; keyword class<\/p>\n<div id=\"attachment_585\" style=\"width: 410px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/muttznutz.net\/muttzblog\/wp-content\/uploads\/2011\/05\/keywords2.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-585\" class=\"size-medium wp-image-585\" title=\"Use database lookup to set (e.g.) Page title\" src=\"https:\/\/muttznutz.net\/muttzblog\/wp-content\/uploads\/2011\/05\/keywords2-400x82.png\" alt=\"Use database lookup to set (e.g.) Page title\" width=\"400\" height=\"82\" srcset=\"https:\/\/muttznutz.net\/muttzblog\/wp-content\/uploads\/2011\/05\/keywords2-400x82.png 400w, https:\/\/muttznutz.net\/muttzblog\/wp-content\/uploads\/2011\/05\/keywords2.png 540w\" sizes=\"auto, (max-width: 400px) 100vw, 400px\" \/><\/a><p id=\"caption-attachment-585\" class=\"wp-caption-text\">Use database lookup to set (e.g.) Page title<\/p><\/div>\n<p>And &#8211; in fact &#8211; I can set the title for the overall page &#8211; something Search Engines are particularly fond of.<\/p>\n<div id=\"attachment_586\" style=\"width: 410px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/muttznutz.net\/muttzblog\/wp-content\/uploads\/2011\/05\/keywords3.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-586\" class=\"size-medium wp-image-586\" title=\"The title is key for Search Engines\" src=\"https:\/\/muttznutz.net\/muttzblog\/wp-content\/uploads\/2011\/05\/keywords3-400x84.png\" alt=\"The title is key for Search Engines\" width=\"400\" height=\"84\" srcset=\"https:\/\/muttznutz.net\/muttzblog\/wp-content\/uploads\/2011\/05\/keywords3-400x84.png 400w, https:\/\/muttznutz.net\/muttzblog\/wp-content\/uploads\/2011\/05\/keywords3.png 582w\" sizes=\"auto, (max-width: 400px) 100vw, 400px\" \/><\/a><p id=\"caption-attachment-586\" class=\"wp-caption-text\">The title is key for Search Engines<\/p><\/div>\n<p>I can load a whole lot of information about the dive from my database &#8211; it would be a real pain to load it all, and virtually impossible to present it :<\/p>\n<div id=\"attachment_587\" style=\"width: 255px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/muttznutz.net\/muttzblog\/wp-content\/uploads\/2011\/05\/keywords4.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-587\" class=\"size-medium wp-image-587\" title=\"You can retrieve lots of data from a database\" src=\"https:\/\/muttznutz.net\/muttzblog\/wp-content\/uploads\/2011\/05\/keywords4-245x300.png\" alt=\"You can retrieve lots of data from a database\" width=\"245\" height=\"300\" srcset=\"https:\/\/muttznutz.net\/muttzblog\/wp-content\/uploads\/2011\/05\/keywords4-245x300.png 245w, https:\/\/muttznutz.net\/muttzblog\/wp-content\/uploads\/2011\/05\/keywords4.png 353w\" sizes=\"auto, (max-width: 245px) 100vw, 245px\" \/><\/a><p id=\"caption-attachment-587\" class=\"wp-caption-text\">You can retrieve lots of data from a database<\/p><\/div>\n<p>Just to show how things show up &#8220;under the bonnet&#8221; (View-&gt; Page Source from your browser) you can see that I&#8217;m setting the keywords for the <strong>Web Page<\/strong> as well as just the image.<\/p>\n<div id=\"attachment_588\" style=\"width: 410px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/muttznutz.net\/muttzblog\/wp-content\/uploads\/2011\/05\/keywords5.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-588\" class=\"size-medium wp-image-588\" title=\"HTML source - populating title and page keywords\" src=\"https:\/\/muttznutz.net\/muttzblog\/wp-content\/uploads\/2011\/05\/keywords5-400x126.png\" alt=\"HTML source - populating title and page keywords\" width=\"400\" height=\"126\" srcset=\"https:\/\/muttznutz.net\/muttzblog\/wp-content\/uploads\/2011\/05\/keywords5-400x126.png 400w, https:\/\/muttznutz.net\/muttzblog\/wp-content\/uploads\/2011\/05\/keywords5.png 593w\" sizes=\"auto, (max-width: 400px) 100vw, 400px\" \/><\/a><p id=\"caption-attachment-588\" class=\"wp-caption-text\">HTML source - populating title and page keywords<\/p><\/div>\n<p>If you&#8217;re really into the web design side of things, you can pretend that the selected keywords form part of the image filename. This means using .htaccess redirects on Unix\/Linux, but is a very powerful tool (although its often viewed as a form of voodoo. Here, the image name is actually abu_B050216.jpg, but it appears as yellow-spotted-triggerfish-pseudobalistes.jpg in a folder called abu_B050216<\/p>\n<div id=\"attachment_596\" style=\"width: 410px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/muttznutz.net\/muttzblog\/wp-content\/uploads\/2011\/05\/keywords7.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-596\" class=\"size-medium wp-image-596 \" title=\"View Image Info\" src=\"https:\/\/muttznutz.net\/muttzblog\/wp-content\/uploads\/2011\/05\/keywords7-400x199.png\" alt=\"View Image Info\" width=\"400\" height=\"199\" srcset=\"https:\/\/muttznutz.net\/muttzblog\/wp-content\/uploads\/2011\/05\/keywords7-400x199.png 400w, https:\/\/muttznutz.net\/muttzblog\/wp-content\/uploads\/2011\/05\/keywords7.png 767w\" sizes=\"auto, (max-width: 400px) 100vw, 400px\" \/><\/a><p id=\"caption-attachment-596\" class=\"wp-caption-text\">View Image Info<\/p><\/div>\n<p>Again, this gives more credibility with the search engines (although not as much as lots of words, unfortunately).<\/p>\n<p>You can also use the keywords to make your search engine Sitemap more relevant &#8211; I&#8217;ve automated the production of my sitemap with a php script that uses the same parsing functions as the web page script. You could do the same, perhaps, with RSS feeds (I&#8217;ve not worked on that yet !).<\/p>\n<p>Here&#8217;s a snippet (for the same photo) from my sitemap file :<br \/>\n<code> &lt;url&gt;<br \/>\n&lt;loc&gt;https:\/\/muttznutz.net\/images\/abudabab201011\/slide\/abu_B050216.html&lt;\/loc&gt;<br \/>\n&lt;lastmod&gt;2010-11-24&lt;\/lastmod&gt;<br \/>\n&lt;image:image&gt;<br \/>\n&lt;image:loc&gt;https:\/\/muttznutz.net\/images\/abudabab201011\/abu_B050216\/yellow-spotted-triggerfish-pseudobalistes.jpg&lt;\/image:loc&gt;<br \/>\n&lt;image:caption&gt;Photo at Marsa Abu Dabab:  Yellow-spotted triggerfish&lt;\/image:caption&gt;<br \/>\n&lt;\/image:image&gt;<br \/>\n&lt;\/url&gt;<\/code><\/p>\n<p>&#8230; I&#8217;ve picked up the Dive Site and the name of the fish in the caption field.<\/p>\n<p>It&#8217;s unfortunate that Google doesn&#8217;t actually seem to look at <a title=\"Google Image Sitemaps\" href=\"http:\/\/www.google.com\/support\/webmasters\/bin\/answer.py?answer=178636\">the image sitemaps they specified<\/a>, but I guess they&#8217;ll get around to it eventually&#8230;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The third article talks about how my website has evolved through different generations of technology, and shows different ways that I&#8217;ve used Keyword Classes to automate and optimise the image pages on my website<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"footnotes":""},"categories":[7,5],"tags":[118,125,117,134,119,84,136,129],"class_list":["post-580","post","type-post","status-publish","format-standard","hentry","category-keyword-classes","category-post-processing","tag-exif","tag-google-sitemaps","tag-iptc-keywords","tag-keyword-classes","tag-photo-metadata","tag-photo-workflow","tag-website-tools","tag-workflow"],"_links":{"self":[{"href":"https:\/\/muttznutz.net\/muttzblog\/wp-json\/wp\/v2\/posts\/580","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/muttznutz.net\/muttzblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/muttznutz.net\/muttzblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/muttznutz.net\/muttzblog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/muttznutz.net\/muttzblog\/wp-json\/wp\/v2\/comments?post=580"}],"version-history":[{"count":23,"href":"https:\/\/muttznutz.net\/muttzblog\/wp-json\/wp\/v2\/posts\/580\/revisions"}],"predecessor-version":[{"id":582,"href":"https:\/\/muttznutz.net\/muttzblog\/wp-json\/wp\/v2\/posts\/580\/revisions\/582"}],"wp:attachment":[{"href":"https:\/\/muttznutz.net\/muttzblog\/wp-json\/wp\/v2\/media?parent=580"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/muttznutz.net\/muttzblog\/wp-json\/wp\/v2\/categories?post=580"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/muttznutz.net\/muttzblog\/wp-json\/wp\/v2\/tags?post=580"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}