Advertisement:

Author Topic: [Solved] How to remove some category from Jquery Plugin?  (Read 2727 times)

gowtham

  • Newbie
  • *
  • Posts: 8
[Solved] How to remove some category from Jquery Plugin?
« on: October 19, 2013, 12:21:50 pm »
Hi friends,

Am new to osclass forum and using osclass modern theme.

I have 12 category in the home page... Jquery Plugin menu (have not sufficient space to show all category in single row) so, its continuous in second row... Whether you can see the attached snapshop. Please help me how to solve this issue... How to remove some category from Jquery menu plugin...

Snapshot: http://img259.imageshack.us/img259/6913/11240055.png
« Last Edit: October 29, 2013, 01:31:01 pm by gowtham »

frosticek

  • Hero Member
  • *****
  • Posts: 3948
Re: How to remove some category from Jquery Plugin?
« Reply #1 on: October 19, 2013, 12:32:57 pm »
@gowtham

> go to oc-content/plugins/jquery_menu/index.php
> find function jquery_menu()

Default I have there this code:
Code: [Select]
function jquery_menu(){

echo '<ul class="topnav"><li><a href="'.osc_base_url().'">'. __('Home', 'JQuery_Menu') . '</a></li>';
while ( osc_has_categories() ){
if(menu_disable()){
echo '<li><a href="'.osc_search_category_url().'" onClick="return false;">'.osc_category_name().'</a><ul class="subnav">';
} else{
echo '<li><a href="'.osc_search_category_url().'">'.osc_category_name().'</a><ul class="subnav">';
}

while ( osc_has_subcategories() ) {
$catCount ='';
if (sAd()) { $catCount = ' ('.osc_category_total_items().')'; }
echo '<li><a href="'.osc_search_category_url().'">'.osc_category_name(). $catCount . '</a></li>';
}
echo '</ul></li>';
}
echo '</ul>';
}

Change it to:
Code: [Select]
function jquery_menu(){
$cat_count = 1;
                $max_cat = 5;
echo '<ul class="topnav"><li><a href="'.osc_base_url().'">'. __('Home', 'JQuery_Menu') . '</a></li>';
while ( osc_has_categories() and $cat_count < $max_cat){
if(menu_disable()){
echo '<li><a href="'.osc_search_category_url().'" onClick="return false;">'.osc_category_name().'</a><ul class="subnav">';
} else{
echo '<li><a href="'.osc_search_category_url().'">'.osc_category_name().'</a><ul class="subnav">';
}

while ( osc_has_subcategories() ) {
$catCount ='';
if (sAd()) { $catCount = ' ('.osc_category_total_items().')'; }
echo '<li><a href="'.osc_search_category_url().'">'.osc_category_name(). $catCount . '</a></li>';
}
echo '</ul></li>';
                $cat_count = $cat_count + 1;
}
echo '</ul>';
}

To manage how many categories to show, change:
Code: [Select]
$max_cat = 5;

to whatever you want  ;)

gowtham

  • Newbie
  • *
  • Posts: 8
Re: How to remove some category from Jquery Plugin?
« Reply #2 on: October 19, 2013, 04:31:22 pm »
Not working error Showing:

Fatal error: Call to undefined function menu_disable()  /oc-content/plugins/jquery_menu/index.php on line 42
« Last Edit: October 19, 2013, 04:38:18 pm by gowtham »

frosticek

  • Hero Member
  • *****
  • Posts: 3948
Re: How to remove some category from Jquery Plugin?
« Reply #3 on: October 20, 2013, 12:30:57 am »
@gowtham

Try to do those changes manually on original plugin (you can see differences to original function)
I suppose you have copied some blank spaces that thrown this error since we did not change anything in that function.

gowtham

  • Newbie
  • *
  • Posts: 8
Re: How to remove some category from Jquery Plugin?
« Reply #4 on: October 20, 2013, 11:58:17 am »
Following is the code that I had in jquery menu... Please change it manually as per you said. Do the needful for me.

function jquery_menu_js(){
echo '<link href="'.osc_base_url().'oc-content/plugins/jquery_menu/jquery_menu.css" rel="stylesheet" type="text/css" />';
echo '<script type="text/javascript" src="'.osc_base_url().'oc-content/plugins/jquery_menu/jquery_menu.js"></script>';
}
function jquery_menu(){
echo '<ul class="topnav"><li><a href="'.osc_base_url().'">Home</a></li>';
while ( osc_has_categories() ){
echo '<li><a href="'.osc_search_category_url().'">'.osc_category_name().'</a><ul class="subnav">';
while ( osc_has_subcategories() ) { echo '<li><a href="'.osc_search_category_url().'">'.osc_category_name().'('.osc_category_total_items().')</a></li>';
}
echo '</ul></li>';
}
echo '</ul>';
}

gowtham

  • Newbie
  • *
  • Posts: 8
Re: How to remove some category from Jquery Plugin?
« Reply #5 on: October 21, 2013, 12:12:44 pm »
Please reply me... Why no one is helping here... What happen to Senior members, hero members and administrator ! ! !

gowtham

  • Newbie
  • *
  • Posts: 8
Re: How to remove some category from Jquery Plugin?
« Reply #6 on: October 24, 2013, 12:22:45 pm »
Hi friends... please help me to solve the issue. Am new to osclass??? Plz

frosticek

  • Hero Member
  • *****
  • Posts: 3948
Re: How to remove some category from Jquery Plugin?
« Reply #7 on: October 24, 2013, 12:23:40 pm »
@gowtham

You have whole solution up.


function jquery_menu(){
$max=5;
$poc=1;
echo '<ul class="topnav"><li><a href="'.osc_base_url().'">Home</a></li>';
while ( osc_has_categories() and $poc < $max ){
echo '<li><a href="'.osc_search_category_url().'">'.osc_category_name().'</a><ul class="subnav">';
while ( osc_has_subcategories() ) { echo '<li><a href="'.osc_search_category_url().'">'.osc_category_name().'('.osc_category_total_items().')</a></li>';
}
echo '</ul></li>';
$poc = $poc + 1;
}
echo '</ul>';
}

gowtham

  • Newbie
  • *
  • Posts: 8
Re: How to remove some category from Jquery Plugin?
« Reply #8 on: October 29, 2013, 01:30:04 pm »
Finally works fine... Thank you very much  frosticek. :)  :) Thanks for your help.

frosticek

  • Hero Member
  • *****
  • Posts: 3948
Re: [Solved] How to remove some category from Jquery Plugin?
« Reply #9 on: October 29, 2013, 01:45:44 pm »
@gowtham

You are welcome  ;)