]> _ Git - fluidbook-v3.git/commitdiff
Microdata improvements. WIP #580 @3
authorstephen@cubedesigners.com <stephen@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Fri, 29 Jul 2016 17:05:11 +0000 (17:05 +0000)
committerstephen@cubedesigners.com <stephen@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Fri, 29 Jul 2016 17:05:11 +0000 (17:05 +0000)
framework/application/views/scripts/common/footer.phtml

index 1006b6c1f6c54a27f0a6cd04683a0ed1cfd0e087..2e06d828e27df98d3e33bd1c2664d154a8cfe148 100644 (file)
@@ -2,28 +2,44 @@
 \r
 $this->headScript()->addScriptAndStyle('102-footer');\r
 \r
+// Microdata note: the whole footer is wrapped in the "Organization" item so that social links can be included\r
+// See final output at bottom for microdata wrapper\r
+\r
 $res = '<footer class="site">';\r
 \r
 // Wrapper element needed so percentage based padding matches the main content areas\r
 // Padding needs to be based on a max-width of 1680px, not the actual screen width\r
 $res .= '<div class="footer-inner">';\r
 \r
-$logo = $this->imageCms($this->option('logo'), 'Fluidbook', 180, 45);\r
+$res .= '<div class="contact-details">';\r
+\r
+$logo = $this->imageCms($this->option('logo'), 'Fluidbook', 180, 45, ['itemprop' => 'logo']);\r
 $address = $this->option('address');\r
 \r
+\r
 // Get translation for country code\r
 $locale = new Zend_Locale();\r
 $country = strtoupper($locale->getTranslation($address['pays'], 'Territory'));\r
 \r
-$res .= '<div class="contact-details">';\r
-$res .= $this->link($logo, 'internal:home');\r
-$res .= '<address>';\r
-$res .= "{$address['adresse']}<br>{$address['code_postal']} {$address['ville']} - $country";\r
-$res .= '<br>';\r
-$res .= __('Tél.') . ' ' . $this->linkPhone($address['phone']);\r
-$res .= '<br>';\r
-$res .= $this->linkEmail($address['email']);\r
-$res .= '</address>';\r
+// Microdata\r
+$res .= $this->microdataMeta($address['company'], 'name'); // Since we only have the logo and no text version of the name, it will be a meta microdata\r
+$res .= $this->link($logo, 'internal:home', ['itemprop' => 'url']);\r
+\r
+// Address block\r
+$a  = $this->microdataProp($address['adresse'], 'streetAddress');\r
+$a .= '<br>';\r
+$a .= $this->microdataProp($address['code_postal'], 'postalCode');\r
+$a .= ' ';\r
+$a .= $this->microdataProp($address['ville'], 'addressLocality');\r
+$a .= ' - ';\r
+$a .= $this->microdataProp($country, 'addressCountry');\r
+$a .= '<br>';\r
+$a .= __('Tél.') . ' ';\r
+$a .= $this->linkPhone($address['phone'], $address['phone'], ['itemprop' => 'telephone']);\r
+$a .= '<br>';\r
+$a .= $this->linkEmail($address['email'], $address['email'], ['itemprop' => 'email']);\r
+\r
+$res .= $this->microdataPostalAddress($a, ['tag' => 'address'], 'address');\r
 $res .= '</div>'; // .contact-details\r
 \r
 // Menus\r
@@ -38,7 +54,12 @@ foreach ($this->option('social_networks') as $social) {
        $res .= '<style type="text/css">';\r
        $res .= '#s-' . $social['icon'] . ':hover{background-color: ' . $social['color'] . ';border-color: ' . $social['color'] . ';}';\r
        $res .= '</style>';\r
-       $res .= $this->link('', $social['url'], array('id' => 's-' . $social['icon'], 'class' => 'social-link fb-' . $social['icon'], 'data-event' => array('category' => 'social', 'action' => 'go', 'label' => $social['icon'])));\r
+       $res .= $this->link('', $social['url'], array('id' => 's-' . $social['icon'],\r
+                                                  'class' => 'social-link fb-' . $social['icon'],\r
+                                                  'itemprop' => 'sameAs',\r
+                                                  'data-event' => array('category' => 'social',\r
+                                                                        'action' => 'go',\r
+                                                                        'label' => $social['icon'])));\r
        $res .= '</a>';\r
 }\r
 $res .= '</div>'; // .footer-external\r
@@ -64,6 +85,5 @@ $res .= $this->markupDotclear($this->option('footer'));
 $res .= '</div>'; // .footer-inner\r
 $res .= '</footer>'; // footer.legal\r
 \r
-echo '<div class="section fp-auto-height">';\r
-echo $res;\r
-echo '</div>';
\ No newline at end of file
+// Output footer with Organization microdata wrapper\r
+echo $this->microdata($res, ['class' => 'section fp-auto-height'], 'Organization');
\ No newline at end of file