$cgsimple->get_page_content nothing returned

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
smotsie
Forum Members
Forum Members
Posts: 12
Joined: Fri May 09, 2008 8:24 am
Location: UK

$cgsimple->get_page_content nothing returned

Post by smotsie »

Hi Guys,

I have a CMSMS 1.9.4.1 with CGSimpleSmarty 1.4.8 and I have a problem. $cgsimple->get_page_content doesn't return anything at all

I have some code which is working out the page alias I need and puts it in a $pagealias variable. My code to display the content of the page is as follows:

Code: Select all

Pagealias is {$pagealias}
<!-- content should start here -->
{$cgsimple->get_page_content($pagealias, 'content_en'}
<!-- content should end here -->
$pagealias shows the correct page alias but my two comments apear next to each other with no page content at all. I have also tried it using a hard coded pagealias instead of a calculated one and still nothing is returned.
I also get an error if I clear down the site cache or edit the page where the code is used, but only the first time I refresh. Error is:

Code: Select all

string(169) "Smarty error: [in globalcontent:get_page line 2]: syntax error: unrecognized tag: $cgsimple->get_page_content('p1', 'content_en' (Smarty_Compiler.class.php, line 446)" string(121) "Smarty error: [in globalcontent:get_page line 2]: syntax error: unrecognized tag '' (Smarty_Compiler.class.php, line 590)" 
but the CGSimpleSmarty module definitely IS installed. Any suggestions would be gratefully received

Cheers
Smotsie
uniqu3

Re: $cgsimple->get_page_content nothing returned

Post by uniqu3 »

How does your GCB look like as error says

Code: Select all

Smarty error: [in globalcontent:get_page line 2]: syntax error: unrecognized tag '' 
Error in global content block name get_page line 2

And there is already {$page_alias} variable available you don't need to reeinvent the wheel ;)
smotsie
Forum Members
Forum Members
Posts: 12
Joined: Fri May 09, 2008 8:24 am
Location: UK

Re: $cgsimple->get_page_content nothing returned

Post by smotsie »

uniqu3 wrote:How does your GCB look like as error says

Code: Select all

Smarty error: [in globalcontent:get_page line 2]: syntax error: unrecognized tag '' 
Error in global content block name get_page line 2

And there is already {$page_alias} variable available you don't need to reeinvent the wheel ;)
Thanks but I don't understand your first question. While testing I put the smarty code in a page, in a template and in a global content block. They all error the same, but the last attempt (global content block) is the one which I was trying when I cut and pasted the error.

Your second comment... I am calculating a different page alias for a page other than the one I am on, so I used the variable name $pagealias. This is not the same as the global $page_alias which refers to the page I am on. I need to include the default content block from a different page, not from the page I am on (for which I could just use {content} anyway.

Cheers
Smotsie
uniqu3

Re: $cgsimple->get_page_content nothing returned

Post by uniqu3 »

I see missing closing )
{$cgsimple->get_page_content($pagealias, 'content_en')}
Post Reply

Return to “Modules/Add-Ons”