Skip to main content

Menu with count SVN:1631

More
11 years 5 months ago #1450 by redactie
mod_datamanu contain a new function to retrieve the menu structure from the database.

If a level contains to many fields the older function discarded the results. This function will show the must frequent fields.


example tmpl/layout derived from default.php : count_menu.php
please note that the layout filename must end with _menu.php
Code:
<?php // no direct access # # Copyright brambring.nl # https://www.affiliatefeeds.nl # joomla@brambring.nl # defined( '_JEXEC' ) or die( 'Restricted access' ); $mod_div='module_'.$params->get('module_id'); $levels = $params->get( "levels",9); $l=explode(',',$levels); if ( count($l) == 2 ) { $start=$l[0]; $stop=$l[1]; } else { $start=1; $stop=$levels; } $baselink=$params->get( 'baselink', '' ); for ($v=1;$v<=11;$v++) { $x=$params->get("q$v",''); if ($x) { $baselink .="&q$v=".urlencode($x); } } print '<div id="'.$mod_div.'" class="menu'.$params->get('moduleclass_sfx').'">'; $removetring=$params->get('removestring',"Remove selected"); for ($v=$start;$v<=$stop;$v++) { $head=$params->get( "head$v", 'Pick!!' ); if (isset($dataitems["level$v"]) ) { $l=$dataitems["level$v"]; } else { $l=array(); } $q=$params->get( "q$v", '' ) ; if ( !$q && count ($l) == 0 ) { continue ; } print '<h3 class="kies" >'.$head.'</h3>'; print '<ul>'; if ($q) { $o=$params->get("clean$v",''); print '<li class="removetring">'.make_link(preg_replace("/&q[$v$o][^&]*/","",$baselink),"","$q ($verwijder )").'</li>'; } switch (count($l)) { case 0: break; case 1: $row=array_shift($l); if (! $q ) { print "<li class='autoselect'><span class='autoselect'>".$k['v']."</span></li>"; } else { print "<li>".make_link($baselink,"q$v",$k['v']). "</li>"; } break; default: foreach ($l as $row ) { print '<li>'.make_link($baselink,"q$v",$row['v']). '( '.$row['c'].')</li>'; } break; } print '</ul>'; } print '</div>';

Please Log in to join the conversation.

More
11 years 5 months ago - 11 years 5 months ago #1499 by sidewind
Bram,

When I use this layout, it shows all the existing menu levels.
It doesn't cut off the menu levels like the standard default.php does.
Before it showed "to much results" when there are more than the setting for max. menu levels.

Is that done with a reason? Or?

Thanx.

Greetz,

Sander.

Joomla versie: 2.5.28 & 3.4.3
Datafeed component versie: 2.5.2038 & 3.1.2072

www.kledingstunts.nl
www.bestelsuperdeals.nl

test shop: test.superdeals-online.nl
Last edit: 11 years 5 months ago by sidewind. Reason: updated

Please Log in to join the conversation.

More
11 years 5 months ago #1502 by redactie
The old menu revert to 'found to many' since it is kind of pointless to show the first x values ( alphabetically )

The new menu shows the most frequent values limited to 'limit'.

Setting levels to 1 will only show the first menu level with no selected value.

(try to see)

Please Log in to join the conversation.

More
11 years 5 months ago - 11 years 5 months ago #1515 by sidewind
Bram,

Is it still possible to build it in like it was before?

Because now it is showing all the submenu levels from all the selected first menu.
I think it is now more confusing?

First it showed only category and subcategory on the first page.
And on the rest of the pages only the menu levels from that first category.

This is now my test shop:
Maybe that explains more..

Greetz,

Sander.

Joomla versie: 2.5.28 & 3.4.3
Datafeed component versie: 2.5.2038 & 3.1.2072

www.kledingstunts.nl
www.bestelsuperdeals.nl

test shop: test.superdeals-online.nl
Last edit: 11 years 5 months ago by sidewind. Reason: removed link

Please Log in to join the conversation.

More
11 years 5 months ago #1520 by redactie
I will consider the old option.

Got quite a few remark on the 'found to many' boxes.

Setting levels to 1 or 2 to reduce the number of menu's levels will reduce the number of queries.

Please Log in to join the conversation.

More
11 years 5 months ago #1526 by sidewind
Bram,

Oke I understand the reason, but is it maybe possible to make it as an option?
Or maybe just as a custom code here in the forum.

I love it that the module now shows the total items per menu level!!

I was trying to get that working for a while ;-)

Thanks,

Sander.

Joomla versie: 2.5.28 & 3.4.3
Datafeed component versie: 2.5.2038 & 3.1.2072

www.kledingstunts.nl
www.bestelsuperdeals.nl

test shop: test.superdeals-online.nl

Please Log in to join the conversation.

Time to create page: 0.598 seconds