+ Reply to Thread
Results 1 to 5 of 5

Thread: Nav Block Show When Question

  1. #1
    Client pdunton's Avatar
    Join Date
    Apr 2006
    Location
    Tucson, Arizona
    Posts
    557
    Squirrelcart version
    v3.4.1

    Nav Block Show When Question

    I would like to show the News Nav Block in the right side column but ONLY if no other nav blocks are there.

    In other words, display the News block until some other nav block (Preview, ETC.) is called.

    Seem to be in a mental block here.

    Need input.

    Phil
    Tucson

  2. #2
    Squirrelcart Staff Jamie's Avatar
    Join Date
    May 2002
    Posts
    6,829
    Squirrelcart version
    v3.3.7
    This is tricky. You could try this:

    1. Put this at the top of the nav_block.tpl.php template file:
    PHP Code:
    <?php $GLOBALS['nav_block_count']++ ?>
    This will increment that variable for each nav block.

    2. Make sure the News nav block is positioned so it is listed at least second or lower on your theme record

    3. Put this in the Show When field for the News nav block:
    PHP Code:
    $GLOBALS['nav_block_count'] !>= 
    I think that will work, though I didn't test it.

  3. #3
    Client pdunton's Avatar
    Join Date
    Apr 2006
    Location
    Tucson, Arizona
    Posts
    557
    Squirrelcart version
    v3.4.1

    Cool Tricky Indeed!

    That was not quite right but gave me the start I needed.
    Jamie:
    Can't you put a list of the Squirrelcart variables in the documentation?
    If I had those at hand, half of my questions would be easily answered!

    Thanks.
    Phil
    Tucson

  4. #4
    Squirrelcart Staff Jamie's Avatar
    Join Date
    May 2002
    Posts
    6,829
    Squirrelcart version
    v3.3.7
    You're welcome.

    Can't you put a list of the Squirrelcart variables in the documentation?
    That would be a huge undertaking. We aren't marketing our software as an API, and this would be very difficult to manage.

    You can find every variable stored in the $SC array at any given time by putting this in any template file:
    PHP Code:
    <?php sc_print_array($SC); ?>
    For globals:
    PHP Code:
    <?php sc_print_array($GLOBALS); ?>
    For any template that is displaying a record from a table in the control panel, you will usually find a variable corresponding directly to the name of every column in that table.

  5. #5
    Client pdunton's Avatar
    Join Date
    Apr 2006
    Location
    Tucson, Arizona
    Posts
    557
    Squirrelcart version
    v3.4.1

    Cool Looks like a challenge

    Thank you Jamie.
    Sometimes all I need is that little "push" to get moving forward again.

    I'm thinking in terms of a little stand alone php module to just print out the variables after every upgrade. Hhmmm....Shouldn't be that hard, you've given me the code.
    Now where did I put that "Php For Dummies" book?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts