Page 1 of 1

How to request if a page is cachable?

Posted: Thu Dec 06, 2007 1:04 pm
by quadracer
Hi forum,

I want to have some actions from an UDT depending on pages cache status. The UDT should only have an output if checkbox "Cachable" is marked.

Have tried something like this

Code: Select all

global $gCms;

$thispage = $gCms->variables['pageinfo']
$pageinfo = PageInfoOperations::LoadPageInfoByContentAlias($thispage);

if (isset($pageinfo) && $pageinfo->cachable == true)
but it does not work  ::).

Btw. I'm only a copy&paste coder :) ...

Re: How to request if a page is cachable?

Posted: Thu Dec 06, 2007 2:24 pm
by Ted
Try this instead.  The pageinfo variable is already filled with the right object so you don't need to do it again.

Code: Select all

global $gCms;

$thispage =& $gCms->variables['pageinfo'];

if (isset($pageinfo) && $pageinfo->cachable)
Hope that helps!