[ckan-dev] Changing site title on extension

Ross Jones ross at servercode.co.uk
Fri Mar 4 14:08:27 UTC 2016


Hi,

Sorry I missed your first email, I might have saved you some time.

Does config_option_update at https://github.com/ckan/ckan/blob/master/ckan/logic/action/update.py#L1165 help? It's used by the admin controller when you edit config at http://mysite/ckan-admin 

It's CKAN >= 2.4 but nobody should be running less than 2.4 now (I know people do, but please don't).

Ross


> On 4 Mar 2016, at 13:53, Pedro G Silva <pedro.gracio at deimos.com.pt> wrote:
> 
> Hi All
> I noticed I should edit the config file from the param, instead of importing from pylos, so now, on the same method, I have:
> 
> config_._process_configs[1]['ckan.site_logo'] = '/base/images/deimos_logo.png'
> 
> Still, this does not work. Debugging a litle showed that on https://github.com/ckan/ckan/blob/887b8514ce23e54100f894391495047410e8d821/ckan/config/environment.py#L265 , the update config is called prior to the config file is read by ckan, so no matter what I do, I will never be able to update the logo except on the config file itself. Any thoughts on how should I do this? I prefer not to hack ckan internally for this to work. 
> 
> Thanks
> 
> On Thu, Mar 3, 2016 at 3:16 PM, Pedro G Silva <pedro.gracio at deimos.com.pt> wrote:
> Hi All
> I'm trying to make a theming extension and I want to automatically set the site title and logo, but I'm failing to do that. Can someone help me? Perhaps I'm using the wrong method?
> 
> This is what I'm trying:
> 
>     def update_config(self, config_):
>         toolkit.add_template_directory(config_, 'templates')
>         toolkit.add_public_directory(config_, 'public')
>         toolkit.add_resource('fanstatic', 'snimartheme')
> 
>         config['ckan.site_title'] = 'CHANGED'
> 
> 
> -- 
> 
> 
> 
> Pedro Gracio Silva 
> Aerospace Systems / Production Center
> 
> Av. D. Joao II, Lt 1.17.01, 10 • 1998-023 Lisboa, Portugal 
> Ph: +351 21 893 3020 • Fax: +351 21 896 9099
> 
> 
> 
> 
> -- 
> 
> 
> 
> Pedro Gracio Silva 
> Aerospace Systems / Production Center
> 
> Av. D. Joao II, Lt 1.17.01, 10 • 1998-023 Lisboa, Portugal 
> Ph: +351 21 893 3020 • Fax: +351 21 896 9099
> 
> _______________________________________________
> ckan-dev mailing list
> ckan-dev at lists.okfn.org
> https://lists.okfn.org/mailman/listinfo/ckan-dev
> Unsubscribe: https://lists.okfn.org/mailman/options/ckan-dev




More information about the ckan-dev mailing list