Thank you for this useful module however I cannot get it working properly yet.

I have a block with some php-code executing and returning block content. When I load a page with this block as anonimous user the block is just empty. However, if I check page source I see that block content is actually there:

<div id="block-block-11" class="clear-block block block-block">
<div class="content"><div id="block-block-11-ajax-content" class="ajaxblocks-wrapper"><noscript> <block content here></noscript></div></div>

But it is not showing on the page and firebug (Chrome and FF) shows only:

<div id="block-block-11" class="clear-block block block-block">
<div class="content"></div>
</div>

How to make this block to actually show its ajax-loaded content on the final cached page?
Can it be a problem because I use XHTML 1.0 Strict doctype?

CommentFileSizeAuthor
#10 drupal.gif25.63 KBalladdin

Comments

alladdin’s picture

Title: Cannp » Block content is not showing on final page but it is in page source
maximpodorov’s picture

Does Firebug show http request to /ajaxblocks?some_values address?

alladdin’s picture

Yes, I can see it: http://www.thaiholiday.ru/ajaxblocks?_=1308025877309&blocks=block-11&pat...

Response:

{"block-11":{"content":" \x3c!--8bd96ea1--\x3e\x3c!--8bd96ea1--\x3e","ajaxblocks_settings":""}}

Response Headers:

HTTP/1.1 200 OK
Date: Tue, 14 Jun 2011 04:31:18 GMT
Server: Apache/2.0.63 (Unix) mod_ssl/2.0.63 OpenSSL/0.9.8e-fips-rhel5 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 PHP/5.2.9
X-Powered-By: PHP/5.2.9
Expires: Sun, 19 Nov 1978 05:00:00 GMT
Last-Modified: Tue, 14 Jun 2011 04:31:18 GMT
Cache-Control: private, no-cache, no-store, must-revalidate, max-age=0
Pragma: no-cache
Content-Length: 95
Keep-Alive: timeout=15, max=99
Connection: Keep-Alive
Content-Type: text/javascript; charset=utf-8

Request headers:

GET /ajaxblocks?_=1308025877309&blocks=block-11&path=aboutthailand HTTP/1.1
Host: www.thaiholiday.ru
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0.1) Gecko/20100101 Firefox/4.0.1
Accept: application/json, text/javascript, */*
Accept-Language: ru-ru,ru;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate
Accept-Charset: windows-1251,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive
X-Requested-With: XMLHttpRequest
Referer: http://www.thaiholiday.ru/aboutthailand
Cookie: SESSa7edfe1289d87137134ad5f5a9083899=f1063740cffa28285cd48ed458e0516e; __utma=207954775.2025309440.1307970796.1307970796.1308025697.2; __utmz=207954775.1307970796.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); has_js=1; hotlog=1; __utmb=207954775.3.10.1308025697; __utmc=207954775

JSON:

block-11
	Object { content=" <!--8bd96ea1--><!--8bd96ea1-->"}
	
content
	" <!--8bd96ea1--><!--8bd96ea1-->"
	
ajaxblocks_settings
	""

In page source:

<div id="block-block-11" class="clear-block block block-block">
 <div class="content"><div id="block-block-11-ajax-content" class="ajaxblocks-wrapper"><noscript> <!--8bd96ea1--><div class="cbbca5">
    <div><a href="http://www.discoverenglish.ru/">Английский язык от 200 рулей в час</a></div>
<div class="text">Общий, бизнес-курс, разговорный английский. С носителями языка.</div>
<div class="host">discoverenglish.ru</div>
<br />

</div>
<!--8bd96ea1--></noscript></div></div>

</div>
maximpodorov’s picture

Could you try ajaxblocks 6.x-1.x-dev version? It fixes the bug that can be the reason of your problem.

alladdin’s picture

No, unfortunatelly it didt help.

Can this problem be in block's php code?

Block:

 <?php
global $trustlink;
echo $trustlink->build_links(1);
?>

And this code to work properly needs some code in settings.php:

 <?php
define('TRUSTLINK_USER', 
'yt'); 
//require_once($_SERVER['DOCUMENT_ROOT'].'/'.TRUSTLINK_USER.'/trustlink.php'); 
require_once('/path/trustlink.php'); 
$o['charset'] = 'utf-8';
$o['force_show_code'] = true;
global $trustlink;
$trustlink = new TrustlinkClient($o); 
unset($o);
?>
maximpodorov’s picture

If TrustlinkClient constructor inspects the current page URL, it will receive wrong address (/ajaxblocks). Could you try to copy this code (TrustlinkClient initialization) to the block PHP code?

alladdin’s picture

Status: Active » Closed (works as designed)

Unfortunatelly I cannot because I have 3 different blocks with code:

 <?php
global $trustlink;
echo $trustlink->build_links(1);
?>

Which results in 3 different links on same page. When I do like you suggest, I get 3 same links.

Your module works. The problem is my php-code. I will try to find solution.

Thank you for your kind help.

alladdin’s picture

Maxim,

I couldnt find any contact email so will ask here.
Is it possible that you make paid modification for this module and/or to my code to make it working together?

maximpodorov’s picture

You can send me email through contact form on my account page. Please give all details of your problem.

alladdin’s picture

StatusFileSize
new25.63 KB

Still cannot find it. In attachment is screenshot of your profile page.
Please send me a word to kashlakov@yandex.ru

maximpodorov’s picture

Sorry, contact form was turned off. I fixed this.