Comment to "Making menus with CMenu and Superfish" Cookbook

Hello everybody,

I’m new to yii and this is my first post.

I wanted to comment on the tutorial on making menus with CMenu and superfish ( and it seems I have to leave a post first. So here it is with the comment I wanted to share:

I’ve been struggling with this a bit, and I found some things not so clear (like how and where superfish should be installed. It seemed like it would be picked automagically from some location).

I also found some errors like “$_GET’hierarchyParent’” which should be “$_GET[‘hierarchyParent’]” which I could fix myself, but in the end I couldn’t make it work (now I have it working).

I was very surprised that a simple comment like "//<-- optional" in the layout/main.php could do the magic to replace the static menu by the superfish one.

Now I’ve found the revision control source for the article. There the code seems to be complete and without errors. For example instead of the “// <-- optional” there are 3 or for lines with includes for the html source. With that code I could finally make the example work and figure that I can install superfish wherever I want as long as I point the aforementioned includes to the right place.

So the article is ok, but the rendering has quite a lot of artifacts.

There is still a little bug in the parent id in the sample database entries, where the parent id’s of some menu items are “off by one” and also I don’t think that the “root” entry should be showed, but otherwise it is working nice.

Yii doesn’t do any magic for comments like “//<-- optional”. The htmlOptionsin the following give it the superfish look:



'htmlOptions' => array('class' => 'sf-menu') // needed for superfish integration, see below...


EDIT: the markup for the cookbook was incorrect. I fixed it for whoever wrote it. See it again:

Hi, i wrote this tutorial and it was my fault, since i did not know how to mark up correctly.

Much thanks for jonas to repair my small cookbook entry :)

You can install superfish anywhere you want, for example you can make a project/js/superfish/ directory and extract superfish there.

Now i know how to do correct markup, so i will add a few sentences and an example on how to install superfish today.