Answer the question
In order to leave comments, you need to log in
October CMS Plugin Builder. How to replace the title of the record output page when using the RecordDetails component?
There is a record page (product)
title = "Product"
url = "/product/:slug"
layout = "default"
is_hidden = 0
[builderDetails]
modelClass = "AKk\Produkty\Models\Products"
identifierValue = "{{ :slug }}"
modelKeyColumn = "slug"
displayColumn = "slug"
notFoundMessage = "Запись не найдена!"
==
<?php
function onEnd()
{
$this->page->title = '***********';
}
?>
==
{% set record = builderDetails.record %}
{% set displayColumn = builderDetails.displayColumn %}
{% set notFoundMessage = builderDetails.notFoundMessage %}
<section class="home">
<div class="container">
{% if record %}
<div class="col-lg-6 home-about-left">
<h1>{{ record.title }}</h1>
<p>
{{ record.text|raw }}
</p>
</div>
<div class="col-lg-6 home-about-right">
<img class="img-fluid" src="{{record.image|media}}" alt="{{ record.title }}">
</div>
{% else %}
{{ notFoundMessage }}
{% endif %}
</div>
</section>
Answer the question
In order to leave comments, you need to log in
Hello, our blog already has a small article that solves your problem:
https://biz-mark.ru/blog/web-razrabotka/zamena-tit...
Never name entities with a normal transliteration. Always carry out translated into English. Especially in your case you use both options AKk\Produkty\Models\Products
.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question