{"id":13742306,"url":"https://github.com/ckan/ckanext-pages","last_synced_at":"2025-04-26T20:31:35.851Z","repository":{"id":10019700,"uuid":"12058961","full_name":"ckan/ckanext-pages","owner":"ckan","description":"A simple builtin CMS for CKAN sites","archived":false,"fork":false,"pushed_at":"2023-09-26T14:41:59.000Z","size":1863,"stargazers_count":51,"open_issues_count":37,"forks_count":99,"subscribers_count":11,"default_branch":"master","last_synced_at":"2024-05-22T13:33:33.555Z","etag":null,"topics":["ckan","ckanext","cms"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ckan.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-08-12T15:16:17.000Z","updated_at":"2024-07-12T10:31:34.082Z","dependencies_parsed_at":"2024-01-13T01:37:59.142Z","dependency_job_id":"140b9658-3516-4a69-901d-fc8b232c6068","html_url":"https://github.com/ckan/ckanext-pages","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ckan%2Fckanext-pages","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ckan%2Fckanext-pages/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ckan%2Fckanext-pages/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ckan%2Fckanext-pages/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ckan","download_url":"https://codeload.github.com/ckan/ckanext-pages/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251051425,"owners_count":21528787,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ckan","ckanext","cms"],"created_at":"2024-08-03T05:00:28.196Z","updated_at":"2025-04-26T20:31:30.829Z","avatar_url":"https://github.com/ckan.png","language":"Python","funding_links":[],"categories":["Extensions","List of extensions"],"sub_categories":[],"readme":"\n[![Tests](https://github.com/ckan/ckanext-pages/workflows/Tests/badge.svg?branch=master)](https://github.com/ckan/ckanext-pages/actions)\n\nckanext-pages\n=============\n\nThis extension gives you an easy way to add simple pages to CKAN.\n\nBy default you can add pages to the main CKAN menu.\n\nTested on CKAN 2.9 and 2.10.\n\nNote: For CKAN 2.7 and 2.8 use v0.3.7 or older versions.\n\n## Installation\n\nUse `pip` to install this plugin. This example installs it in `/home/www-data/pyenv`, assuming you have [setup a virtualenv](http://docs.ckan.org/en/latest/maintaining/installing/install-from-source.html#install-ckan-into-a-python-virtual-environment) there:\n\n```\nsource /home/www-data/pyenv/bin/activate\npip install -e 'git+https://github.com/ckan/ckanext-pages.git#egg=ckanext-pages'\n```\n\nMake sure to add `pages` to `ckan.plugins` in your config file:\n\n```\nckan.plugins = pages\n```\n\n## Database initialization\n\nYou need to initialize database from command line with the following commands:\n\nON CKAN \u003e= 2.9:\n```\n(pyenv) $ ckan --config=/etc/ckan/default/ckan.ini db upgrade -p pages\n```\n\n\n## Configuration\n\n\nExtra config options allow you to control the creation of extra pages against groups and organizations.\n\nTo swich on this behaviour, to your config add:\n\n```\nckanext.pages.organization = True\nckanext.pages.group = True\n```\n\nThese options are False by default.\n\n\nThis module also gives you a quick way to remove default elements from the CKAN menu and you may need todo this\nin order for you to have space for the new items you add.  These options are:\n\n```\nckanext.pages.about_menu = False\nckanext.pages.group_menu = False\nckanext.pages.organization_menu = False\n```\n\nBy default these are all set to True, like on a default install.\n\nTo enable HTML output for the pages (along with Markdown), add the following to your config:\n\n```\nckanext.pages.allow_html = True\n```\n\nBy default this option is set to False. Note that this feature is only available for CKAN \u003e= 2.3. For older versions of CKAN, this option has no effect.\nUse this option with care and only allow this if you trust the input of your users.\n\nIf you want to use the WYSIWYG editor instead of Markdown:\n```\nckanext.pages.editor = medium\n```\nor\n```\nckanext.pages.editor = ckeditor\n```\nThis enables either the [medium](https://jakiestfu.github.io/Medium.js/docs/) or [ckeditor](http://ckeditor.com/)\n\n```\nckanext.pages.revisions_limit = 3\n```\n\nBy default the value is set to `3` revisions to be stored. While adding this option with a higher number, the amount of stored revisions will be increased.\n\n```\nckanext.pages.revisions_force_limit = true\n```\n\nBy default is set to `False`. Needed when the `ckanext.pages.revisions_limit` number is decresed from the original (e.g. from 5 to 2) and we want to make sure that all Pages after update will have only specified number of Revisions instead of the old setting number. Without it, if Page had previously 5 Revisions, the page will continue to have 5 Revisions as it removes only the last one, so the new number limit will effect only new Pages, while setting this option to `true`, will force old Pages after update to have the spcific amount of last Revisions.\n\n## Extending ckanext-pages schema\n\nThis extension defines an `IPagesSchema` interface that allows other extensions to update the pages schema and add custom fields.\n\nTo do so, you can implement the method `update_pages_schema` in your extension:\n\n```\nimport ckan.plugins as plugins\nimport ckan.plugins.toolkit as toolkit\nfrom ckanext.pages.interfaces import IPagesSchema\n\nclass MyextPlugin(plugins.SingletonPlugin):\n    plugins.implements(IPagesSchema)\n\n    #IPagesSchema\n    def update_pages_schema(self, schema):\n        schema.update({\n            'new_field': [\n                toolkit.get_validator('not_empty'),\n                toolkit.get_validator('boolean_validator')]\n            })\n        return schema\n```\n\nand also extends `ckanext_pages/base_form.html` and override the `extra_pages_form` block to add it to the form:\n\n```\n{% ckan_extends %}\n\n{% set options = [{'value': True, 'text': _('Yes')}, {'value': False, 'text': _('No')}]%}\n{% block extra_pages_form %}\n    {{ form.select('new_field', id = 'new_field', label = 'New Field', options=options, selected=data.testing) }}\n{% endblock extra_pages_form %}\n```\n\nIf you want to override, make sure your extension is added before `pages` in the `ckan.plugins` config.\n\n## Extending the default CKEditor configuration\n\nThe default configuration used by the CKEditor widget is defined in the [`ckanext/pages/assets/js/ckedit.js`](https://github.com/ckan/ckanext-pages/blob/master/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:\n\n    ```js\n    this.ckan = this.ckan || {};\n    this.ckan.pages = this.ckan.pages || {};\n\n    $(document).ready(function() {\n\n      window.ckan.pages.override_config = {\n          toolbarGroups: [\n            //... your custom toolbar\n          ],\n          extraPlugins: '', // Add extra plugins here (make sure to also load their js/css assets from your plugin)\n          // ...\n\n      }\n\n    });\n    ```\n\nConfigure your [plugin assets](https://docs.ckan.org/en/2.9/theming/webassets.html) to serve the script above, and extend the `ckanext_pages/base_form.html` template to add the asset to the ckanext-pages form page:\n\n    ```\n    {% ckan_extends %}\n\n    {% asset 'my-plugin/pages-extra-config.js' %}\n\n    ```\n\n## Dependencies\n\n* lxml (optional, only used for injecting resource views into pages)\n\n\n## License\n\nReleased under the GNU Affero General Public License (AGPL) v3.0. See the file `LICENSE` for details.\n\n\n## History\n\nSee the file [CHANGELOG.md](CHANGELOG.md).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fckan%2Fckanext-pages","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fckan%2Fckanext-pages","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fckan%2Fckanext-pages/lists"}