简体   繁体   English

CKAN-每个组织的自定义样式

[英]CKAN - Customize Style in each Organization

I am using CKAN as an OpenData portal and I have an instance correctly running with its own Datasets, Groups and Organizations. 我将CKAN用作OpenData门户,并且我有一个实例,该实例以其自己的数据集,组和组织正确运行。

I was following the Theming Guide having got finally my own global site style configured. 我遵循了主题指南 ,最终配置了自己的全局网站样式。 Despite of that my Organizations are very different between themselves and I would like to go further. 尽管如此,我的组织之间存在很大差异,我想走得更远。 How could I customize each Organization with their own style? 我该如何用自己的风格自定义每个组织?

I am not sure if the only way is to write an extension (o rewrite Organization template) to add a "custom.css" file in the creation of an organization and load it each time is accessed. 我不确定唯一的方法是编写扩展 (重写组织模板)以在创建组织时添加“ custom.css”文件并在每次访问时加载该文件。 Is there any other way? 还有其他办法吗?

It sounds like you've changed the main CSS by setting config option ckan.main_css . 听起来您已经通过设置config选项ckan.main_css更改了主CSS。

However you can't do much more visual customization without creating an extension, so I'd encourage you to do that. 但是,如果不创建扩展,就无法进行更多视觉定制,因此,我鼓励您这样做。 It's the first step in the Theming guide . 这是“ 主题指南”中的第一步。

See also the CSS section of the Theming guide . 另请参阅主题指南CSS部分

How you theme it depending on organization depends on the page you're targeting. 根据组织的主题设置主题的方式取决于您定位的页面。 But no doubt you could add some Jinja logic to load a different CSS file, or insert classes to CSS select on, depending on the organization. 但是毫无疑问,您可以根据组织的不同,添加一些Jinja逻辑来加载不同的CSS文件,或将类插入CSS select。

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

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