sobota 27. prosince 2008

ez publish flash not showing problem

With upgrade to Flash 10, all flash movies uploaded through the admin interface stopped working. After some research I found out this was due to different handling of files server with Content-Disposition header. This has been fixed in the new eZ Publish version (4.1 - yet to be released), with new setting section of file.ini - "PassThroughSettings".

This comes to two possible solutions
- use kernel/classes/binaryhandlers/ezfilepassthrough/ezfilepassthroughhandler.php and file.ini files from eZ Publish 4.1 alpha release
- or wait for the stable release of this new version :)

středa 24. prosince 2008

"You do not have permission to view this object" problem

It might happen with fresh eZ Publish installation that you see this message after inserting an image into your XML block.

Solution for this is simple - click "User accounts" -> "Roles and policies", then edit "Anonymous" role and under Content - Read policy add "Media" section.

eZ Publish SEO extension














eZ Publish does not allow editing of meta data (meta keywords and meta description) for individual objects, that's why I wrote this extension.
For installation, simply enable the extension in admin interface. Also, make sure files in your eZ Publish autoload folder is writable. After activation you should see a new section called "Meta Data" when editing an object.

Extension works with eZ Publish 4

Download: http://www.badongo.com/file/12625460

neděle 30. listopadu 2008

Star rating for eZ Publish


This extension is based on Star Rating extension from eZ Publish projects site. While the original extension works as a information collector, this one can store one value per object, enabling use for a review class for instance.

This extension is optimized for eZ Publish 4.

Download: http://www.badongo.com/file/12300501

pondělí 27. října 2008

Show eZ Publish ezselection datatype as radio inputs

This is a simple way to show ezselection datatype input interface using radio buttons.

Create a ezselection.tpl file under content/datatype/edit directory of your design folder (or rewrite the file in eZ Publish standard design) and put in the attached file,
then use this line of code to show the interface:

{attribute_edit_gui attribute=$attribute element='radio'}

Download: http://www.badongo.com/file/11856439

středa 22. října 2008

Using content/treemenu and mootools to retrieve eZ Publish node list

The following example illutrates use of content/treemenu function (normally used for admin interface content structure menu) to get a list of nodes, which can then be used to for instance filling select box.

The mooized code is as simple as this:
node_id = 2;
var jsonRequest = new Request.JSON({url: "http://site.com/content/treemenu/"+node_id, onComplete: function(result){
alert(result.children);
}}).get();

If you want to use it to fill select box options, following code will do the trick:

node_id = 2;
var jsonRequest = new Request.JSON({url: "http://site.com/content/treemenu/"+node_id, onComplete: function(result){

element = $('selectelement');
$each(result.children,function(item) {
element.options[element.options.length] = new Option(item.name,item.node_id);
});

}}).get();



To get this working correctly you need to allow contentstructure menu for your public site access and define classes you want to fetch (like this)
[TreeMenu]
Dynamic=enabled
ShowClasses[]=article
in contentstructuremenu.ini.append.php file.

čtvrtek 9. října 2008

mooTools noobSlide for eZ Publish

This article shows how to use noobSlide (http://www.efectorelativo.net/laboratory/noobSlide/index.html) script with eZ Publish.

For this example lets use Sample 4, slideshow data will be taken from folder, (68 in this case), every slide will be represented by Article object.

First, we'll need the template code to fetch the articles and create the html structure:

{let frontpages=fetch('content','list',hash('parent_node_id',68))}

<div class="sample">
<div class="mask1">
<div id="box8">
{foreach $frontpages as $child}
<div>
<h1>{$child.name}</h1>

{if $child.data_map.intro.content.is_empty|not}
<div class="attribute-short">
{attribute_view_gui attribute=$child.data_map.intro}
</div>
{/if}

{if $child.data_map.body.content.is_empty|not}
<div class="attribute-long">
{attribute_view_gui attribute=$child.data_map.body}
</div>
{/if}

{if $child.data_map.image.has_content}
<div class="attribute-image" >
{attribute_view_gui attribute=$child.data_map.image image_class=medium}

{if $child.data_map.caption.has_content}
<div class="caption">
{attribute_view_gui attribute=$child.data_map.caption}
</div>
{/if}
</div>
{/if}

</div>
{/foreach}
</div>
</div>

<div class="buttons" id="handles8_more" style="width:{count($frontpages)|mul(30)}px;">
{foreach $frontpages as $index => child}
<span><img src={"images/greencircle.png"|ezdesign} alt="{$index}" /></span>
{/foreach}
</div>

</div>

{/let}



We could easily use this code for the first part as well:

{foreach $frontpages as $child}
<div>
{node_view_gui content_node=$child view="full"}
</div>
{/foreach}


Then, there's some javascript scripting, we'll put this in the same template as the html code

<script type="text/javascript">
{literal}
window.addEvent('domready',function(){
var handles8_more = $$('#handles8_more span');
var hs8 = new noobSlide({
box: $('box8'),
startItem: 1,
autoPlay: true,
items: $$('#box8 h1'),
size: 435,
handles: $$('handles8 span'),
onWalk: function(currentItem,currentHandle){
$$(this.handles,handles8_more).removeClass('active');
$$(currentHandle,handles8_more[this.currentIndex]).addClass('active');
}
});
//more handle buttons
hs8.addHandleButtons(handles8_more);

hs8.walk(0)
});
{/literal}
</script>

And finally, here's the eZ Publish extension.
This includes both the javascript files (mootools as well) and required stylesheets.

Download:
http://www.badongo.com/file/11670076


Compatibility note: Tested with eZ Publish 4.01 with ezwebin, but should work on basically every version of eZ Publish