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

Blog comments form dissapears when overwriting the template #1321

Closed
wouterverstuyf opened this issue Nov 4, 2015 · 4 comments
Closed

Blog comments form dissapears when overwriting the template #1321

wouterverstuyf opened this issue Nov 4, 2015 · 4 comments

Comments

@wouterverstuyf
Copy link
Contributor

BLOG MODULE:
When overwriting the default template in Detail.php like this:
$this->loadTemplate(null, true);
... the comment form dissapears.

Any idea how to fix this?
I thought the bug get triggered when using multiple forms on a page (ex: search widget) but can't get it fixed.

Thx!

@WouterSioen
Copy link
Member

where do you put this code?

@wouterverstuyf
Copy link
Contributor Author

/src/Frontend/Modules/Blog/Actions/Detail.php

public function execute()
{
    parent::execute();
    $this->loadTemplate(null, true);
    $this->getData();
    $this->loadForm();
    $this->validateForm();
    $this->parse();
}

The template gets loaded without the default template, but the comment form is not visible. When I use the normal template like below the comment form is correct:

public function execute()
{
    parent::execute();
    $this->loadTemplate();
    $this->getData();
    $this->loadForm();
    $this->validateForm();
    $this->parse();
}

But the problem is that I need a different layout structure for the detail page of a blog item, so overwriting the template would be handy :)

Thx!

@WouterSioen
Copy link
Member

You could add "Blog Detail" as a new extra in the modules_extras table, so you'd be able to couple it to a seperate page with a different layout

@wouterverstuyf
Copy link
Contributor Author

Owkey, thx for your reply.
Indeed, by creating a new template it should work. But I thought the comment form would also be parsed when you overwrite the default template.
Anyway, there is a way to do it, that's the most important :)

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

2 participants