简体   繁体   English

如何在CKAN中添加新页面?

[英]How to add a new page in CKAN?

I'm using CKAN as my open data portal. 我正在使用CKAN作为我的开放数据门户。 It's written in Python using Pylons framework. 它是用Pylons框架用Python编写的。 It uses Postgres as the database. 它使用Postgres作为数据库。 I just want to add a new page similar to about page to display the terms and conditions to the users. 我只是想添加一个类似于关于页面的新页面来向用户显示条款和条件。 About page comes built in. 关于页面内置。

Given that it would be better if I can edit the page content from the admin area like the about page. 鉴于我可以从管理区域编辑页面内容(如关于页面)会更好。 If it's more work/development I could ignore it. 如果它是更多的工作/开发我可以忽略它。 I just want the simplest way to get this done. 我只想要最简单的方法来完成这项工作。 It would be really nice if you could explain the answer a bit. 如果你能解释一下这个答案真的很棒。 At least the steps. 至少步骤。

How can I add a new page in CKAN? 如何在CKAN中添加新页面?

If you want yourself or non-technical admins to be able to add simple static pages and blogs and edit their contents, I recommend installing the ckanext-pages extension . 如果您希望自己或非技术管理员能够添加简单的静态页面和博客并编辑其内容,我建议您安装ckanext-pages扩展名

It's also possible to write your own CKAN plugin that adds some static pages, though if you're going to go as far as web forms for editing them then you may as well use the pages extension above, but see for example ckanext-sa for an example of how to add some simple static pages from a plugin. 也可以编写自己的CKAN插件来添加一些静态页面,但是如果你要去编辑它们的web表单那么你也可以使用上面的页面扩展,但是参见例如ckanext-sa for一个如何从插件添加一些简单静态页面的示例。

To install the pages extension: 要安装页面扩展名:

# Activate your CKAN virtual environment
. /usr/lib/ckan/default/bin/activate

# Install the pages extension.
pip install -e 'git+https://github.com/ckan/ckanext-pages.git#egg=ckanext-pages'

Then add pages to the ckan.plugins setting in your CKAN config file, and restart your web server. 然后将pages添加到CKAN配置文件中的ckan.plugins设置,然后重新启动Web服务器。 When logged into CKAN as a sysadmin user, you should see the pages button in the top right. 以sysadmin用户身份登录CKAN时,您应该会看到右上角的页面按钮。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM