Loading Ajax data in Page List

Permalink
Hi ,

We are trying to load the data using Ajax in Page list. We are able to get the data using Ajax request, but it is not retrieving current language data.
Loader::model('page_list');
          $pl = new PageList();
          $pages = $pl->get('');


Using the above code, we are getting the default language pages. We are using concrete5 8.4 version.

Any help or suggestions would be great.

Thank you.

 
Parasek replied on at Permalink Reply
Parasek
What do you want to achieve exactly?
Are you loading ajax data in "Page List" block or loading PageList() class in ajax query?
And what is "current language data" and how it is related to PageList() class?

By the way, code above is suited for version 5.6.
In 5.8 you don't need to call Loader, just use class if it is not already loaded).
And method get() was replaced with getResults().

https://documentation.concrete5.org/developers/working-with-pages/se...
kiranuppunda94 replied on at Permalink Reply
Hi,
Thank you for your response.
$list = new \Concrete\Core\Page\PageList();
$list->filterByPageTypeHandle('blog_entry');
$pages = $list->getResults();

We are not getting the multi language result, using above code. This is working only for default language(EN).

Can you please provide any suggestions on this.
Thank you.
Parasek replied on at Permalink Reply
Parasek
Is it the whole code? In that case only thing I can think of now, is that, non-EN pages don't have proper page type set (blog_entry).
PageList doesn't care about mutilingual though (they are different, unrelated things).
kiranuppunda94 replied on at Permalink Reply
Hi,
Thank you for your response.
We have created the pages using page type 'apartment' under english sitemap tree and drag and dropped the pages in the french sitemap tree.
We are trying to get the pages of french language using Ajax in page list.
we have used following code
$list = new \Concrete\Core\Page\PageList();
$list->filterByPageTypeHandle('apartment');
$pages = $list->getResults();


It is giving only the pages from the english sitemap tree. Can you please help in getting the pages from french lanaguage?
Parasek replied on at Permalink Reply
Parasek
Still not sure about your exact situation, but here are few ideas:
1) filter PageList by parent id (in php code)
2) In your "Page List" block, select "Beneath another page" under "Location"
3) If block "Page List" is added in global area, make sure of point 2) or have different global areas for every langauge