Superfish from simple to complicate

Permalink
Hi all,

Want to know if someone can give me the light cause i just have no idea of how to realize this.
I want to go from simple Superfish menu (image 01.jpg) to a more detailed superfish (image 02.jpg) .

Has someone any clue about how to realize ?


Thanks in advance

2 Attachments

chrismodlao
 
ronyDdeveloper replied on at Permalink Reply
ronyDdeveloper
You need to do some custom work for that. Like you can use page description attribute for the below menu text. You just need to create a custom template and call the page description attribute over there.

Rony
chrismodlao replied on at Permalink Reply
chrismodlao
I understand what you say but which file i need to edit.
I create a custom template for superfish here :blocks/superfish/templates/PBL
I need to edit the view.php file, that's it ?
ronyDdeveloper replied on at Permalink Reply
ronyDdeveloper
Yes. Just customize it as required. And when done, set the custom template to menu.

For the text that you enter in the "Description" text area attribute:

$c = Page::getCurrentPage();
$Desc = $c->getCollectionDescription();


Rony
chrismodlao replied on at Permalink Reply 2 Attachments
chrismodlao
so i did some change and i manage to get the description appear but only on the page after clicking menu (see pictures to understand)

I did this changes on the view.php file

as you told me on last post :
foreach($aBlocks as $ni) {
   $_c = $ni->getCollectionObject();
   $c = Page::getCurrentPage();
   $Desc = $c->getCollectionDescription();


and for the description to appear
if( $_c->getCollectionAttributeValue('dont_link') ){
         echo('<li><a></a>');
      }elseif ($ni->isActive($c) || strpos($c->getCollectionPath(), $_c->getCollectionPath()) === 0) {
         echo('<li class="nav-selected"><a class="nav-selected" href="' . $pageLink . '" '.($newWindow?'target="_blank"':'').'>' . $name . '<span>' . $Desc . '</span></a>');
      }else {
         echo('<li><a href="' . $pageLink . '" '.($newWindow?'target="_blank"':'').'>' . $name . '</a>');
      }
ronyDdeveloper replied on at Permalink Reply
ronyDdeveloper
You need to call the same object which is used for displaying the menu title. I was just giving you an example to show the description on a page. My code only applicable for the current page as I'm using
Page::getCurrentPage();


If you still don't understand, just attach the view.php here. I'll customize it.

Rony
chrismodlao replied on at Permalink Reply 1 Attachment
chrismodlao
I try again and again but i'm still able to show the description after clicking on the page, but not on the Homepage.
I attache the view.php (just have to rename the file *.php)
ronyDdeveloper replied on at Permalink Best Answer Reply 1 Attachment
ronyDdeveloper
Here is the page. Let me know whether it is working or not.

Update: Page Updated. download the view.zip file & extract it.

Rony
chrismodlao replied on at Permalink Reply
chrismodlao
No it's still the same, i have description after clicking on the link to the page but not on the homepage.
ronyDdeveloper replied on at Permalink Reply
ronyDdeveloper
download the latest one.
chrismodlao replied on at Permalink Reply
chrismodlao
You rock!! It works
So to know you add this :
$Desc = $ni->getDescription();


And after you introduce the $desc in here :
if( $_c->getCollectionAttributeValue('dont_link') ){
         echo('<li><a></a>');
      }elseif ($ni->isActive($c) || strpos($c->getCollectionPath(), $_c->getCollectionPath()) === 0) {
         echo('<li class="nav-selected"><a class="nav-selected" href="' . $pageLink . '" '.($newWindow?'target="_blank"':'').'>' . $name . '<span>' . $Desc . '</span></a>');
      }else {
         echo('<li><a href="' . $pageLink . '" '.($newWindow?'target="_blank"':'').'>' . $name . '<span>' . $Desc . '</span></a>');
      }


That's it ?
So it means that the only point i didn't do before was to add this : $ni->getDescription(); to my file.

Thanks again
ronyDdeveloper replied on at Permalink Reply
ronyDdeveloper
Also you have only add the description on active link. But now it is in both places.

Rony
chrismodlao replied on at Permalink Reply
chrismodlao
i try to put on both place but i forgot this : $ni->getDescription();

thanks again

Chris
chrismodlao replied on at Permalink Reply 2 Attachments
chrismodlao
Hi,

Sorry again but i try to ask my question here.

It seams that the second level didn't work in Superfish.
Have a look at the screencast in attached file.

Any help would be very nice.

Chris