Page 1 of 1

Date function in heading

Posted: Mon Aug 20, 2018 8:10 pm
by Tata
Is it possible to have actualized date in a page heading?
There is a hidden page showing daily changing information. E.g.:

Code: Select all

<h1>program_page</h1>
and

Code: Select all

$page_data[]=array(...,'heading' => 'Program for today',...)
showing then
Program for today

The page is then shown in a newsbox and a printlik is placed on the page, so the visitors can print this very page (with its own stylesheet for "print").
It would be nice to have the heading like this:
Program for today - dd.mm.yyyy
If I understand the thing correctly, the function shall be only used in $page_data[]=array(...,'heading' => 'Program for today',...) as the call in template

Code: Select all

newsbox('program_page')
keeps pointing to the same page.
Is it very difficult to manage it?

Re: Date function in heading

Posted: Mon Aug 20, 2018 9:30 pm
by cmb
Not sure if I understand it correctly, but maybe you're looking for something like this:

Code: Select all

<?php echo '<h1>Program for today - ', date('d.m.Y'), '</h1>', newsbox('program_page')?>