throwPage on $sMenu4

s2h

No avatar

2009-11-17 11:14

Hey there,

I was wondering if there's a way to show particular page's content instead of a menu. I want to display some simple non-linked information below the $sMenu3.
I've created a custom info.tpl and added variable name in the container.tpl. Admin back-end shows me this position for menu items, but I can't figure out how to attach a particular page content to be displayed instead of a menu. I've tried throwPage but I can't fully understand how it works, so it didn't help.

» Quick.Cms v2.x

s2h

No avatar

2009-11-17 13:35

So far I managed to print out $aData[sDescriptionShort] from my custom info.tpl to the div I wanted, but somehow $aData[sDescriptionFull] doesn't work. Anyone could appoint a hint what I'm doing wrong?

info.tpl:

<!-- BEGIN LIST -->$aData[sDescriptionShort]
<!-- 
END LIST -->
<!-- 
BEGIN HEAD --><!-- END HEAD -->
<!-- 
BEGIN FOOT --><!-- END FOOT -->
<!-- 
BEGIN HEAD_SUB --><!-- END HEAD_SUB -->
<!-- 
BEGIN FOOT_SUB --><!-- END FOOT_SUB -->
<!-- 
BEGIN SELECTED -->class="selected"<!-- END SELECTED -->

Makaron

Avatar: Makaron

2009-11-17 17:46

I am not sure I understand You well but if You want to display full description of specific page You can edit file templates/themes/default.php and add code like this:

$aDataPage20 $oPage->throwPage20 );


Value 20 is ID of page You have to change it. After that in file templates/container.tpl You can add variable: $aDataPage20[sDescriptionFull] which contains full description of page which You choosen.

www.mak-web.pl

s2h

No avatar

2009-11-18 01:44

That worked like a charm, many thanks!

But there's another problem. I've previously installed CKEditor and it's doing fine for regular pages, but as for this case with $aDataPage20 = $oPage->throwPage( 20 ); it shows on my div:

|n|     
|
nFull description of page (id=20)
|
n|



It seems that CKEditor is being missinterpretated (puts a |n| on each line) in the mentioned throwPage() method, since normal content is rendered correctly. I've double-checked this by uninstalling this CKEditor - then both ordinary content pages and this "$aDataPage20 = $oPage->throwPage( 20 )" case shows correctly. Any ideas where's the problem?

beholder

Avatar: beholder

2009-11-21 21:53

I think no, you're interpreting it wrong, s2h.

|n| is the line-break that QC uses internally.
It's just that this line doesn't take it into account when storing the content into $aDataPage20:
$aDataPage20 = $oPage->throwPage( 20 );

it should be something like:
$aDataPage20 = str_replace( '|n|', "\n", $oPage->throwPage( 20 ) );

Or if you want to instruct the browser to display the line breaks, just insert <br /> instead of line breaks.

Back to top
about us | contact