Embed Plone's Topic results as Web Widget
Project description
rt.topicembed introduction
==========================
This product add's new tab to the topic content type called `embed`, and
publish topic's items similar to **twitter** widget.
Embed
-----
This is practically a simple form that allows user to configure a web widget.
The code can be found in the `textarea` in the same view. An example code
looks like that:
```html
<script>
(function() {
var s = document.createElement('script');
s.src = 'http://nohost/plone/events/embed.js';
s.async = true;
window.topic_options = (window.topic_options || []).concat([ {
element_id: 'embeded_id',
elements_length: 5, //how many elements to show
embed_css: true, //embed rt.topicembed css styles
new_window: true //open links in new window
}]);
document.body.appendChild(s);
}());
</script>
```
This code can be later embeded on the external site, the same as **twitter** widget.
Output
------
The template for rendering the output is registered by this ZCML slug:
```xml
<browser:page
name="json"
for="Products.ATContentTypes.interfaces.topic.IATTopic"
layer="..interfaces.IBrowserLayer"
class=".embed.EmbedJSON"
permission="zope2.View"
/>
```
and it's called `items_macro.pt`. It generates an HTML output similar to:
```html
<div>
<p>
<a href="http://nohost/plone/events/event1">Event 1 title</a>
</p>
<div>Short event description</div>
<img src="http://nohost/plone/events/event1/image_mini" title="Event 1 image">
</div>
<div>
<p>
<a href="http://nohost/plone/events/event2">Event 2 title</a>
</p>
<div>Other event description</div>
<img src="http://nohost/plone/events/event2/image_mini" title="Event 2 image">
</div>
```
Changelog
=========
1.2 (2013-03-18)
----------------
- add image size selection [amleczko]
- add example CSS [massimo]
- add translations [amleczko]
1.1.1 (2013-03-05)
------------------
- Fix JSON [amleczko]
1.0 (2013-03-05)
----------------
- Initial release
==========================
This product add's new tab to the topic content type called `embed`, and
publish topic's items similar to **twitter** widget.
Embed
-----
This is practically a simple form that allows user to configure a web widget.
The code can be found in the `textarea` in the same view. An example code
looks like that:
```html
<script>
(function() {
var s = document.createElement('script');
s.src = 'http://nohost/plone/events/embed.js';
s.async = true;
window.topic_options = (window.topic_options || []).concat([ {
element_id: 'embeded_id',
elements_length: 5, //how many elements to show
embed_css: true, //embed rt.topicembed css styles
new_window: true //open links in new window
}]);
document.body.appendChild(s);
}());
</script>
```
This code can be later embeded on the external site, the same as **twitter** widget.
Output
------
The template for rendering the output is registered by this ZCML slug:
```xml
<browser:page
name="json"
for="Products.ATContentTypes.interfaces.topic.IATTopic"
layer="..interfaces.IBrowserLayer"
class=".embed.EmbedJSON"
permission="zope2.View"
/>
```
and it's called `items_macro.pt`. It generates an HTML output similar to:
```html
<div>
<p>
<a href="http://nohost/plone/events/event1">Event 1 title</a>
</p>
<div>Short event description</div>
<img src="http://nohost/plone/events/event1/image_mini" title="Event 1 image">
</div>
<div>
<p>
<a href="http://nohost/plone/events/event2">Event 2 title</a>
</p>
<div>Other event description</div>
<img src="http://nohost/plone/events/event2/image_mini" title="Event 2 image">
</div>
```
Changelog
=========
1.2 (2013-03-18)
----------------
- add image size selection [amleczko]
- add example CSS [massimo]
- add translations [amleczko]
1.1.1 (2013-03-05)
------------------
- Fix JSON [amleczko]
1.0 (2013-03-05)
----------------
- Initial release
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
rt.topicembed-1.2.zip
(17.2 kB
view details)
File details
Details for the file rt.topicembed-1.2.zip
.
File metadata
- Download URL: rt.topicembed-1.2.zip
- Upload date:
- Size: 17.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8dbcb7d2a75260a7122813d3b7170f8f3f297abd9b6a483498807b35f753d088 |
|
MD5 | 864a5ea6c92a9516cfd558cb9748c888 |
|
BLAKE2b-256 | 018c67e015e0eedc023eccec9fa857b30f94f22bb3732ec7fee35aae38401ec0 |