It worked just fine thanks ! I had changed the base.tmpl trying to impose the banner. Now the site works well, but I'm still in struggle with the metadata, yet I think I have set the global context at the right place and tried numerous possibilities to set the pagekind to main_index and BANNER_URL. Did the banner opened when you build it ?
Le mercredi 13 mai 2020 10:59:50 UTC+2, Julien Vallet a écrit : > > Hi, > > > I have trouble with the replacement of an old theme. > > When building under a new theme (canterville), I get a > > > __M_writer(str(post.meta('banner'))) > AttributeError: 'Undefined' object has no attribute 'meta' > > ######################################## > render_galleries:output/galleries/index.html <stdout>: > > > Maybe its because I misused conf.py ? > > > GLOBAL_CONTEXT = { > "BANNER_URL": '/assets/img/oeil.jpg', > > } > > > Yet I've been careful with the Global_context location... > > > Or in my template ? > > > <div class="site-wrapper"> > % if 'main_index' in pagekind: > <header class="main-header" style="background-image: url(${BANNER_URL})"> > % else: > <header class="main-header" style="background-image: > url(${post.meta('banner')})"> > % else: > <header class="main-header post-head no-cover"> > % endif > > > Can you help me ? > -- You received this message because you are subscribed to the Google Groups "nikola-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to nikola-discuss+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/nikola-discuss/30d378ed-0a7d-4752-ba9c-b9f1cafefdb4%40googlegroups.com.