All Projects → ckan → ckanext-pages

ckan / ckanext-pages

Licence: GPL-3.0 license
A simple builtin CMS for CKAN sites

Programming Languages

python
139335 projects - #7 most used programming language
HTML
75241 projects
javascript
184084 projects - #8 most used programming language
CSS
56736 projects

Projects that are alternatives of or similar to ckanext-pages

ckanext-datarequests
A plugin that allows users to request data that is not published yet
Stars: ✭ 15 (-65.91%)
Mutual labels:  ckan, ckanext
ckanext-validation
CKAN extension for validating Data Packages using Table Schema.
Stars: ✭ 26 (-40.91%)
Mutual labels:  ckan, ckanext
Ckan
CKAN is an open-source DMS (data management system) for powering data hubs and data portals. CKAN makes it easy to publish, share and use data. It powers catalog.data.gov, open.canada.ca/data, data.humdata.org among many other sites.
Stars: ✭ 3,223 (+7225%)
Mutual labels:  ckan, ckanext
datos.gob.es
Código perteneciente al portal español de Datos Abiertos datos.gob.es.
Stars: ✭ 20 (-54.55%)
Mutual labels:  ckan, ckanext
ckanext-scheming
Easy, shareable custom CKAN schemas
Stars: ✭ 67 (+52.27%)
Mutual labels:  ckan, ckanext
easyckan
The easiest way to install CKAN platform.
Stars: ✭ 32 (-27.27%)
Mutual labels:  ckan
rhdx
R package to interact with the Humanitarian Data Exchange portal - http://dickoa.gitlab.io/rhdx/
Stars: ✭ 20 (-54.55%)
Mutual labels:  ckan
opendata
Finland national open data portal (avoindata.fi) source code.
Stars: ✭ 27 (-38.64%)
Mutual labels:  ckan
ckan-php-manager
A tool for managing a CKAN data catalog
Stars: ✭ 14 (-68.18%)
Mutual labels:  ckan
qsv
CSVs sliced, diced & analyzed.
Stars: ✭ 438 (+895.45%)
Mutual labels:  ckan
aircan
💨🥫 A Data Factory system for running data processing pipelines built on AirFlow and tailored to CKAN. Includes evolution of DataPusher and Xloader for loading data to DataStore.
Stars: ✭ 24 (-45.45%)
Mutual labels:  ckan
CFAN
The Cool Factorio Archive Network
Stars: ✭ 14 (-68.18%)
Mutual labels:  ckan
Portal.js
🌀 Next generation Javascript framework for rapidly building rich data portals.
Stars: ✭ 2,002 (+4450%)
Mutual labels:  ckan
ckan-helm
Helm chart for CKAN
Stars: ✭ 15 (-65.91%)
Mutual labels:  ckan
launch-pad
A Mod Manager for Kerbal Space Program on macOS
Stars: ✭ 19 (-56.82%)
Mutual labels:  ckan
docker-ckan
CKAN docker images, docker-compose and examples
Stars: ✭ 46 (+4.55%)
Mutual labels:  ckan
ckanext-ldap
A CKAN extension that provides LDAP authentication.
Stars: ✭ 31 (-29.55%)
Mutual labels:  ckan
api-catalog
API Catalog for Suomi.fi Data Exchange Layer
Stars: ✭ 15 (-65.91%)
Mutual labels:  ckan
odufrn-downloader
Pacote para baixar os dados do portal de dados abertos da UFRN
Stars: ✭ 31 (-29.55%)
Mutual labels:  ckan

Tests

ckanext-pages

This extension gives you an easy way to add simple pages to CKAN.

By default you can add pages to the main CKAN menu.

Tested on CKAN 2.7, 2.8, 2.9 and 2.10 (unreleased).

Installation

Use pip to install this plugin. This example installs it in /home/www-data/pyenv, assuming you have setup a virtualenv there:

source /home/www-data/pyenv/bin/activate
pip install -e 'git+https://github.com/ckan/ckanext-pages.git#egg=ckanext-pages'

Make sure to add pages to ckan.plugins in your config file:

ckan.plugins = pages

Database initialization

You need to initialize database from command line with the following commands:

ON CKAN >= 2.9:

(pyenv) $ ckan --config=/etc/ckan/default/ckan.ini pages initdb

ON CKAN <= 2.8:

(pyenv) $ paster --plugin=ckanext-pages pages initdb --config=/etc/ckan/default/production.ini

Configuration

Extra config options allow you to control the creation of extra pages against groups and organizations.

To swich on this behaviour, to your config add:

ckanext.pages.organization = True
ckanext.pages.group = True

These options are False by default.

This module also gives you a quick way to remove default elements from the CKAN menu and you may need todo this in order for you to have space for the new items you add. These options are:

ckanext.pages.about_menu = False
ckanext.pages.group_menu = False
ckanext.pages.organization_menu = False

By default these are all set to True, like on a default install.

To enable HTML output for the pages (along with Markdown), add the following to your config:

ckanext.pages.allow_html = True

By default this option is set to False. Note that this feature is only available for CKAN >= 2.3. For older versions of CKAN, this option has no effect. Use this option with care and only allow this if you trust the input of your users.

If you want to use the WYSIWYG editor instead of Markdown:

ckanext.pages.editor = medium

or

ckanext.pages.editor = ckeditor

This enables either the medium or ckeditor

Extending ckanext-pages schema

This extension defines an IPagesSchema interface that allows other extensions to update the pages schema and add custom fields.

To do so, you can implement the method update_pages_schema in your extension:

import ckan.plugins as plugins
import ckan.plugins.toolkit as toolkit
from ckanext.pages.interfaces import IPagesSchema

class MyextPlugin(plugins.SingletonPlugin):
    plugins.implements(IPagesSchema)

    #IPagesSchema
    def update_pages_schema(self, schema):
        schema.update({
            'new_field': [
                toolkit.get_validator('not_empty'),
                toolkit.get_validator('boolean_validator')]
            })
        return schema

and also extends ckanext_pages/base_form.html and override the extra_pages_form block to add it to the form:

{% ckan_extends %}

{% set options = [{'value': True, 'text': _('Yes')}, {'value': False, 'text': _('No')}]%}
{% block extra_pages_form %}
    {{ form.select('new_field', id = 'new_field', label = 'New Field', options=options, selected=data.testing) }}
{% endblock extra_pages_form %}

If you want to override, make sure your extension is added before pages in the ckan.plugins config.

Extending the default CKEditor configuration

The default configuration used by the CKEditor widget is defined in the ckanext/pages/assets/js/ckedit.js file. This configuration can be overriden from your own plugin setting the window.ckan.pages.override_config variable. For example, create the following script in your extension:

```js
this.ckan = this.ckan || {};
this.ckan.pages = this.ckan.pages || {};

$(document).ready(function() {

  window.ckan.pages.override_config = {
      toolbarGroups: [
        //... your custom toolbar
      ],
      extraPlugins: '', // Add extra plugins here (make sure to also load their js/css assets from your plugin)
      // ...

  }

});
```

Configure your plugin assets to serve the script above, and extend the ckanext_pages/base_form.html template to add the asset to the ckanext-pages form page:

```
{% ckan_extends %}

{% asset 'my-plugin/pages-extra-config.js' %}

```

Dependencies

  • lxml (optional, only used for injecting resource views into pages)

License

Released under the GNU Affero General Public License (AGPL) v3.0. See the file LICENSE for details.

History

See the file CHANGELOG.md.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].