Giter Club home page Giter Club logo

wpckan's Introduction

wp-ckan

A wordpress plugin for integrating CKAN http://ckan.org/ and WP http://wordpress.org/.

Description

wpckan is a wordpress plugin that exposes a series of functionalities to bring content stored in CKAN to Wordpress' UI and also provide mechanisms for archiving content generated on Wordpress into a CKAN instance.

Features

Feature 1: Add related CKAN datasets to posts.

Plugin presents a metabox while users are editing posts with an autocompletion input field that allows the user to add related CKAN datasets. Suggestions for related datasets and its metadata (title, description, and resources) are shown to the user while typing in the input field. Users can add a certain number of datasets that will get stored along the post's metadata.

In order to use this information, this plugin exposes the [wpckan_related_datasets] shortcode for embedding information about related datasets on the content of the post. The shortcode has following parameters:

  • group: (Optional) Specify the id (Not title or name) of a group available on the target CKAN instance in order to filter the related datasets to ONLY those assigned to it.

  • organization: (Optional) Specify the id (Not title or name) of an organization available on the target CKAN instance in order to filter the related datasets to ONLY those assigned to it.

Note: If both group and organization parameters are specified then the dataset has to be asssigned to both in order to be returned by the shortcode.

  • include_fields_dataset: (Optional) Comma-separated string. Per default, this shortcode shows only title and notes of the CKAN dataset (See http://demo.ckan.org/api/3/action/package_search?q=spending). A list of attributes can be specified to present more information. Possible values: "title", "notes", "url", "license_id", "license_url" "metadata_created", "metadata_modified", "author" , "author_email"

  • include_fields_resources: (Optional) Comma-separated string. Per default, this shortcode shows only name, description and format of the resources (See http://demo.ckan.org/api/3/action/package_search?q=spending). A list of attributes can be specified to present more information. Possible values: "name", "description", "revision_timestamp", "format", "created"

  • include_fields_extra: (Optional) Comma-separated string. This shortcode outputs extra metadatafields. A list of attributes can specified to present more Information.

  • limit: (Optional) Number. Default is 10. Limits the amount of datasets shown by the shortcode string.

  • filter: (Optional) Number. Filters the datasets according to following criteria:

    • '0' (ALL): Return all datasets (Default)
    • '1' (ONLY WITH RESOURCES): Return only datasets featuring at least one resource.
  • filter_fields: (Optional) JSON. Filters the datasets according to the content of the datasets' extra fields. The list of fields and values is specified as JSON string. The name of the fields must match exactly (case unsensitive) but for the value the php strpos() function will be employed. The OR operator will be applied if more than 1 key/value combination are given. See examples below.

  • sort: (Optional) String. As per the solr documentation, this is a comma-separated string of field names and sort-orderings.

  • template: (Optional) String. Render the information using different templates:

    • dataset-list
    • dataset-grid

Pagination

  • page: (Optional) Number. When used together with limit, returned datasets will get paginated. In case of possible pagination, this parameter specifies which page is returned. If there are not enough related datasets to paginate, this parameter will be ignored. Example: if there are 8 related datasets, limit = 2, page = 2, then datasets 2 and 3 will be returned. Mind that order begins on 1.

  • prev_page_link: (Optional) String. If provided, and as long limit and page are also given parameters, shows a link to this URL. The default text is "Previous"

  • prev_page_title: (Optional) String. Replaces "Previous" (Standard text) with the specified text.

  • next_page_link: (Optional) String. If provided, and as long limit and page are also given parameters, shows a link to this URL. The default text is "Next"

  • next_page_title: (Optional) String. Replaces "Next" (Standard text) with the specified text.

Advanced

  • blank_on_empty: (Optional) Boolean. Returns an empty string "" if no datasets have been found to return

Examples:

[wpckan_related_datasets]
[wpckan_related_datasets limit="3"]
[wpckan_related_datasets organization="d9722d77-3b91-4c26-9172-950a9a4be07a"]
[wpckan_related_datasets limit="3" page="2"]
[wpckan_related_datasets limit="3" page="2" prev_page_link="http://test?prev_page" next_page_link="http://test?next_page"]
[wpckan_related_datasets include_fields_dataset="title,description,author"]
[wpckan_related_datasets include_fields_dataset="title,description,author" include_fields_resources="name,description,created"]
[wpckan_related_datasets limit="3" filter_fields='{"spatial-text":"England","date":"2015"}']
[wpckan_related_datasets blank_on_empty="true"]
[wpckan_related_datasets type="library_record"]
[wpckan_related_datasets sort="metadata_modified+desc"]

An example showing how the information returned by this shortcode will be structured:

<div class="wpckan_dataset_list">
  <ul>
    <li>
      <div class="wpckan_dataset">
        <div class="wpckan_dataset_title"><a href="http://link_to_dataset">Title</a></div>
        <div class="wpckan_dataset_notes">Notes</div>
        <div class="wpckan_dataset_license">License</div>
        <div class="wpckan_dataset_author">Author</div>
        /*.... other fields ....*/
        <div class="wpckan_resources_list">
          <ul>
            <li>
              <div class="wpckan_resource">
                <div class="wpckan_resource_name"><a href="http://link_to_resource">Name</a></div>
                <div class="wpckan_resource_description">Description</div>
                /*.... other fields ....*/
              </div>
            </li>
            /*.... other resources ....*/
          </ul>
        </div>
      </div>
    </li>
    /*.... other dataset <li> ....*/
  </ul>
</div>
<div class="wpckan_dataset_list_pagination">
  <a href="#">Previous</a>
  <a href="#">Next</a>
</div>

Also, the plugin exposes the [wpckan_number_of_related_datasets] shortcode for returning the number of related datasets assigned to the post as a customizable link so a summary can be presented on the wordpress side. The shortcode has the same argument as the shortcode above, and also following additional parameters:

  • link_url: (Optional) Specify the URL to link the produced output with some other resource (i.e: in the CKAN instance)

  • prefix: (Optional) Prepends a string before the number.

  • suffix: (Optional) Appends a string after the number.

Examples:

[wpckan_number_of_related_datasets]
[wpckan_number_of_related_datasets link_url="http://link_to_more"]
[wpckan_number_of_related_datasets group="news"]
[wpckan_number_of_related_datasets group="news" limit="1"]
[wpckan_number_of_related_datasets group="news" suffix=" datasets found in the news."]
[wpckan_number_of_related_datasets group="news" prefix="Number of datasets: (" suffix=")" link_url="http://link_to_more"]
[wpckan_number_of_related_datasets organization="d9722d77-3b91-4c26-9172-950a9a4be07a"]
[wpckan_number_of_related_datasets limit="3" filter_fields='{"spatial-text":"England","date":"2015"}']
[wpckan_number_of_related_datasets limit="3" type="dataset"]
[wpckan_number_of_related_datasets blank_on_empty="true"]
[wpckan_number_of_related_datasets type="library_record"]

An example (corresponding to the last example above) showing how the information returned by this shortcode will be structured:

<div class="wpckan_dataset_number">
  <p><a target="_blank" href="http://link_to_more">Number of datasets: (5)</a></p>
</div>

Feature 2: Query lists of CKAN datasets

Plugin exposes a function which returns a list of CKAN datasets resulting after querying CKAN's API. Resulting datasets can be filtered by organization, group and/or specifying a textual search.

The results of this function can be shown anywhere on a Wordpress instance (Posts, Pages, etc..) by calling the [wpckan_query_datasets query="QUERY"] shortcode. Per default, this shortcode shows only title and description of the dataset. The shortcode has following parameters:

  • query: (Mandatory) Term to query the database.

  • organization: (Optional) Filter dataset results by showing only those belonging to a certain organization.

  • group: (Optional) Filter dataset results by showing only those belonging to a certain group.

  • type: (Optional) Filter dataset results by showing only those belonging to a certain dataset-type.

  • include_fields_dataset: (Optional) Comma-separated. Per default, this shortcode shows only title (with link to the dataset's URL) and notes of the CKAN dataset (See http://demo.ckan.org/api/3/action/package_search?q=spending). A list of attributes can be specified to present more information. Possible values: "title", "notes", "url", "license", "license_url" "metadata_created", "metadata_modified", "author" , "author_email"

  • include_fields_resources: (Optional) Comma-separated. Per default, this shortcode shows only name (with link to the resources's URL), description and format of the resources (See http://demo.ckan.org/api/3/action/package_search?q=spending). A list of attributes can be specified to present more information. Possible values: "name", "description", "revision_timestamp", "format", "created"

  • limit: (Optional) Number. Default is 10. Limits the amount of datasets shown by the shortcode.

  • filter: (Optional) Number. Filters the datasets according to following criteria:

    • '0' (ALL): Return all datasets (Default)
    • '1' (ONLY WITH RESOURCES): Return only datasets featuring at least one resource.
  • filter_fields: (Optional) JSON. Filters the datasets according to the content of the datasets' extra fields. The list of fields and values is specified as JSON string. The name of the fields must match exactly (case unsensitive) but for the value the php strpos() function will be employed. The OR operator will be applied if more than 1 key/value combination are given. See examples below.

  • sort: (Optional) String. As per the solr documentation, this is a comma-separated string of field names and sort-orderings.

  • template: (Optional) String. Render the information using different templates:

    • dataset-list
    • dataset-grid

Pagination

  • page: (Optional) Number. When used together with limit, returned datasets will get paginated. In case of possible pagination, this parameter specifies which page is returned. If there are not enough related datasets to paginate, this parameter will be ignored. Example: if there are 8 related datasets, limit = 2, page = 2, then datasets 2 and 3 will be returned. Mind that order begins on 1.

  • prev_page_link: (Optional) String. If provided, and as long limit and page are also given parameters, shows a link to this URL. The default text is "Previous"

  • prev_page_title: (Optional) String. Replaces "Previous" (Standard text) with the specified text.

  • next_page_link: (Optional) String. If provided, and as long limit and page are also given parameters, shows a link to this URL. The default text is "Next"

  • next_page_title: (Optional) String. Replaces "Next" (Standard text) with the specified text.

Advanced

  • blank_on_empty: (Optional) Boolean. Returns an empty string "" if no datasets have been found to return

Examples:

[wpckan_query_datasets query="coal"]
[wpckan_query_datasets query="corruption" limit="5"]
[wpckan_query_datasets query="corruption" limit="5" page="1"]
[wpckan_query_datasets organization="d9722d77-3b91-4c26-9172-950a9a4be07a"]
[wpckan_query_datasets query="politics" limit="3" page="2" prev_page_link="http://test?prev_page" next_page_link="http://test?next_page"]
[wpckan_query_datasets query="forestry" organization="odmcambodia" group="news"]
[wpckan_query_datasets query="elections" include_fields_dataset="title,notes,license" include_fields_resources="name,description,created"]
[wpckan_query_datasets limit="3" filter_fields='{"spatial-text":"England","date":"2015"}']
[wpckan_query_datasets query="coal" blank_on_empty="true"]
[wpckan_query_datasets query="*:*" type="library_record"]
[wpckan_query_datasets sort="metadata_modified+desc"]
<div class="wpckan_dataset_list">
  <ul>
    <li>
      <div class="wpckan_dataset">
        <div class="wpckan_dataset_title"><a href="http://link_to_dataset">Title</a></div>
        <div class="wpckan_dataset_notes">Notes</div>
        <div class="wpckan_dataset_license">License</div>
        <div class="wpckan_dataset_author">Author</div>
        /*.... other fields ....*/
        <div class="wpckan_resources_list">
          <ul>
            <li>
              <div class="wpckan_resource">
                <div class="wpckan_resource_name"><a href="http://link_to_resource">Name</a></div>
                <div class="wpckan_resource_description">Description</div>
                /*.... other fields ....*/
              </div>
            </li>
          </ul>
          /*.... other resources ....*/
        </div>
      </div>
    </li>
  /*.... other dataset <li> ....*/
  </ul>
</div>
<div class="wpckan_dataset_list_pagination">
<a href="#">Previous</a>
<a href="#">Next</a>
</div>

Also, the plugin exposes the [wpckan_number_of_query_datasets] shortcode for returning the number of queried datasets so a summary can be presented on the wordpress side. The shortcode has the same argument as the shortcode above, and also following additional parameters:

  • link_url: (Optional) Specify the URL to link the produced output with some other resource (i.e: in the CKAN instance)

  • prefix: (Optional) Prepends a string before the number.

  • suffix: (Optional) Appends a string after the number.

Examples:

[wpckan_number_of_query_datasets]
[wpckan_number_of_query_datasets link_url="http://link_to_more"]
[wpckan_number_of_query_datasets group="news"]
[wpckan_number_of_query_datasets group="news" limit="1"]
[wpckan_number_of_query_datasets group="news" suffix=" datasets found in the news."]
[wpckan_number_of_query_datasets group="news" prefix="Number of datasets: (" suffix=")" link_url="http://link_to_more"]
[wpckan_number_of_query_datasets organization="d9722d77-3b91-4c26-9172-950a9a4be07a"]
[wpckan_number_of_query_datasets limit="3" filter_fields='{"spatial-text":"England","date":"2015"}']
[wpckan_number_of_query_datasets limit="3" type='dataset']
[wpckan_number_of_query_datasets blank_on_empty="true"]
[wpckan_number_of_query_datasets type="library_record"]

An example (corresponding to the last example above) showing how the information returned by this shortcode will be structured:

<div class="wpckan_dataset_number">
  <p><a target="_blank" href="http://link_to_more">Number of datasets: (5)</a></p>
</div>

Feature 3: Archiving WP Posts in CKAN

The plugin presents a metabox while users are editing posts. It allows users to specify if the post should be archived as a CKAN dataset. The plugin polls the CKAN instance and retrieves the list of available organizations and groups in order for users to be able to determine to which organization or group the dataset will be assign to. Also, when that particular post will be archived.

This feature archives the custom fields along with the title and description. If a valid URL is found in the value of the custom fields, a new resource will be added to the dataset.

WARNING However, custom fields beginning with _ or wpckan_ will not be stored.

Feature 4: Show dataset detail

The plugin exposes a shortcode which can be used to output the metadata and resources of a CKAN dataset, specified by id parameter

  • id: String. Unique identifier of the dataset

Examples:

[wpckan_dataset_detail id="ckan-dataset-one"]
<div class="wpckan_dataset_detail">
	<h1 class="wpckan_dataset_title">title</h1>
	<a href="#" class="wpckan_dataset_owner_org">Organization</a>
	<p class="wpckan_dataset_notes">description</p>
  <ul class="wpckan_dataset_tags">
    <li class="wpckan_dataset_tag"><a href="#">Tag1</a></li>
   	<li class="wpckan_dataset_tag"><a href="#">Tag2</a></li>
  </ul>
	<h2>Resources</h2>
	<ul class="wpckan_dataset_resources">
    <li class="wpckan_dataset_resource">
			<img src="#"></img><a href="#">Resource1</a>
		</li>
		<li class="wpckan_dataset_resource">
			<img src="#"></img><a href="#">Resource2</a>
		</li>
  </ul>
	<h2>Additional info</h2>
	<table class="wpckan_dataset_metadata_fields">
    <tr class="wpckan_dataset_metadata_field">
			<td>field name</td>
			<td>field value</td>
		</tr>
  </table>
</div>
<div class="wpckan_dataset_list_pagination">
<a href="#">Previous</a>
<a href="#">Next</a>
</div>

widgets

This plugin ships with a series of widgets that basically expose the functionality of the different shortcodes for easy integration on a Wordpress site layout:

  • WPCKAN Related Datasets: Shows the information of the related datasets of the post or page the widget is integrated in. See /inc/widgets/related-datasets-widget.php
  • WPCKAN Query Datasets: Shows the results of the specified query. See /inc/widgets/query-resources-widget.php
  • WPCKAN Query resources by post's category: Shows the results of a query made with the specified field as filter and the post's or page's categories as values for the query. See /inc/widgets/query-resources-by-category-widget.php

CORS Support disabled for CKAN >2.3

Taken from http://docs.ckan.org/en/latest/changelog.html#id1:

Cross-Origin Resource Sharing (CORS) support is no longer enabled by default. Previously, Access-Control-Allow-* response headers were added for all requests, with Access-Control-Allow-Origin set to the wildcard value *. To re-enable CORS, use the new ckan.cors configuration settings (ckan.cors.origin_allow_all and ckan.cors.origin_whitelist).

So, mind that the CKAN instance which this plugin is used with needs to allow all origins or whitelist the domain where the wpckan is installed.

Support for ckanext-fluent and qTranslate/qTranslateX

For the multilingual functionalities, this plugin relies on two other components:

If you are using both in your Wordpress/CKAN stack, WPCKAN will automatically present localized information on its different templates, if available. Otherwise, it falls back to English.

Installation

  1. Either download the files as zip or clone git clone https://github.com/OpenDevelopmentMekong/wpckan.git into the Wordpress plugins folder.
  2. Install dependencies with composer (http://getcomposer.org) composer install
  3. Activate the plugin through the 'Plugins' menu in WordPress

Development

  1. Install composer http://getcomposer.org/
  2. Edit composer.json for adding/modifying dependencies versions
  3. Install dependencies composer install

Requirements

  • PHP 5 >= 5.2.0
  • PHP Curl extension (in ubuntu sudo apt-get install php5-curl)

Uses

Testing

Tests are found on /tests and can be run with phpunit tests

Continuous deployment

Everytime code is pushed to the repository, travis will run the tests available on /tests. In case the code has been pushed to master branch and tests pass, the _ci/deploy.sh script will be called for deploying code in CKAN's DEV instance. Analog to this, and when code from master branch has been tagged as release, travis will deploy to CKAN's PROD instance automatically.

For the automatic deployment, the scripts on _ci/ are responsible of downloading the odm-automation repository, decrypting the odm_tech_rsa.enc private key file ( encrypted using Travis-ci encryption mechanism) and triggering deployment in either DEV or PROD environment.

Copyright and License

This material is copyright (c) 2014-2015 East-West Management Institute, Inc. (EWMI).

It is open and licensed under the GNU General Public License (GPL) v3.0 whose full text may be found at:

http://www.fsf.org/licensing/licenses/gpl-3.0.html

wpckan's People

Contributors

dragonvirus avatar ericsoroos avatar huyeng avatar s-mardii avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wpckan's Issues

Shorcode for returning dataset count

As part of #4 a new shortcode (name proposal "[wpckan_number_of_related_datasets]") could be implemented in order to return just the number of a post's or page's related datasets. It could be tweaked by a couple of parameters such as:

  • group: Filter the datasets by group
  • organization: filter the datasets by organization
  • prefix: Prepend prefix to the beginning of the output (e.g "Datasets found: ")
  • suffix: Append a text to the en d of the output (e.g " datasets found in the X group")

Check ckan config to condition user input

CKAN's API exposes the status_show methoid which retrieves a dictionary with the site's configuration.

This values can be retrieved ( as CkanApiOutput? in ckan_php/service.json ) in order to condition what the user can do, this applies to following situations in particular:

  • When a user creates/edits a post and the ckan site does not allow to add unowned datasets and there is no organization available yet, the user should not be allowed to archive this post. :
  • Users should only be able to archive posts to the organizations and/or groups that they have the permissions to edit.

See http://docs.ckan.org/en/latest/maintaining/configuration.html?highlight=config#ckan-auth-create-unowned-dataset

Do not store call to shortcode while archiving

If users use the plugin to archive a post which include calls to shortcodes on its description and then use the [wpckan_related_datasets] or [wpckan_query_datasets] shortcodes to retrieve them, this situation leads to problems because the shortcode will be executed again.

Possible approaches:

  • Parse text and remove calls to shortcodes
  • Execute calls to shortcodes in order to store their output instead of the call (Prefered)

Define Plugin metadata

Create plugin structure:

  • Define name
  • Define plugin files
  • Write README file
  • Define header (Name, Description, Author, License: GPL2?)

Feature 1: Add related CKAN datasets to posts.

Plugin presents metabox while editing Posts with an autocompletion input field that allows the user to add related CKAN datasets. Those datasets are rendered/layout through a live preview of the contents and metadata included in the dataset (title, description, and resources)
Dataset visualization for CSV, EXCEL,tabular files. Image snapshot or html embed.
Add an option on the settings for the user to choose if the previews of the related datasets are shown automatically or not. Alternatively, users can use shortcodes.

  • Dynamic ckan query for datasets for autocompletion
  • Storing selected value
  • Presenting related datasets in final post through shortcodes.
  • Implement #19

Feature 3: Archiving WP Posts in CKAN

Plugin will expose a function that archives WP-generated content into CKAN. This function can be configured to be triggered when a post is published/modified or periodically (hourly, daily, weekly). Study the possibility of using cron jobs or other scheduling mechanisms.
Using Hooks to modify archived datasets on insert, delete, update. Use WP uuid to identify datasets uniquely.

  • Implement function for single-post archiving
  • Implement metabox to be shown on every post. Would allow the user to set the organization and/group where the post is going to be archived. Remove that information from Settings.
  • Check for datasets with same id and update them if they already exist.
  • Add "delete" option to metabox so the corresponding entry for the post on CKAN can be deleted.

CKAN API key optional for related datasets feature

Is the API key for write access only? If it is, it could be optional so that a read-only access could be performed by the plugin. This way a project using the plugin could connect to a 3rd party ckan database.

Support for pages

Currently, both metaboxes (for related datasets and archiving) are only being presented in Posts. Their functionality should be also available for pages

Widget for [wpckan_query_datasets]

Create a Widget which can be added to a Wordpress template (mostly on the Sidebar) and shows the
results returned from the [wpckan_query_datasets] shortcode.
widget

Paging is not working

I tried to apply paging on the shortcode and it doesn't change the page.
This is what I'm trying:

[wpckan_query_datasets limit="10" query="a" page="2"]

Add onlyWithDataset parameter

wpckan_related_datasets, wpckan_number_of_related_datasets and wpckan_query_datasets should get an extra parameter that tells the plugin just to return those datasets with 1 or more resources in it.

Proper link the datasets listed on the metabox

As Part of Feature 1, user can assign related datasets on each Post and Page. Once added if the users click on the name of the dataset, the dataset's site should be loaded in a new window.

bildschirmfoto 2015-01-13 um 18 09 16

Improve ping connection on Plugin settings

In order to inform user about connection details and disable/hide fields that can only be shown when URL and API Key have been properly entered.

Currently, only connection health to CKAN instance is being checked by using the SiteRead operation of the API which does not check if the API Key is valid.

Before archiving post, check if corresponding dataset exist

Datasets in CKAN will get the slug value of the corresponding WP Post.
In case a certain dataset containing an archived post already exists, it has to be updated using package_update. In the other case, it can be created wih package_create.

wpckan_query_datasets shortcode not showing results

Steps to reproduce:

  1. Install and activate plugin
  2. Add a dataset with title=test on the CKAN database
  3. Add the following shortcode to a post [wpckan_query_datasets query="test"]

Expected result:

  • information of the test dataset is presented

Obtained result:

  • No result is returned.

Feature 2: Query lists of CKAN datasets

Plugin will expose a function that returns a list of wordpress datasets resulting of a query to CKAN's API. Datasets can be queried after Organization, Group and/or specifying a textual search.
Use shortcodes or template tags to trigger this function. Also, an idea would be to create a Widget "Last published datasets".

  • Define shortcodes
  • Write CKAN's API query calls
  • Parsing JSON results
  • Filter query when specifying organization and/or group parameter
  • Add classes to divs for CSS
  • Implement limit parameter
  • Implement "include_fields" parameter, to specify which information should be shown from those datasets (comma-separated) e.g "title,notes,license_url"

Remove "Post is published option"

In order to avoid incoherences between the posts on WP and the archived datasets on CKAN, only the option to archive posts on save and never archive should be offered to the user.
bildschirmfoto 2015-02-24 um 11 33 36

Support for custom fields while archiving

Currently wpckan only stores title and description (content) of the wordpress posts into CKAN. A mechanism should be provided to specify addtional fields to be archived.

Add "batch archiving" button

Probably not a good idea and surely not necessary for a first release.

Encapsulate method that loops all the posts of the wordpress instance and archives them at once.
Consider non-blocking methods for running this, otherwise it is going to be critical for performance.

PHP fatal error

Parse error: syntax error, unexpected '[', expecting ',' or ';' in wpckan/templates/related_datasets_metabox.php on line 7

Implement [wpckan_query_datasets]

Implement full funcitonality for [wpckan_query_datasets] shortcode:

  • Filter query when specifying organization and/or group parameter
  • Add classes to divs for CSS

Link related dataset

Add a link on the title of the presented information for the datasets and its resources in order for the user to be able to get more . (Feature 1)

[wpckan_query_datasets] shortcode's result always on top

To reproduce:

  1. Create a new post or page
  2. Write some dummy text
  3. Add [wpckan_query_datasets query="some_query"] shortcode with some query that should match some dataset(s).
  4. Publish and view post/page

Expected: Query's output should appear after the dummy text
Obtained: Query's output appears before the dummy text

Javascript breaks when adding related datasets with unescaped title

Following javascript error is thrown by the browser when a dataset is created with related dataset assigned:

SyntaxError: JSON.parse: unterminated string at line 1 column 80 of the JSON data

Steps to reproduce:

  • Add new Post
  • Input title and description
  • Add some related datasets
  • Click publish

When page is reloaded again, error appears.

Amount of pages

Is there a way to find the number of pages so I can choose when to display the "next page" link?

Relate a site to a specific organization or group

The way the plugin works today we are not able to relate a site to a specific CKAN organization or group. That means every query made on the sites will return the same results. The relationship between them are the same unless each site had a different instance of CKAN.

I'm thinking this might be a lot of work to develop, so I think we can see this as a next step for the plugin.

Archive all the old contents of ODC into CKAN systematically

wp_ckan will archive the new posts only into CKAN if the setting is selected. How the plugin will be implemented related to the old contents of ODC that will be migrated? It would be great, if the wp_ckan plugin can archive those contents automatically into CKAN.

Support all post types

The plugin's metaboxes should be presented for every type of content. In the particular case of http://opendevelopmentmekong.net/, following post types are not being supported:

  • New Article
  • Announcements
  • Site updates

Suggestion, add checkboxes in Settings for Users to select which post types (including pages) the plugin should support.

Hook to customize meta box post types

We need a filter hook to enable the child theme to change the post types that the metaboxes will show up.

Basically just change this:

$post_types = array( 'post', 'page' );

To this:

$post_types = apply_filters('wpckan_post_types', array( 'post', 'page' ));

So I can perform this on the child theme:

function opendev_wpckan_post_types() {
  return array('post','briefing','layer');
}
add_filter('wpckan_post_types', 'opendev_wpckan_post_types');

Define License

A license has to be chosen and specified in source code and README files

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.