Datafeedr Support Forums  

Go Back   Datafeedr Support Forums > Current Version (V3) Forum > Tips, Tricks & Tutorials
Home Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Important - The support forums are now in "read-only" mode as we transition to an alternative help desk solution. Feel free to contact us here with any of your questions or search the forums for an existing solution.
 
 
Thread Tools Search this Thread Display Modes
  #1  
Old January 9th, 2011, 09:17 AM
digitalcow digitalcow is offline
 
Join Date: Jun 2010
Posts: 494
Default Add drop down menus for store categories

Eric, do you have an update of this code for V3 please? I am keen to retain a drop down menu but using <?php echo dfr_categories('show_sub_categories=1&get_all=1&id =nav'); ?> with V3 is returning an error.

Referencing: http://www.datafeedr.com/forums/showthread.php?t=102

Last edited by Eric : January 9th, 2011 at 09:30 AM. Reason: Added URL to end of post for reference
  #2  
Old January 9th, 2011, 09:36 AM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

  1. Create a new Custom View named "Unordered Category List". Check the 'don't use layout' checkbox.
  2. Add a Category List module to the module area.
  3. Add the following code to the Category List module:
    Code:
    [category.list id='dfparent' before='<ul id="nav">' after='</ul>']
    <li>
      <a href="[category.link]" title="[category.name]">[category.name]</a>
      [category.list id='dfchild' before='<ul>' after='</ul>']
        <li>
          <a href="[category.link]" title="[category.name]">[category.name]</a>
          [category.repeat id='dfchild']
        </li>
      [/category.list]
    </li>
    [/category.list]
  4. Update your store
  5. Place the following code where you need your unordered list of categories to appear:
    PHP Code:
    <?php 
    $cats 
    str_replace(array("<div>","</div>"), array("",""), datafeedr_tag("Unordered Category List"));
    echo 
    $cats
    ?>

Eric
  #3  
Old January 9th, 2011, 09:43 AM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

This is also a valid alternative if you are using the TwentyTen theme or a theme which supports WP menus and drop down functionality: http://www.datafeedr.com/forums/showthread.php?p=16263
  #4  
Old January 9th, 2011, 10:03 AM
digitalcow digitalcow is offline
 
Join Date: Jun 2010
Posts: 494
Default

That's great, working perfectly. One question though, how would I go down 3 levels instead of one?

For example, I have Dresses -> Sort By Colour -> List of colours and also have Dresses -> Sort By Style -> Then a list of styles of dresses. At the moment in the drop down I only get dresses and one of the two sub options. I don't get the 3rd level.

Would it be as simple as adding another child tag?
  #5  
Old January 9th, 2011, 10:11 AM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

The code I provided will display your entire category list, as deep as your categories go. I've tested it on my site and it goes all the way down.



Are you sure that they categories are not being hidden because of the way your drop down menu CSS file handles that depth?

Also, make sure your category options are configured correctly:

Eric
  #6  
Old January 9th, 2011, 10:23 AM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Oops, sorry. The code needs to be modified just slightly.
Code:
[category.list id='dfparent' before='<ul id="nav">' after='</ul>']
<li>
  <a href="[category.link]" title="[category.name]">[category.name]</a>
  [category.list id='dfchild' before='<ul>' after='</ul>']
    <li>
      <a href="[category.link]" title="[category.name]">[category.name]</a>
      [category.repeat id='dfchild']
    </li>
  [/category.list]
</li>
[/category.list]
  #7  
Old January 9th, 2011, 10:38 AM
digitalcow digitalcow is offline
 
Join Date: Jun 2010
Posts: 494
Default

Thanks, got all the menus working but have discovered another problem.

No matter which category I go to and select a colour from the sub category, it always gives me the results of that colour from the dresses category. For example, if I go to Jackets and scroll down to brown, the results will not be brown Jackets but instead will be brown dresses.

The store is here http://ukchic.co.uk/store/store if you fancy giving it ago. Not sure if should move this to a new thread or not as it's not exactly related to the menu, but is (if that makes sense)
  #8  
Old January 9th, 2011, 10:51 AM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

I think this is because of how your URL settings are configured. I'm guessing you're using the default Category Page settings for your URLs which would be: store/category/%cs/

But that way, all category pages should show the store/category/ + the category slug. Since you have so many categories with the same name, there's no way to distinguish between 'brown' in the jackets category and 'brown' in the shoes category.

Try using store/category/%cp/ in your Default category page URL in your URL settings to display the full category path to your categories. That should help.

Eric
  #9  
Old January 23rd, 2011, 07:49 PM
lbuilta59 lbuilta59 is offline
 
Join Date: Jan 2011
Posts: 56
Default

Eric,
Can you please let me know how I can accomplish this with my Atahualpa theme? I have tried all of the above but none of them work. I sent you my WP login info earlier. I am trying to get the store category pages in the blue bar at the bottom of the header.
Thank you!
  #10  
Old January 23rd, 2011, 07:57 PM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Hi

Does that theme take advantage of the WP Menu system?

Eric
  #11  
Old January 23rd, 2011, 07:58 PM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Quote:
Originally Posted by lbuilta59 View Post
Eric,
Can you please let me know how I can accomplish this with my Atahualpa theme? I have tried all of the above but none of them work. I sent you my WP login info earlier. I am trying to get the store category pages in the blue bar at the bottom of the header.
Thank you!
Actually, you might be better off implementing this: http://www.datafeedr.com/forums/showthread.php?t=3448
  #12  
Old January 23rd, 2011, 08:04 PM
lbuilta59 lbuilta59 is offline
 
Join Date: Jan 2011
Posts: 56
Default

Quote:
Originally Posted by Eric View Post
Hi

Does that theme take advantage of the WP Menu system?

Eric
Yes, it does. I'm going to try your suggestion shown for the twentyten theme. Fingers crossed!
  #13  
Old January 28th, 2011, 01:28 PM
cashnow cashnow is offline
 
Join Date: Sep 2009
Posts: 362
Default

Does the drop down menu tip you provided above work with thesis?
  #14  
Old January 28th, 2011, 01:34 PM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Probably not because Thesis overrides the core WP menu system.
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
No drop down menu in new factory marcaustin Problems 15 March 10th, 2011 02:36 PM


All times are GMT -5. The time now is 07:01 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.