Hi there,
Like many folks, I'm having the white block problem when trying to implement ddblock on a site I'm currently developing (http://www.icucom.net:81.)
I'm using the Acquia Marian 3 beta theme that is built on the Fusion theming system, so I have created the template.php file (see attached) in the acquia_marian directory (rather than in the fusion_core directory,) and added the requisite ddblock themes to sites\all\themes\acquia_marina\custom\modules\ddblock. I've also modified template.php with the correct node type name and theme name.
I've followed the tutorial to create an advanced block, which I can see, but it has no content. If I switch the settings from using Cycleblock to Default, I see the list of three nodes I created along with their fields and images, which suggests that it's working at least to some degree.
The log shows an error as well:
Invalid argument supplied for foreach() in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\sites\all\themes\acquia_marina\custom\modules\ddblock\ddblock-cycle-block-content-upright10.tpl.php on line 47.
And the logging function of ddblock gives this output:
*
'slider_items'
*
stdClass::__set_state(array(
'nid' => '400',
'node_title' => 'Slider 1',
'node_data_field_pager_item_text_field_pager_item_text_value' => 'Slider 1',
'node_type' => 'ddblock_news_item',
'node_vid' => '406',
'node_data_field_pager_item_text_field_slide_text_value' => 'Slider 1',
'node_data_field_pager_item_text_field_image_fid' => '714',
'node_data_field_pager_item_text_field_image_list' => '1',
'node_data_field_pager_item_text_field_image_data' => 'a:3:{s:11:"description";s:0:"";s:3:"alt";s:0:"";s:5:"title";s:0:"";}',
'node_revisions_body' => 'Slider 1',
'node_revisions_format' => '2',
'node_created' => '1275600510',
))
So maybe that's a problem with something in Views?
I'm also using the latest versions of all of the required modules (except jQuery Update, which breaks my site and isn't needed on D6.16 anyway, so I removed the dependency requirement.)
Anyway, I'm hoping that you can help, and that it's some simple oversight on my part.
Thank you!
-=Delty
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | template.php_.txt | 5.83 KB | delty |
| #2 | template.php_.txt | 5.83 KB | delty |
Comments
Comment #1
ppblaauw commentedCan you attach your template.php file, so I can help you better.
Comment #2
delty commentedOh, I thought I did - here it is again.
Thanks!
-=Delty
Comment #3
ppblaauw commentedYour view_name is slider_items instead of news_items.
You need to change:
in
in the preprocess functions
Hope this helps you further, please let me know.
Comment #4
delty commentedAh, that was just left over from re-copying the php to a new template.php file just to make sure I had everything. I changed it to the correct view name and cleared the cache, but still have the same issue.
Thanks for taking a look,
-=Delty
Comment #5
delty commentedOK, I ended up starting over from scratch by deleting the content type, view, and deleting the block, then re-creating everything using the imported templates - no monkeying around with the names or anything this time around.
What I get now is... nothing! It's as if the template.php isn't even being loaded. I must be a supremely bad direction follower or something, so I'm going to try some more - I'm a glutton for punishment!
-=Delty
Comment #6
delty commentedAll right, I did a totally fresh install, following along with the instructions, and using the default importable view and node type. It still doesn't work. :(
If I set the display to default, I see the view with text and images, but with the cycleblock, nothing. I don't seem to be getting the "invalid argument" error in the log any more though.
Thoughts?
In IE8, I get this script error too.
Thanks!
-=Delty
Comment #7
delty commentedHoping you have the time to look at this soon please?
I just went through the troubleshooting and all looks good on my end from what I can tell.
Thanks,
-=Delty
Comment #8
delty commentedHi,
I got the grey block issue resolved, and this might help other folks as well. The JavaScript error above was the key!
I went in and took a look at line 197 in ddblock.js and found that there could be cases when the text being parsed wasn't JSON compliant. I changed the line as such:
From:
To:
This should ensure in the long term that any text being passed to the JSON method is compliant.
Thanks - really great mod with great support!
-=Delty
Comment #9
delty commentedComment #10
ppblaauw commentedThanks for posting your solution, I had a look at the code and have the following comments.
Probably you use a wysiwyg editor with ads a <p></p> or a <br /> tag to the custom jquery field.
JSON.stringify of this value will return the string "<p></p>" which will be added to the option object as
This will prevent that a javascript error is thrown.
A better solution to prevent that html tags added by a wysiwyg editor are not used as JSON code is to test the custom string like:
custom should not be null
custom should not be undefined
custom should at least start with a { character
the JSON.stringify can would still be useful to convert e.g. ' to " for users who use ' instead " to make valid JSON code.
Will add this custom value check to future version of the module.
Comment #11
delty commentedThanks for the updated solution. I had gone back and added this field to the CKEditor ignore list, and then modified the field text to remove the paragraph tags, but that didn't seem to work, so making your code more "user proof" in this way is a good thing that will likely cut down on future issues of this sort.
Thanks again, great mod!
-=Delty