Beskrivning
Detta tillägg är utvecklat av Cyclonecode och kan användas för att ladda och exponera nyheter från Cision
För att börja samla in nyhetsobjekt från cision behöver du först lägga till ditt unika käll-ID för json flödet under tilläggets inställningssida.
Du kan ändra hur många objekt som ska hämta in, typ av flödes objekt, aktivera paginering, göra inställningar för cachning och mycket mer.
Om du har frågor eller kanske någon funktionalitet som du tycker borde implementeras kan du även prova slack.
Pro Version
Det finns en PRO version av tillägget som innehåller utökade funktioner, som exempelvis:
★ Support to fetch entire feed and not only the last 100 entries.
★ Custom post types. Creates a post for each item in WordPress. This means that all news have standard WordPress links.
★ Manually created posts can be added to the feed.
★ Custom taxonomies for categories and tags fetched from Cision.
★ Use standard article template from your active theme.
★ Support to create, update and delete posts based on PUSH events sent from Cision.
★ Support to create, update and delete posts during CRON at configurable intervals.
★ Subscription module.
★ Ticker module.
★ Shareholder module.
★ Calendar module.
★ Media module.
★ Insider module.
★ Use normal or ajax based load more button for pagination.
★ Annual free support and quicker response times.
★ Discount for multisite licenses.
Jag har som standard ett inledande möte där jag pratar om tillägget och förklarar olika funktioner och svarar på eventuella frågor.
A demo site showing some of the modules can be found here.
There is also a backlog with features yet to be implemented on github, some of the tasks in the list includes:
- Pin feed items to top of list.
- Import and export settings between environments.
- Graf modul.
- REST API.
- Bildspel
- Preview functionality.
- Disclaimer support.
- Stöd för flera mallar.
- Visa uppskattad lästid för varje nyhet.
- Samt mycket, mycket mer.
To get more information about the Pro version, send me an email at cyclonecode@gmail.com or give me a call at +(46)-791026643.
Hjälp sökes
För stunden så letar jag efter någon som skulle vilja hjälpa till med någonting av följande:
- Skapa en ikon som kan användas i adminpanelens meny.
- Skapa en baner som kan visas på tilläggets hemsida på wordpress.org.
- Ta fram ett mer intuitivt och tilltalande gränssnitt.
- Skapa en ny ikon som kan användas på olika platser.
Om skulle vilja hjälpa till med någonting av ovanstående så tveka inte att kontakta mig antingen via slack eller e-post.
Utvecklare
Jag letar efter utvecklare som tycker det skulle vara intressant att hjälpa till med antingen gratis eller premium versionen av tillägget.
Would be great just to get some ideas and input from others who have some experience in WordPress plugin development.
At this point I am pretty much on my own, which will sometimes result in me just thinking around some issues in my own way; here I think it would be awesome to have others to talk to and collaborate.
Om detta låter intressant, skicka mig gärna ett e-post meddelande eller kontakta mig på Slack.
Widget
Du kan visa ett flöde i valfritt sidofält genom att lägga till en widget.
Kortkod
Kortkoden [cision-block] kan antigen användas gentom att lägga till den i innehållsfältet för en post eller genom att använda do_shortcode funktionen i någon av dina mallar.
Kortkod attribut:
-
id
Ge ett block ett eget id. -
source_uid
Käll-ID för ditt cision-flöde -
language
Språkkod för varje objekt. Till exempel ’en’ för engelska. -
date_format
Datum format som ska användas. -
readmore
Läs mer knappens text. -
count
Maximalt antal objekt i flödet. -
view
This states what kind of items to include:
1 – include both regulatory and non-regulatory items.
2 – include only regulatory items.
3 – include only non-regulatory items. -
start
Anger startdatumet för datumintervallet, inom vilket pressmeddelanden och/eller rapporter hämtas. Formatet är 2001-12-31. -
end
Anger slutdatumet för datumintervallet, inom vilket pressmeddelanden och/eller rapporter hämtas. Formatet är 2001-12-31. -
mark_regulatory
Emphasis if a release if regulatory or non-regulatory. -
regulatory_text
Text to display for regulatory items. -
non_regulatory_text
Text to display for non-regulatory items. -
show_filters
Enable filtering of feed items. -
filter_all_text
Button text for ’all’ filter. -
filter_regulatory_text
Button text for ’regulatory’ filter. -
filter_non_regulatory_text
Button text for ’non-regulatory’ filter. -
items_per_page
Antal objekt som ska visas per sida. -
tags
Endast utgåvor med dessa etiketter kommer inkluderas. En eller flera etiketter kan anges, separerade med kommatecken. -
categories
Endast utgåvor som är kopplade till en eller flera av dessa kategorier kommer inkluderas. En eller flera kategorier kan anges, separerade med kommatecken. -
types
Endast utgåvor av dessa typer kommer inkluderas. -
image_style
Bildstil som ska användas:- DownloadUrl
- UrlTo100x100ArResized
- UrlTo200x200ArResized
- UrlTo400x400ArResized
- UrlTo800x800ArResized
- UrlTo100x100Thumbnail
- UrlTo200x200Thumbnail
-
show_excerpt
Visa utdrag för varje nyhet. -
template
Template file to use. If no template is set in settings and this parameter is not set then cision-block.php in either the active
theme or in the plugin will be used as a default.
You can either use the name of the template as given in the template header e.g ’Foo’ or the actual filename e.g foo.php. -
flush
Rensar blockets cache.
Här är ett exempel där man använder samtliga av ovanstående attribute:
[cision-block id=example_block source_uid=A275C0BF733048FFAE9126ACA64DD08F language=sv date_format=m-d-Y readmore="Read more" show_excerpt=0 view=1 count=6 items_per_page=2 tags="cision,company" categories="New Year,Summer camp" types="PRM, RDV" start=2016-01-12 end=2019-06-12 image_style=UrlTo400x400ArResized mark_regulatory=1 regulatory_text=Regulatory non_regulatory_text=*none* show_filters=1 filter_all_text=*none* filter_regulatory_text=Regulatory filter_non_regulatory_text=Non-regulatory template=foo.php flush=true]
Notice that all shortcode attributes are optional and that they must be on a single line.
Default values is taken from the plugins settings page.
Här är en komplett lista på alla olika typer av pressmeddelanden:
- KMK – Årsredovisning
- RDV – Årlig rapport
- PRM – Företagsmeddelande
- RPT – Delårsrapport
- INB – Inbjudan
- NBR – Nyhetsbrev
More than one block in a page
To use more than one block in a single page you will need to set a unique id for each block or else they will both share the same cache entry.
Filter and marking feed items
On the ’Filters’ tab you can enable filtering on you feed and add a text for the different kind of filters or use the default ones.
If for some reason you would like to hide a specific filter button you can enter the special value *none*
in the corresponding text field.
You can add a text for each feed item stating if it is regulatory or not by checking the ’Mark regulatory’ checkbox in the settings page.
If you wish to hide the text for regulatory or non-regulatory releases you can use the special value *none*
in the corresponding text field.
Mall
The template used to render the feed is cision-block/templates/cision-block.php, you can override
this template by copying it to either the root or under a templates folder in your theme.
You can also select a specific template which will be used to render the feed under the plugins settings page.
To create a new template, you can follow the steps as described in this link: Page Templates:
For instance adding a file with the following header comment would create a new ’Foo’ template:
<?php
/**
* Template name: Foo
* Template Post Type: cision-block-post
*
* Template used to display a feed from Cision.
**/
?>
Display single press releases in WordPress
Since version 2.0.0 it is possible to fetch and display press releases directly from within WordPress.
The template used in this case is cision-block/templates/cision-block-post.php, you can override
this template by copying it to either the root or under a templates folder in your theme.
The $CisionItem
feed object that is available in the template contains all raw data fetched from Cision.
Under the Resurser section there is a link that explains all the different fields that is available.
For example if you use the $CisionItem->HtmlBody
to display content from the feed item you might have to add custom
css since this contains pre formated html which may include inline css and so on.
Fält
Som standard används enbart följande fält för varje objekt i flödet:
- Rubrik
- Intro
- Body
- Publiceringsdatum
- CisionWireUrl
- IsRegulatory
- Images[0]
- DownloadUrl
- Beskrivning
Filter
Lägger till fler fält för varje objekt i flödet:
add_filter('cision_map_source_item', function($item, $data, $block_id) {
$item['Header'] = sanitize_text_field($data->Header);
$item['LogoUrl'] = esc_url_raw($data->LogoUrl);
$item['SocialMediaPitch'] = sanitize_text_field($data->SocialMediaPitch);
return $item;
}, 10, 3);
Ändra sortering av objekt i flödet:
add_filter('cision_block_sort', function($items, $block_id) {
usort($items, function($a, $b) {
return $a->PublishDate > $b->PublishDate;
});
return $items;
}, 10, 2);
Lägg till egna attribut till paginering:
add_filter('cision_block_pager_attributes', function(array $attributes, $block_id) {
return array_merge(
$attributes,
array(
'class' => 'custom-class',
'id' => 'custom-id',
)
);
}, 10, 2);
Sätt en egen klass för pagineringens aktiva objekt:
add_filter('cision_block_pager_active_class', function($class, $block_id) {
return 'custom-class';
}, 10, 2);
För att lägga till attribut för section behållaren i mallen:
add_filter('cision_block_wrapper_attributes', function(array $attributes, $block_id) {
return array(
'class' => array(
'custom-class',
),
);
}, 10, 2);
För att lägga till attribut för article behållaren i mallen:
add_filter('cision_block_media_attributes', function(array $attributes, $block_id) {
return array(
'class' => array(
'custom-class',
),
);
}, 10, 2);
Lägger till prefix som visas i början av behållaren.
add_filter('cision_block_prefix', function($prefix, $block_id) {
return '<h1>Prefix</h1>';
}, 10, 2);
Lägger till suffix som visas i slutet på behållaren.
add_filter('cision_block_suffix', function($suffix, $block_id) {
return '<h1>Suffix</h1>';
}, 10, 2);
Resurser
En komplett lista med fält kan hittas här: https://websolutions.ne.cision.com/documents/P2_Feed.pdf
Följande Käll-ID kan användas för testning: A275C0BF733048FFAE9126ACA64DD08F
Förbättringar
Om du har någon idé rörande förbättringar så tveka inte att skicka mig e-post via cyclonecode.help@gmail.com eller ett meddelande på slack.
Hjälp
Om du stöter på problem så tveka inte att skapa ett nytt inlägg under hjälp sektionen:
https://wordpress.org/support/plugin/cision-block
Du kan även prova kontakta mig på: slack.
Skärmdumpar
Installation
- Ladda upp cision block under /wp-content/plugins/ mappen.
- Aktivera tillägget under Tilläggs menyn i WordPress.
- Add your feed identifier and configure the plugin at /wp-admin/options-general.php?page=cision-block in WordPress.
- You can then add either a shortcode or setup a widget in order to display the feed.
Vanliga frågor
-
Kan jag hämta mer än dom senaste 100 nyheterna?
-
Du behöver använda Pro versionen för detta.
-
How do I get a unique feed identifier?
-
Det här är någon som Cision kan hjälpa dig med.
Du kan kontakta dom via e-post på support@cision.com. -
Är det möjligt att ha fler än ett Käll-ID?
-
Det är möjligt att använda olika käll-ID för olika block genom att använda
source_uid attributet i kortkoden som i följande exempel:[cision-block source_uid=A275C0BF733048FFAE9126ACA64DD08F]
-
Är det möjligt att skapa flera cision block?
-
Ja, det är möjligt att skapa flera olika block genom att använda kortkod argument för varje block.
-
Kan jag använda vanliga permalänkar för nyheter?
-
Detta är någonting som är möjligt i Pro versionen där samtliga nyheter importeras som anpassade inlägg i WordPress.
Recensioner
Bidragsgivare och utvecklare
”Cision Block” är programvara med öppen källkod. Följande personer har bidragit till detta tillägg.
Bidragande personer”Cision Block” har översatts till 1 språk. Tack till översättarna för deras bidrag.
Översätt ”Cision Block” till ditt språk.
Intresserad av programutveckling?
Läs programkoden, kika på SVN-filförvaret eller prenumerera på utvecklarloggen via RSS.
Ändringslogg
= 2.9.5
- Fix issue with empty feed when using The SEO Framework plugin.