0

For example with the rainlab translate plugin we can have this {{ 'translatable text'|_ }} I want to call them in the code section for dynamic title.

title = "Product" <-- I want to translate this
url = "/product"
layout = "default"
==
<section id="product-section">

</section>

Another example would be the blog plugin. I want the title to be set according the blog post title. I can use the {{ post.title }} in the markup section.

title = "Blog Title" <-- I want to put the blog title here
url = "/blog-post/:slug"
layout = "default"
==
<section id="blog-section">
    <h1><span>{{ post.title }}</span></h1>
</section>
William Wino
  • 3,599
  • 7
  • 38
  • 61

1 Answers1

0

Put this code into code section (when you edit page in CMS).

function onEnd() {
    $this->page->title = $this['post']->title;   
}

According to this you can also write something like that:

$this->page->title = 'My page title';

I'm sorry for writing this solution now, but maybe it helps someone.

kanapka94
  • 51
  • 4