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

eZ debug

Timing: Jan 20 2025 05:57:39
Script start
Timing: Jan 20 2025 05:57:39
Module start 'content'
Timing: Jan 20 2025 05:57:39
Module end 'content'
Timing: Jan 20 2025 05:57:39
Script end

Main resources:

Total runtime0.1448 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0056 588.9766180.8281
Module start 'content' 0.00560.0056 769.8047106.0078
Module end 'content' 0.01120.1334 875.8125534.2031
Script end 0.1447  1,410.0156 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00332.2936200.0002
Check MTime0.00130.8771200.0001
Mysql Total
Database connection0.00080.578710.0008
Mysqli_queries0.098267.81341410.0007
Looping result0.00120.84611390.0000
Template Total0.133191.910.1331
Template load0.00080.524310.0008
Template processing0.132391.400610.1323
Override
Cache load0.00050.373710.0005
Sytem overhead
Fetch class attribute can translate value0.00060.437910.0006
XML
Image XML parsing0.00030.174710.0003
General
dbfile0.00825.6822200.0004
String conversion0.00000.003530.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs