Forums / Setup & design / Folder listing with AJAX problem !

Folder listing with AJAX problem !

Author Message

Marvix Marx

Thursday 12 July 2007 6:22:38 am

Hi ...

I have folder design where i list the articles with paging (google paging), works fine, but am trying to insert ajax in the design, that when visitor click a page number a loading image will be showing up until the new content load up, this work fine also,

BUT ... with big problem ,,, its load the whole site again in the article listing div, so ... I need to query just the result of the paging list of this folder ... any idea how to do that ?

Thx in adavnced.

André R.

Thursday 12 July 2007 8:20:44 am

Say hallo to layout:
/layout/set/my_ajax_layout/orig_url

example:
http://ez.no/layout/set/my_ajax_layout/community/forum/setup_design/folder_listing_with_ajax_problem

To make it work you have to add a layout entry in layout.ini.

Alternative is of course to create a module that does the things you want in php, it will be faster but will take a lot more time to develop.

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Marvix Marx

Thursday 12 July 2007 9:42:13 am

Thanks for the tip ...

But please would you explain it more ?

am not expert in ezpublish yet ^^

André R.

Thursday 12 July 2007 9:52:14 am

What specifically do you want me to explain more?

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Marvix Marx

Thursday 12 July 2007 12:03:27 pm

how to use the layout to get the result just !

André R.

Friday 13 July 2007 1:39:52 am

Since you really don't need a pagelayout, set settings/siteaccess/your_siteaccess/layout.ini.append.php to something like this:

[ajax]
PageLayout=
#Specify this is you want something different then text/html
#ContentType=text/xml

your content will be rendered directly!

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Marvix Marx

Saturday 14 July 2007 5:20:38 am

OK .. I understand what you mean ,,, but its not the solution for the problem ..

I have folder where I list the articles with google paging style, each page have 30 article, now when user click on page number 3 for example he will wait to load the whole template to see page #3 ...

With AJAX ... will reload just the DIV content of the listing, also this work fine, but big error, that the new content will be reload it with whole pagelayout.tpl ..

how stop this ?

Marvix Marx

Thursday 19 July 2007 9:54:16 am

Would you please check this site ?
check the paging, its changing just the pages div ... via ajax, am done all this with ezp, but its loading again the whole site in the pages div with ezp !

how can I do same with ezp ?

SITE: http://cssvault.com/2007/06/

André R.

Friday 20 July 2007 12:37:36 am

Go back and re read my suggestions.

In ez publish you have the pagelayout, and you have the content layout (node/view/full.tpl, full/folder.tpl and so on).
Since from what I understand, you only need the (x)html output from the content layout, so my quick and dirty suggestion was to disable the pagelayout in you ajax request.
Basicly your ajax request url will look like this:
/layout/set/ajax/path_to_folder/folder/(offset)/50

and the settings needed for layout: ajax is posted above.

Alternatively you can use a specific ajax pagelayout, with settings like this:

[ajax]
PageLayout=ajax_pagelayout.tpl

And ajax_pagelayout.tpl like this:

{$module_result.content}

But having a pagelayout like this is pointless, thats why I suggested not using pagelayout.

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom