Help getting the page title from a UDT in 1.11 [SOLVED]
Posted: Tue Jan 15, 2013 7:28 am
Hi, I have had a UDT in my site that gets page title (so I can display content based on the current page).
Since I upgraded to 1.11.4, this does not work, and I understand that &$gCms has been deprecated?
Unfortunately I am not an experienced coder at all, and I cannot seem to find information anywhere on how to get the page title into a variable post 1.11.
Can someone help?
Code: Select all
global $gCms;
$smarty = &$gCms->GetSmarty();
$smarty_data = "{title}";
$smarty->_compile_source('temporary template', $smarty_data, $_compiled );
@ob_start();
$smarty->_eval('?>' . $_compiled);
$_contents = @ob_get_contents();
@ob_end_clean();
Unfortunately I am not an experienced coder at all, and I cannot seem to find information anywhere on how to get the page title into a variable post 1.11.
Can someone help?