How to request if a page is cachable?

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
User avatar
quadracer
Forum Members
Forum Members
Posts: 44
Joined: Wed Apr 26, 2006 9:59 am

How to request if a page is cachable?

Post 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 :) ...
Ted
Power Poster
Power Poster
Posts: 3329
Joined: Fri Jun 11, 2004 6:58 pm
Location: Fairless Hills, Pa USA

Re: How to request if a page is cachable?

Post 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!
Post Reply

Return to “Developers Discussion”