Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loading wrong views when running other modules in HMVC #23

Open
steve-goodwin opened this issue Mar 19, 2014 · 0 comments
Open

Loading wrong views when running other modules in HMVC #23

steve-goodwin opened this issue Mar 19, 2014 · 0 comments

Comments

@steve-goodwin
Copy link

When loading partials from other modules twiggy is using the path to my theme folder from the partial I'm trying to load from a category module and not my blog module. This results in the category create.html.twig template being loaded when calling my blog create.html.twig template.

$this->data['categories']   =   Modules::run('category/category_manage/dropdown');
$this->twiggy->set($this->data);
$this->twiggy->display();

I'm expecting the result to return the view from my category module to my blog module and allow this to be included to keep things DRY in my controllers and views.

The dropdown function in my categories controller is:

$this->data['categories']   =   $this->category_model->dropdown('id', 'name');
$this->twiggy->set($this->data);
$this->twiggy->template('dropdown')->display();

Please note I have also tried:

$this->data['categories']   =   $this->category_model->dropdown('id', 'name');
$this->twiggy->set($this->data);
return $this->twiggy->template('dropdown')->render();

and:

$this->data['categories']   =   $this->category_model->dropdown('id', 'name');
$this->twiggy->set($this->data);
$this->twiggy->template('dropdown')->render();

with no success

Debugging shows this message whilst calling 'blog/create':

Unable to find template "blog/create.html.twig" (looked into: application/../modules/category/themes/admin, application/themes/admin).

Which suggests the wrong theme location is being targetted when it should be looking in the current module 'blog' in 'themes/admin/blog/create.html.twig'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant