Error in display() function of Area regarding page properties ? Problem with pagelist which displays content

Permalink
Hello

I'm using the Page List Teasers Template (http://www.concrete5.org/marketplace/addons/page-list-teasers/) and also the Advanced page List (http://www.concrete5.org/marketplace/addons/advanced-page-list/) which allow displaying the page content of the pages listed.

What this addons basically do is to create an Area in Page list and then display the content of the page.

<?php  // show content?
if ($useContent == '1') { // display page content
    $a = new Area('Main');                        
    $a->disableControls();                              
    $a->display($page);
} 
else { // show page description
    echo $description;
}


In the pages to be listed I do display some page attributes. For example: I add a php block to show the page Title:

$cobj = Page::getCurrentPage();
echo $cobj->getCollectionName();


The Problem ist that that in the attributesof the page containing the page list are shown and not the one of the page being displayed. Everything else is displayed correctly, but the page attributes are not retrieved correctly - somehow it seems that Page::getCurrentPage() is returning the Page where the pagelist is, but not of the actual page being displayed.

Is this a bug of concrete5 or what is wrong then?

I reported this issue to the developers of the addons I mentioned, but they couldn't help me further up to now. See this for more information:http://www.concrete5.org/marketplace/addons/advanced-page-list/supp...

My Version of Concrete5 is: 5.5.2.1

Thanks for helping me here.

Best Regards,
Daniel

 
jordanlev replied on at Permalink Reply
jordanlev
That's because calling Page::getCurrentPage() retrieves the page that is currently being viewed (the one with the page list block on it in this case). Instead, try removing that $cobj = Page::getCurrentPage(); line, then change the following line to echo $page->getCollectionName();
.
ckjs2015 replied on at Permalink Reply
Hi jordanlev

Thanks for the hint - i tried it, but the behaviour is exactly the same, that means - it seems to be getting the instance of the main page showed...
ckjs2015 replied on at Permalink Reply
currently the Properties block output is only this:

echo "Titel:";
echo $page->getCollectionName();


It is called several times - you see this for example inhttp://copy.fridaysnight.ch/test/das-ticken-in-der-natur/...

then in the Pagelist it outputs the Page Name containing the Page-List:http://copy.fridaysnight.ch/test/...
ckjs2015 replied on at Permalink Reply
For me this issue seems to be a concrete5 bug. I used now the workaround by modifying the template of the page List to show the page attributes.