User loginRecent blog posts
|
Tip: Show Product Tabs Only When NecessaryJust a tip for ZNode users: If you don't use the additional information fields for your products (that when rendered become the tabbed dialog when viewing a product), you can turn off the tab control easily (until the next revision of ZNode when it looks like this may become part of the Admin tool). I was going to write the code to turn off the tabs myself, and found a little gem already existing in \common\product\ProductTabs.ascx.cs called "ShowTabsOnlyIfDataPresent". Just set that variable to 'true', and you're almost done! Next, uncomment the "counter++;" line under the "ProductAdditionalImage1" block so the counter increments for that tab automatically (ignoring your additional images as 'additional information', since they are now available in the main UI, anyway). One more thing: If you don't run the top-end version of ZNode, you might not have all of the tabs, so you'll need to add one final check. In the last block, just add a check for the number of tabs before trying to access any properties on the final tab:
That will do it! If there's no info. for the tabs to display, the whole thing magically disappears. Let me tell you, it made my night to find most of the code I thought I was going to have to write already done! Mark Note: This has been updated in the ZNode Google Group: http://groups.google.com/group/znode-users/web/show-tabbed-dialog-only-i...
|
SearchQuick Links |