Answer the question
In order to leave comments, you need to log in
How to publish only on this :slug page?
I have a url like 'category/:slug', :slug is replaced by the name of the category, but the template for all categories is the same. Each category has a field for entering feedback, but after sending - this review is published in all categories, because. general template. How can this be fixed?
I work with CMS October, which is tied to PHP, Laravel.
This code outputs a comment:
public function onRun()
{
$this->currentCommentSlug = $this->page['currentCommentSlug'] = $this->param('slug'); - Этот код добавил самостоятельно.
if ($this->property('reviewstyle')) {
$this->addCss('assets/css/simplereviews-with-paginate.css');
}
if ($this->property('SortOrder') == 'new') {
$this->reviews = \IronLab\SimpleReviews\Models\SimpleReview::where('publish', true)->orderBy('created_at', 'desc')->paginate($this->property('items'));
} elseif ($this->property('SortOrder') == 'old') {
$this->reviews = \IronLab\SimpleReviews\Models\SimpleReview::where('publish', true)->orderBy('created_at', 'asc')->paginate($this->property('items'));
}
}
{% component 'SimpleReviewComponentPaginate' currentCommentSlug = __SELF__.currentCommentSlug %}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question