Skip to content

Commit

Permalink
schema.org/Article metadata included as RDFa, now we must modify byli…
Browse files Browse the repository at this point in the history
…ne and keywords viewlets to include metadata (issue #47)
  • Loading branch information
Juan Pablo Giménez committed Jul 25, 2013
1 parent 823fc51 commit eb19914
Showing 1 changed file with 73 additions and 77 deletions.
150 changes: 73 additions & 77 deletions src/collective/nitf/templates/view.pt
Original file line number Diff line number Diff line change
Expand Up @@ -8,91 +8,87 @@

<body>

<div tal:replace="structure provider:plone.abovecontenttitle" />
<metal:bodytext fill-slot="main">
<span vocab="http://schema.org/" typeof="Article"
xmlns:rnews="http://iptc.org/std/rNews/2011-10-07#">

<metal:title fill-slot="content-title">
<tal:content-title metal:define-macro="content-title">
<p class="section" tal:content="context/section" />
<h1 class="documentFirstHeading" tal:content="context/title" />
<h2 class="nitfSubtitle" tal:content="context/subtitle" />
</tal:content-title>
</metal:title>
<div id="viewlet-above-content-title" tal:content="structure provider:plone.abovecontenttitle"
tal:condition="not:ajax_load" />
<p class="section" tal:content="context/section" property="rnews:articleSection"/>
<h1 class="documentFirstHeading" tal:content="context/title" property="rnews:name"/>
<h2 class="nitfSubtitle" tal:content="context/subtitle" property="rnews:alternativeHeadline"/>
<div id="viewlet-below-content-title" tal:content="structure provider:plone.belowcontenttitle"
tal:condition="not:ajax_load" />

<metal:description fill-slot="content-description">
<tal:content-description metal:define-macro="content-description">
<div class="documentDescription" tal:content="context/description" />
<p class="nitfByline" tal:condition="context/byline|nothing">
<span i18n:translate="">By</span>
<span tal:content="context/byline" />
</p>
</tal:content-description>
</metal:description>
<div class="documentDescription" tal:content="context/description" property="rnews:description"/>

<metal:main fill-slot="content-core">
<tal:content-core metal:define-macro="content-core">
<div class="newsImageContainer"
tal:define="image context/getImage"
tal:condition="image">
<a href="@@nitf_galleria"
id="parent-fieldname-image"
class="parent-nitf-image"
tal:attributes="href string:${context/absolute_url}/@@nitf_galleria">
<img src="" alt=""
tal:replace="structure python: image.tag(scale='mini', css_class='newsImage nitf')" /></a>
<p class="discreet"
tal:condition="context/imageCaption"
tal:content="context/imageCaption">
Image Caption
</p>
</div>
<div id="viewlet-above-content-body" tal:content="structure provider:plone.abovecontentbody"
tal:condition="not:ajax_load" />
<div class="newsImageContainer"
tal:define="image context/getImage"
tal:condition="image">
<a href="@@nitf_galleria"
id="parent-fieldname-image"
class="parent-nitf-image"
tal:attributes="href string:${context/absolute_url}/@@nitf_galleria">
<span rel="thumbnailUrl">
<img src="" alt=""
tal:replace="structure python: image.tag(scale='mini', css_class='newsImage nitf')" />
</span></a>
<p class="discreet"
tal:condition="context/imageCaption"
tal:content="context/imageCaption">
Image Caption
</p>
</div>

<div tal:content="structure context/text/output|nothing" />
<div tal:content="structure context/text/output|nothing" property="rnews:articleBody" />

<fieldset id="related-items" tal:condition="context/relatedItems|nothing">
<legend i18n:translate="">Related items</legend>
<tal:relateditems tal:content="structure view/w/relatedItems/render" />
</fieldset>
<fieldset id="related-items" tal:condition="context/relatedItems|nothing">
<legend i18n:translate="">Related items</legend>
<tal:relateditems tal:content="structure view/w/relatedItems/render" />
</fieldset>

<fieldset id="folder-listing" tal:condition="not:context/is_empty">
<legend i18n:translate="">Contents</legend>
<tal:block define="listing_macro context/folder_listing/macros/listing;
contentFilter python:{'portal_type': ['File', 'Link']}">
<metal:use_macro use-macro="listing_macro" />
</tal:block>
</fieldset>
<fieldset id="folder-listing" tal:condition="not:context/is_empty">
<legend i18n:translate="">Contents</legend>
<tal:block define="listing_macro context/folder_listing/macros/listing;
contentFilter python:{'portal_type': ['File', 'Link']}">
<metal:use_macro use-macro="listing_macro" />
</tal:block>
</fieldset>

<div class="newsview">
<link rel="stylesheet" type="text/css"
tal:attributes="href string:${context/@@plone_portal_state/portal_url}/++resource++collective.nitf/galleria-theme/galleria.nitf_theme.css" />
<script type="text/javascript">
(function($) {
"use strict";
$(document).ready(function() {
var link = $(".parent-nitf-image");
if( /Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent) ) {
link.attr('href', link.attr('href').replace('@@nitf_galleria' , '@@nitf_full_galleria'));
} else {
link.prepOverlay({
subtype: 'ajax',
filter: '#content-core > *',
width: '524px',
config: {
onLoad : function (e) {
Galleria.loadTheme("++resource++collective.nitf/galleria-theme/galleria.nitf_theme.js");
Galleria.configure({debug: false});
Galleria.run(".pb-ajax #mediabox");
}
}
});
}
});
})(jQuery);
</script>
</div>
<div class="newsview">
<link rel="stylesheet" type="text/css"
tal:attributes="href string:${context/@@plone_portal_state/portal_url}/++resource++collective.nitf/galleria-theme/galleria.nitf_theme.css" />
<script type="text/javascript">
(function($) {
"use strict";
$(document).ready(function() {
var link = $(".parent-nitf-image");
if( /Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent) ) {
link.attr('href', link.attr('href').replace('@@nitf_galleria' , '@@nitf_full_galleria'));
} else {
link.prepOverlay({
subtype: 'ajax',
filter: '#content-core > *',
width: '524px',
config: {
onLoad : function (e) {
Galleria.loadTheme("++resource++collective.nitf/galleria-theme/galleria.nitf_theme.js");
Galleria.configure({debug: false});
Galleria.run(".pb-ajax #mediabox");
}
}
});
}
});
})(jQuery);
</script>
</div>
<div id="viewlet-below-content-body" tal:content="structure provider:plone.belowcontentbody" tal:condition="not:ajax_load" />

</tal:content-core>

</metal:main>
</span>
</metal:bodytext>

</body>

Expand Down

0 comments on commit eb19914

Please sign in to comment.