<?xml version="1.0"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>Transition Technology: Ticket #596: Captions issue</title>
    <link>http://localhost:8080/trac/ticket/596</link>
    <description>&lt;p&gt;
basically captions are appearing on body inline images and featured images on STG but not PROD and I can't see where the difference is...
&lt;/p&gt;
&lt;p&gt;
The following code addition to the bottom of template.php should be (but isn't) adding the caption class to images such as the one at the top of this page:
&lt;/p&gt;
&lt;p&gt;
&lt;a class="ext-link" href="https://www.transitionnetwork.org/blogs/ed-mitchell/2013-06/test-blog-test-caption-and-featured-image"&gt;&lt;span class="icon"&gt;​&lt;/span&gt;https://www.transitionnetwork.org/blogs/ed-mitchell/2013-06/test-blog-test-caption-and-featured-image&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
Any reason you can think of why not? Or do you know of another easy way of adding the class caption to featured image fields? (I guess the module &lt;a class="ext-link" href="https://drupal.org/project/semantic_cck"&gt;&lt;span class="icon"&gt;​&lt;/span&gt;https://drupal.org/project/semantic_cck&lt;/a&gt; - but maybe overkill...)
&lt;/p&gt;
&lt;p&gt;
/&lt;strong&gt;
&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;Adds caption css class to featured images
*/
&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;
function transition2_imagecache_formatter_featured_image_default($element) {
&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;
&lt;em&gt; Inside a view $element may contain NULL data. In that case, just return.
if (empty($element&lt;a class="wiki" href="http://localhost:8080/trac/wiki/WikiStart#item"&gt;#item&lt;/a&gt;&lt;a class="missing wiki"&gt;fid?&lt;/a&gt;)) {
&lt;/em&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;
return &lt;em&gt;;
&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;
}
&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;
&lt;em&gt; Extract the preset name from the formatter name.
$presetname = substr($element&lt;a class="wiki" href="http://localhost:8080/trac/wiki/WikiStart#formatter"&gt;#formatter&lt;/a&gt;, 0, strrpos($element&lt;a class="wiki" href="http://localhost:8080/trac/wiki/WikiStart#formatter"&gt;#formatter&lt;/a&gt;, '_'));
$style = 'linked';
$style = 'default';
&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;
$item = $element&lt;a class="wiki" href="http://localhost:8080/trac/wiki/WikiStart#item"&gt;#item&lt;/a&gt;;
$item&lt;a class="missing wiki"&gt;data?&lt;/a&gt;&lt;a class="missing wiki"&gt;alt?&lt;/a&gt; = isset($item&lt;a class="missing wiki"&gt;data?&lt;/a&gt;&lt;a class="missing wiki"&gt;alt?&lt;/a&gt;) ? $item&lt;a class="missing wiki"&gt;data?&lt;/a&gt;&lt;a class="missing wiki"&gt;alt?&lt;/a&gt; : &lt;em&gt;;
$item&lt;a class="missing wiki"&gt;data?&lt;/a&gt;&lt;a class="missing wiki"&gt;title?&lt;/a&gt; = isset($item&lt;a class="missing wiki"&gt;data?&lt;/a&gt;&lt;a class="missing wiki"&gt;title?&lt;/a&gt;) ? $item&lt;a class="missing wiki"&gt;data?&lt;/a&gt;&lt;a class="missing wiki"&gt;title?&lt;/a&gt; : NULL;
&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;
$class = "imagecache imagecache-$presetname imagecache-$style imagecache-{$element&lt;a class="wiki" href="http://localhost:8080/trac/wiki/WikiStart#formatter"&gt;#formatter&lt;/a&gt;} caption";
return theme('imagecache', $presetname, $item&lt;a class="missing wiki"&gt;filepath?&lt;/a&gt;, $item&lt;a class="missing wiki"&gt;data?&lt;/a&gt;&lt;a class="missing wiki"&gt;alt?&lt;/a&gt;, $item&lt;a class="missing wiki"&gt;data?&lt;/a&gt;&lt;a class="missing wiki"&gt;title?&lt;/a&gt;, array('class' =&amp;gt; $class));
&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;
}
&lt;/p&gt;
</description>
    <language>en-us</language>
    <image>
      <title>Transition Technology</title>
      <url>/trac/chrome/site/TransitionNetwork-Logo-Web-Small.jpg</url>
      <link>http://localhost:8080/trac/ticket/596</link>
    </image>
    <generator>Trac 0.12.5</generator>
    <item>
      
        <dc:creator>benj</dc:creator>

      <pubDate>Mon, 16 Sep 2013 16:59:18 GMT</pubDate>
      <title>owner, status changed</title>
      <link>http://localhost:8080/trac/ticket/596#comment:1</link>
      <guid isPermaLink="false">http://localhost:8080/trac/ticket/596#comment:1</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;owner&lt;/strong&gt;
              changed from &lt;em&gt;laura&lt;/em&gt; to &lt;em&gt;jim&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;status&lt;/strong&gt;
                changed from &lt;em&gt;new&lt;/em&gt; to &lt;em&gt;assigned&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>jim</dc:creator>

      <pubDate>Mon, 16 Sep 2013 17:20:16 GMT</pubDate>
      <title>cc set</title>
      <link>http://localhost:8080/trac/ticket/596#comment:2</link>
      <guid isPermaLink="false">http://localhost:8080/trac/ticket/596#comment:2</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;cc&lt;/strong&gt;
              &lt;em&gt;ed&lt;/em&gt;, &lt;em&gt;ben&lt;/em&gt; added
            &lt;/li&gt;
          &lt;/ul&gt;
        &lt;p&gt;
Adding Ed and Ben to CC list...
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>jim</dc:creator>

      <pubDate>Mon, 16 Sep 2013 17:30:45 GMT</pubDate>
      <title>cc changed</title>
      <link>http://localhost:8080/trac/ticket/596#comment:3</link>
      <guid isPermaLink="false">http://localhost:8080/trac/ticket/596#comment:3</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;cc&lt;/strong&gt;
              &lt;em&gt;benj&lt;/em&gt; added; &lt;em&gt;ben&lt;/em&gt; removed
            &lt;/li&gt;
          &lt;/ul&gt;
        &lt;p&gt;
That's benj, not ben...
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>laura</dc:creator>

      <pubDate>Mon, 16 Sep 2013 19:35:03 GMT</pubDate>
      <title></title>
      <link>http://localhost:8080/trac/ticket/596#comment:4</link>
      <guid isPermaLink="false">http://localhost:8080/trac/ticket/596#comment:4</guid>
      <description>
        &lt;pre class="wiki"&gt;Hi Ben
I'll have a look through my old notes here tomorrow when back at the desk.  I remember we set up a captions effect for the individual ingredients, but would need to take a look back to see if I have notes on how these worked, could v poss have been a Jim thing he set up, then I styled up after when everything was in place on the ingredients.
Don't think (but could well be wrong!) we used one of the caption format modules that I tend to use on other Drupal sites.
Will have a look tomorrow eve, and get back to you if can find anything that may help.
Hope all is well,
Best
Laura
On 16 Sep 2013, at 17:58, "Transiton Technology Trac" &amp;lt;trac@tech.transitionnetwork.org&amp;gt; wrote:
&amp;gt; #596: Captions issue
&amp;gt; ------------------------------------+-----------------------------------
&amp;gt;                 Reporter:  benj    |                Owner:  laura
&amp;gt;                     Type:  defect  |               Status:  new
&amp;gt;                 Priority:  minor   |            Milestone:  Maintenance
&amp;gt;                Component:  Theme   |             Keywords:
&amp;gt; Estimated Number of Hours:  0       |  Add Hours to Ticket:  0
&amp;gt;                Billable?:  1       |          Total Hours:  0
&amp;gt; ------------------------------------+-----------------------------------
&amp;gt; basically captions are appearing on body inline images and featured images
&amp;gt; on STG but not PROD and I can't see where the difference is...
&amp;gt;
&amp;gt; The following code addition to the bottom of template.php should be (but
&amp;gt; isn't) adding the caption class to images such as the one at the top of
&amp;gt; this page:
&amp;gt;
&amp;gt;
&amp;gt; https://www.transitionnetwork.org/blogs/ed-mitchell/2013-06/test-blog-
&amp;gt; test-caption-and-featured-image
&amp;gt;
&amp;gt; Any reason you can think of why not? Or do you know of another easy way of
&amp;gt; adding the class caption to featured image fields? (I guess the module
&amp;gt; https://drupal.org/project/semantic_cck - but maybe overkill...)
&amp;gt;
&amp;gt; /**
&amp;gt;  * Adds caption css class to featured images
&amp;gt;  */
&amp;gt; function transition2_imagecache_formatter_featured_image_default($element)
&amp;gt; {
&amp;gt;   // Inside a view $element may contain NULL data. In that case, just
&amp;gt; return.
&amp;gt;   if (empty($element['#item']['fid'])) {
&amp;gt;     return '';
&amp;gt;   }
&amp;gt;
&amp;gt;   // Extract the preset name from the formatter name.
&amp;gt;   $presetname = substr($element['#formatter'], 0,
&amp;gt; strrpos($element['#formatter'], '_'));
&amp;gt;   $style = 'linked';
&amp;gt;   $style = 'default';
&amp;gt;
&amp;gt;   $item = $element['#item'];
&amp;gt;   $item['data']['alt'] = isset($item['data']['alt']) ?
&amp;gt; $item['data']['alt'] : '';
&amp;gt;   $item['data']['title'] = isset($item['data']['title']) ?
&amp;gt; $item['data']['title'] : NULL;
&amp;gt;
&amp;gt;   $class = "imagecache imagecache-$presetname imagecache-$style
&amp;gt; imagecache-{$element['#formatter']} caption";
&amp;gt;   return theme('imagecache', $presetname, $item['filepath'],
&amp;gt; $item['data']['alt'], $item['data']['title'], array('class' =&amp;gt; $class));
&amp;gt; }
&amp;gt;
&amp;gt; --
&amp;gt; Ticket URL: &amp;lt;https://tech.transitionnetwork.org/trac/ticket/596&amp;gt;
&amp;gt; Transition Technology &amp;lt;https://tech.transitionnetwork.org/trac&amp;gt;
&amp;gt; Support and issues tracking for the Transition Network Web Project.
&lt;/pre&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>chris</dc:creator>

      <pubDate>Tue, 10 Jun 2014 09:41:32 GMT</pubDate>
      <title>cc changed</title>
      <link>http://localhost:8080/trac/ticket/596#comment:5</link>
      <guid isPermaLink="false">http://localhost:8080/trac/ticket/596#comment:5</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;cc&lt;/strong&gt;
              &lt;em&gt;ben&lt;/em&gt; added
            &lt;/li&gt;
          &lt;/ul&gt;
        &lt;p&gt;
Replying to &lt;a href="http://localhost:8080/trac/ticket/596#comment:3" title="Comment 3 for Ticket #596"&gt;jim&lt;/a&gt;:
&lt;/p&gt;
&lt;blockquote class="citation"&gt;
&lt;p&gt;
That's benj, not ben...
&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;
Not any more!
&lt;/p&gt;
&lt;p&gt;
Cc ben added, see &lt;a class="reopened ticket" href="http://localhost:8080/trac/ticket/738" title="task: Change 'ben' account to have Ben Jarlett as owner (reopened)"&gt;ticket:738&lt;/a&gt;
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item>
 </channel>
</rss>