LOOP PRODUCT TAG

General ShopSite user discussion

LOOP PRODUCT TAG

Postby bubblefast » Thu May 03, 2007 1:41 pm

Can anyone please tell me where the code for the LOOP PRODUCT TAG is located and whether or not it is modifiable?

Thank you very much,
Mark
bubblefast
 
Posts: 9
Joined: Sat Apr 07, 2007 4:16 pm

Postby Jim » Fri May 04, 2007 9:09 am

The actual code that does the looping is built into ShopSite cgis and can not be modified by the merchant.

The basic code
[-- loop products --]
[--product--]
[-- end_loop products --]

simply does a loop through all the products assigned to the page and outputs each product using he template assigned to that product. It also adds an ancor tag with the product number so that Search can link directly to the place on the page where the product is located. Any other formatting comes from the product template or what might be before or after the Loop tags.

If you use the [-- loop products numbercolums --] option then ShopSite will out put beginning and ending TR tags for the initial time through the loop and everytime the numbercolumns value is reached. Other formatting for Table elements like puttting the product information is TD is done by the merchant either within the loop code on the page or in the product template itself.
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah

LOOP PRODUCT TAG

Postby bubblefast » Fri May 04, 2007 9:14 am

Thank you for your quick and very detailed answer.

What I am trying to accomplish is placing a LOT (over 100) items in a table or a loop. The problem I am having is that using the LOOP PRODUCT tag causes a space of one row between each <tr>. I need to compress my rows in order to fit a lot on one page. is there a way to accomplish this either with or without the LOOP PRODUCT tag?

I am very new to Shopsite and am still feeling my way around.

Thanks again,
Mark
bubblefast
 
Posts: 9
Joined: Sat Apr 07, 2007 4:16 pm

Postby loren_d_c » Fri May 04, 2007 10:46 am

Mark,

Any 'space' would come from the HTML output either in your page template or product template. As Jim has mentioned, the only HTML output of this that you can't control is an anchor tag (which shouldn't create any visible space) and the <tr> and </tr> tags themselves if you are using the 'numcolumns' parameter in the LOOP PRODUCTS tag.

The space you are seeing is likely just the default spacing your browser applies to all HTML tables (and/or form fields, if you are using a form-based add to cart button in your product template) and you just need to give different spacing to these table (and/or form field) elements either in the HTML tags themselves or in CSS that defines them.

Jim also said this in reply to your other post on exactly the same topic:

http://support.shopsite.com/forums/viewtopic.php?t=3011

There are default values that browsers use for spacing around and within a table. You can modify the various spacing features by using style sheets.

You should check out a good style book to see how this is done. You can also get information of the web at various sites by searching for "Table style sheet". You might want to check the site
http://www.w3.org/TR/REC-CSS2/tables.html for some basic information.


I would suggest the same thing as Jim, check out an HTML/CSS book or other online docs and find out what your HTML/CSS could be doing to override the HTML default spacing around table elements and form elements.

-Loren
loren_d_c
 
Posts: 2572
Joined: Fri Aug 04, 2006 12:02 pm
Location: Anywhere

LOOP PRODUCT TAG

Postby bubblefast » Fri May 04, 2007 11:02 am

Yes. Jim was very helpful. Thank you very much.

I tend to try to look at as many angles as possible and try for the simplest approach.

I now know what I need to do.

Thanks again,
Mark
bubblefast
 
Posts: 9
Joined: Sat Apr 07, 2007 4:16 pm


Return to User Forum

Who is online

Users browsing this forum: No registered users and 47 guests