Datafeedr Support Forums  

Go Back   Datafeedr Support Forums > Current Version (V3) Forum > Problems
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 8th, 2011, 05:04 PM
badm00n badm00n is offline
 
Join Date: Oct 2010
Posts: 39
Default Couple of minor fixes

Hello, v3 upgrade went well. Now just trying to match the visuals that i had in my v1 store.

1. Category Widget Style.

I believe the currently selected category would get an li class="active" style. I tried to add this to the new category widget settings but i couldn't get it to work properly.

2. Store search replacing default wordpress search.

The custom code to replace the default search no longer works in v3. Do you have the new code for this?


Thanks.
  #2  
Old January 8th, 2011, 05:18 PM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Hi

1. I changed the default category widget style to add the class="active" css to the li element. You can either edit yours or simply go to Factory > Views > Widgets > Categories > View Menu > Reset this view. That will delete any changes you made but add the class active stuff. Or just make the changes yourself like this:



2. Are you editing your theme's template files?

Eric
  #3  
Old January 8th, 2011, 05:32 PM
badm00n badm00n is offline
 
Join Date: Oct 2010
Posts: 39
Default

Thanks for #1. Any idea how I would now a class to the 2nd <ul> only? I had <ul class="level2"> for any child categories.

The search box I just had added code to my header. Sorry I deleted some of the code because it was giving me an error but this is what I still have left.

<form method="post" action="">
<div class="search">
<input type="text" onfocus="if(this.value=='search...') this.value='';" onblur="if(this.value=='') this.value='search...';" value="search..." size="20" class="inputbox" alt="Search" maxlength="20" id="mod_search_searchword" name="dfrs"><input type="image" onclick="this.form.searchword.focus();" src="<?php bloginfo('template_directory'); ?>/images/searchButton.gif" class="button" value="Search"> </div>
<input type="hidden" value="<?php echo get_option('dfr_page_for_store'); ?>" name="page_id" />

There was a php if statement and a php code in the action that was rendering the error so I removed it.
  #4  
Old January 8th, 2011, 05:43 PM
badm00n badm00n is offline
 
Join Date: Oct 2010
Posts: 39
Default

Sorry that last part probably wasn't clear. Here is the code from this thread i was using?

http://www.datafeedr.com/forums/showthread.php?t=697
  #5  
Old January 8th, 2011, 06:16 PM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Hi

Quote:
Originally Posted by badm00n View Post
Thanks for #1. Any idea how I would now a class to the 2nd <ul> only? I had <ul class="level2"> for any child categories.
So, the fun begins... nested categories.

They are a little tricky to implement and even harder to explain but basically you can define a format of HTML for every level in your category list. You do this by assigning id's to category lists.

Here's the code that accomplishes what you are intending to do:

Code:
[category.list before='<ul>' after='</ul>']
    
  [category.if active="self"]
    <li class="active">
      <a href="[category.link]" title="[category.name]">[category.name]</a>
      [category.list id='dfchild' before='<ul class="level2">' after='</ul>']
        <li>
          <a href="[category.link]" title="[category.name]">[category.name]</a>
        </li>
        [category.repeat id='dfchild']
      [/category.list]
    </li>
  [/category.if]
  
  [category.if active="child"]
    <li>
      <a href="[category.link]" title="[category.name]">[category.name]</a> 
      [category.list id='dfchild' before='<ul class="level2">' after='</ul>']
        <li>
          <a href="[category.link]" title="[category.name]">[category.name]</a>
        </li>
        [category.repeat id='dfchild']
      [/category.list]
    </li>
  [/category.if]
  
  [category.if active="parent"]
    <li>
      <a href="[category.link]" title="[category.name]">[category.name]</a>  
    </li>
  [/category.if]
  
  [category.if active="no"]
    <li>
      <a href="[category.link]" title="[category.name]">[category.name]</a>
    </li>
  [/category.if]
  
[/category.list]​
Eric
  #6  
Old January 8th, 2011, 06:17 PM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Quote:
Originally Posted by badm00n View Post
Sorry that last part probably wasn't clear. Here is the code from this thread i was using?

http://www.datafeedr.com/forums/showthread.php?t=697
I'm working on this. I think there is a bug that needs to get worked out before I can give you the code for that.

Eric
  #7  
Old January 8th, 2011, 06:27 PM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Quote:
Originally Posted by badm00n View Post
Sorry that last part probably wasn't clear. Here is the code from this thread i was using?

http://www.datafeedr.com/forums/showthread.php?t=697
OK, here's one method. I might post a simpler solution if I can work that out:
  1. Log into the Factory
  2. Go to Views > Custom Views > Add a new view
  3. Name the view "Search Form" and check the "Don't use layout for this view" checkbox
  4. Add a "text" widget to the module area.
  5. Click the template icon and add the code below (same code that can be found in your Widgets > Simple Search view):
    Code:
    <script type="text/javascript">
    <!--
    /*
     * NOTE: This JS code would be much better off
     * existing in your theme's header.php file.
    */
    function wash( anInput ) { if(anInput.value == anInput.defaultValue) anInput.value = ''; }
    function checkWash( anInput ) { if(anInput.value == '') anInput.value = anInput.defaultValue; }
    //-->
    </script>
    
    <div class="store_search_form">
      [search.form]
      [search.word onfocus='wash(this);' onblur='checkWash(this);' value='Search store...']
      [search.submit title='Go']
      [/search.form]
    </div>​
  6. Save the template code
  7. Update your store
  8. Paste the following code into your template files wherever you want the new search form to appear:
    Code:
    <?php echo datafeedr_tag("Search Form"); ?>

Eric
  #8  
Old January 8th, 2011, 07:08 PM
badm00n badm00n is offline
 
Join Date: Oct 2010
Posts: 39
Default

Thanks Eric. Both codes worked very nicely.

Just one small addition to the nested categories - The child li doesn't get an active class when selected.

Thanks.
  #9  
Old January 8th, 2011, 08:25 PM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

This ought to work:
Code:
[category.list before='<ul class="level<?php echo $depth; ?>">' after='</ul>']
    
  [category.if active='self']
    <li class="active">
      <a href="[category.link]" title="[category.name]">[category.name]</a>
      [category.repeat]
    </li>
  [/category.if]
  
  [category.if active='child']
    <li>
      <a href="[category.link]" title="[category.name]">[category.name]</a>  
      [category.repeat]
    </li>
  [/category.if]
  
  [category.if active='parent']
    <li>
      <a href="[category.link]" title="[category.name]">[category.name]</a>  
    </li>
  [/category.if]
  
  [category.if active='no']
    <li>
      <a href="[category.link]" title="[category.name]">[category.name]</a>
    </li>
  [/category.if]
    
[/category.list]​
 


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


All times are GMT -5. The time now is 12:40 AM.


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