Content sharing

Content nuggets

A content nugget is a coherent set of data meant to be shared.

Data structure

Content nuggets’ data are of the following nature:

  • Title
  • URL
  • Text
  • Image

For an application to share its content, it must have the Sharable Behaviour. This entails defining the content nugget’s structure for the application—i.e. which fields are to be shared.

Data catchers

Data catchers are application components which make use of the content nuggets.

They are defined in the application’s metadata.config.php file, as are other components (templates, enhancers and launchers).

Data catchers included in Novius OS

  • Simple Twitter
  • Simple Facebook
  • Simple Google+
  • Blog

The Blog data catcher is used to create a new blog post with other applications’ content, especially customer-specific applications. Let’s say you add a new product to your catalogue, this data catcher allows you to easily announce this new addition on your blog.

Example : Simple Twitter

Here is how the data catcher for simple sharing to Twitter is defined:

<?php

return array(
'data_catchers' => array(
    'noviusos_simpletwitter' => array(
        'title' => 'Twitter',
        'description'  => '',
        'iconUrl' => 'static/apps/noviusos_simpletwitter/img/twitter.png',
        'action' => array(
            'action' => 'window.open',
            'url' => 'https://twitter.com/intent/tweet?text={{urlencode:'.\Nos\DataCatcher::TYPE_TITLE.'}}&url={{urlencode:absolute_url}}',
        ),
        'onDemand' => true,
        'specified_models' => false,
        'required_data' => array(
            \Nos\DataCatcher::TYPE_TITLE,
        ),
        'optional_data' => array(
            \Nos\DataCatcher::TYPE_URL,
        ),
    ),
),
);

The Simple Twitter data catcher requires content nuggets featuring at least a title. URLs are optional but are used when provided.

Read the Docs v: dubrovka
Versions
latest
elche
dubrovka
chiba.2
chiba.1
Downloads
PDF
HTML
Epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.