php - Changing header dynamically with set_partial in pyrocms -


i overload header partial @ front-end. have module customizes header doesn't work. tried using 1 in index of controller ->set_partial('header','header.html')

and have header.html in module-name/views/header.html, header in system/cms/themes/default/views/partials/header.html not override should , don't know causing it. i've seen in discussion: here

my controller in case if front-end (filename same name of module) $this->template->set_partial('header','header.html'); doesn't work. please me started pyrocms few days ago , newbie web developer.

any appreciated. thanks!

how did include header partial in layout file of theme? there 2 ways: through template or through theme plugin.

if want able overload header partial $this->template->set_partial(), need include header partial using {{ template:partial name="header" }}.

if use theme header , use injected header partial on specific pages, this:

{{ if {template:has_partial name="moduleheader"} }} {{ template:partial name="moduleheader" }} {{ else }} {{ theme:partial name="header" }} {{ endif }}}

and sure not use same name partials (by mean filename , name set in set_partial functions). won't work if call "header" in theme , in template.

and wrote of this, i've found post on pyrocms forums dealing this: post on overriding theme partials in module

hope helps!


Comments

Popular posts from this blog

java - Spring Data JPA: Why findOne(id) executing delete query internally? -

python - Mongodb How to add addtional information when aggregating? -

java - Incorrect order of records in M-M relationship in hibernate -