link to full article:
http://www.fourthwc.com/netsuite/2013/10/related-items-layout-netsuite.html
A Step by Step Guide
One of the features I like about the NetSuite SuiteCommerce web store is the related item functionality. Not only can you hand pick related items to display on product pages, but you can also allow NetSuite to automatically generate recommendations based on sales history. NetSuite includes four sample related item layouts, but they don't handle varying sized images very well and tend to take up a lot of space, so I developed an alternative layout that solves some of those problems.
A Better Related Item Layout
Here's what you can expect from the new layout:
Features
[LIST]
[*]Automatically centers the thumbnail horizontally and vertically.
[*]Uses your existing item thumbnails, no matter what size they are, and allows the browser to resize it with CSS. This saves you from having to manually standardize your thumbnail sizes, which can take a lot of time to maintain.
[*]This solution does not depend on the NetSuite image resizing tool, which can be problematic.
[*]Fully search engine friendly solution, by including the item name in the link, it boosts your internal link credit for those keywords.
[*]Get the benefit of using CSS to position and resize the images, while preserving the NetSuite preference for table-based layout.
[/LIST]
Step-by-Step Guide to Creating the Layout
Prerequisites: you should be familiar with the NetSuite templating system, and have a NetSuite SuiteCommerce web store that uses the built-in related items functionality. you can also click to download a zip file containing all of the code here.
1. First, create the list template. Go to Setup > Site Builder > Item/Category Templates > New. Copy & paste this code into the 'Template HTML' field. Name it something like 'FWC related item list template' and hit save:
<!– start FWC related item list template –> <td id="itemlisttd"><table cellpadding="0" cellspacing="0" class="list"> <tr> <NLITEMLIST> </tr> </table></td> <!–end FWC related item list template –>
2. Create the item list cell template. Go to Setup > Site Builder > Item/Category Templates > New. Copy & paste this code into the 'Template HTML' field. Name it something like 'FWC related item list cell template' and hit save:<!-- start FWC related item list cell template --> <td class="itemcelltd <%=getCurrentAttribute('item','internalid')%>" valign="top"> <div class='cel big_related_link'><div class="imgWrap"><A href='<%=getCurrentAttribute('item','storeurl')%>' title='<%=getCurrentAttribute('item','storedisplayname')%>'><img src='<%=getCurrentAttribute('item','storedisplaythumbnail')%>' border='0'> </div> <%=getCurrentAttribute('item','storedisplayname')%></a> </div> </td> <!--end FWC related item list cell template -->3. Create your layout. Go to Setup > Site Builder > Layouts > New. Name it something like: 'FWC related items layout'. Fill out the fields as follows:Border style: No WindowColumn Width: Fit to browser windowNumber of columns: whatever you like, up to 6Number of rows: 1row height and row padding - leave emptyPaginate and sort links - leave uncheckedItems are laid out: horizontallyUse checkerboard effect: uncheckedSort by: sequenceUse templates: checkedList template: choose the template created in step 1List cell template: choose the template created in step 24. Update your product template. Modify your existing item drill down template with the following code to display the related items. If you give the template a new name and click save as, it will create a copy that doesn't overwrite your default template. You can then use the new template to test before rolling it out for the full site. Here is the HTML:<div class="related_outer_wrap"> <strong>You May Also Like:</strong> <table cellspacing="0" cellpadding="0" id="related_list"> <tr> <%=getCurrentAttribute('item','allrelateditemshtml')%> </tr> </table> </div> 5. Add the CSS code to your main file. Websites tend to vary, but most have a single CSS file that contains most of the CSS code for the site. Add this CSS code to the end of the main CSS file, then upload it to your file cabinet, replacing the existing one. Here is the CSS code (or click here to download it as a text file): #itemlisttd { padding: 0; } .itemcelltd { text-align: center; padding: 0 5px 15px 5px; margin: 0 auto; width: 120px; } div.imgWrap { float: left; text-align: center; width: 120px; height: 121px; margin: 0px; border: 1px solid #ccc; font-size: 1em; line-height: 148px; } div.imgWrap img { margin-top: expression(( 100 - this.height ) / 2); max-width: 120px; max-height: 120px; position: relative; top: -15px; } html>body div.imgWrap img { /*hidden from IE 5-6 */ margin-top: 0; /* to clean up, just in case IE later supports valign! */ vertical-align: middle; } .related_outer_wrap { padding-top: 50px; clear: left; } #related_list { margin-top:10px; }6. Test your new layout. In NetSuite, navigate to a category or tab that contains items, and edit it. change the' Related Items List Layout' to the one created in step 3. This will override the default for this category only. To change the default, update the selection in the site theme or set up website, depending on how your site is configured.See it in ActionHere are a couple of working examples:http://www.girlscrochetheadbands.com/Headbands/Elastic/Elastic-Headband-with-Loop-3-4-White.htmlhttp://tdr.fourthwc.net/Merlin-Magix-4406-Display-Phone.htmlIf you didn't already know, you can get a free test drive account from NetSuite filled with sample data that you can use to test out all kinds of things. I highly recommend it for anyone who wants to learn NetSuite.