V
V
Vasya-prijevalskij2022-04-04 12:03:47
PHP
Vasya-prijevalskij, 2022-04-04 12:03:47

October CMS. How to change the title of the record output page using the RecordDetails component?

Hello. I've already seen a similar question here, but still couldn't find an answer. Those. I found it, but I can’t use it, because perfect teapot in the backend Entry

page available

title = ""
url = "object/:slug"
layout = "default"
is_hidden = 0
robot_index = "index"
robot_follow = "follow"

[builderDetails]
modelClass = "AdminAdmin\Flats\Models\Flats"
identifierValue = "{{ :slug }}"
modelKeyColumn = "slug"
displayColumn = "slug"
notFoundMessage = "Публикация не найдена"
==
<?php
function onEnd() {
    $this['record'] = $record = $this->builderDetails->record;
    $this->page->title = $record->title;
}
?>
==
{% set displayColumn = builderDetails.displayColumn %}
{% set notFoundMessage = builderDetails.notFoundMessage %}


<!-- Header -->
{% partial 'header' %}


{% if record %}
<!-- Object -->
<section class="section">
<div class="container">
    <h1 class="section-title object-title">{{ record.title }}</h1>
    <p class="object-address">{{ record.address }}</p>
Ну и дальше там идет верстка, которая не имеет отношения к вопросу


This onEnd() function, as I googled, should display the title of the record (record.title) in the title of the record (title = ""). But, nothing works. Tell me, please, how to the most real teapot, how to pull up the title when creating a post and throw it in the page title? Thank you)

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question