Announcement

Collapse
No announcement yet.

CMS PHP eval page: change title via code

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • anzs
    started a topic CMS PHP eval page: change title via code

    CMS PHP eval page: change title via code

    Hello,

    Is it possible to change the page title for CMS PHP evaluation page in the evaluation code somehow? For example:

    Code:
    if (...)
    {
      $output = "...";
      [?page title?] = '...'
    }
    else
    {
      $output = "...";
      [?page title?] = '...'
    }
    What should I use instead of [?page title?] in order to set both title and html_title dynamically?

    I was not able to find a solution for this simple issue during more than 5 hours. OOP implementation in PHP is complete mess and working with it is a pure hell. Please help me!

    Why do I need that: I would like the CMS article page title and content change depending on GET request parameters.

    I started by setting $this->html_title and $this->title in the evaluation code; for sure this did not provide any results.
    As a workaround, I tried to override getTitle and getHtmlTitle methods in vBCms_Item_Content_PhpEval class. I found that vBCms_Controller_Content class gets CMS article title (page title) from gvBCms_Item_Content_PhpEval instance, and gets HTML title from its parent class (different instance!) - vBCms_Item_Content class. Such way, vBCms_Controller_Content creates two instances of the same CMS article class - parent and derived class instances, populates them both and takes some properties from one, and other properties from another. I don't have an idea about such OOP patterns.
    Please help.

Related Topics

Collapse

Working...
X