[ckan-dev] Changing site title on extension

Pedro G Silva pedro.gracio at deimos.com.pt
Fri Mar 4 13:53:32 UTC 2016


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'
>
>
> --
>
>
> [image: DEIMOS Engenharia, SA] <http://www.deimos.pt>
> *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
>
>


-- 


[image: DEIMOS Engenharia, SA] <http://www.deimos.pt>
*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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20160304/05cb35a5/attachment-0003.html>


More information about the ckan-dev mailing list