njohn Posted April 6, 2016 Share Posted April 6, 2016 Can you have text among products list eg: products Text products Quote Link to comment Share on other sites More sharing options...
bsmither Posted April 6, 2016 Share Posted April 6, 2016 Of course. With enough time and ingenuity, America put a man on the Moon. With just a wee bit more, we can put a man on the Sun. (Hee!) Will this be in the Latest Products, or a Category (includes Search and Saleitems) list? Either way, CubeCart loads a variable with an array of products to list.{foreach from=$PRODUCTS item=product} Then iterates through them. To have some sort of interstitial, we need to deal with "list mode" and "grid mode". A grid has three-across, so we can't interrupt the iteration at any arbitrary point. Smarty has a loop counter. For example: {foreach from=$PRODUCTS item=product} {if $product@iteration is div by 3} <!-- Stop the list --> </ul> <p>Text break</p> <!-- Resume the list (be sure to include the attributes of the previous <ul> tag --> <ul> {/if} <li>Product Panel:{$product}</li> {/foreach} There is slightly more to consider since Foundation uses its "block-grid" feature. Quote Link to comment Share on other sites More sharing options...
njohn Posted April 6, 2016 Author Share Posted April 6, 2016 I mean on the Category Page - Creating sub-categories, or whatever Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted April 6, 2016 Share Posted April 6, 2016 I'm having trouble imagining what you have in mind. Could you give a more concrete example of what you want? Quote Link to comment Share on other sites More sharing options...
njohn Posted April 6, 2016 Author Share Posted April 6, 2016 On category page display: Products Some Text Products I don't think it's doable - but perhaps someone knows how Quote Link to comment Share on other sites More sharing options...
bsmither Posted April 6, 2016 Share Posted April 6, 2016 The code in my previous reply will do it. Quote Link to comment Share on other sites More sharing options...
njohn Posted April 6, 2016 Author Share Posted April 6, 2016 Thank you b, Where do I find smarty? I've in & out all day. Will test it prob tomorrow and report results Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted April 6, 2016 Share Posted April 6, 2016 The loop counter code Bsmither has in his code IS Smarty code, evidently. Quote Link to comment Share on other sites More sharing options...
njohn Posted April 7, 2016 Author Share Posted April 7, 2016 Just can't make it work right - not a BIG thing anyway. Just one cat involved and it's really OK the way it is. Mark Resolved. Quote Link to comment Share on other sites More sharing options...
bsmither Posted April 7, 2016 Share Posted April 7, 2016 Work right? Or not work at all? Quote Link to comment Share on other sites More sharing options...
njohn Posted April 7, 2016 Author Share Posted April 7, 2016 Not at all. I pasted the html in the Cat Description and it just displayed the pasted text Quote Link to comment Share on other sites More sharing options...
bsmither Posted April 7, 2016 Share Posted April 7, 2016 I understood you wanted interstitial text. The admin, Category, Add/Edit Category, Description tab, Content Editor box is not where this would go. On a storefront View Category page, you wanted this: Category Name Category Description List of Sub-cats Sorter (and Pagination) Product1 Product2 Product3 Interstitial Text (maybe an advert?) Product4 Product5 Product6 etc. Quote Link to comment Share on other sites More sharing options...
njohn Posted April 7, 2016 Author Share Posted April 7, 2016 AhhhSo - I'll try it Quote Link to comment Share on other sites More sharing options...
njohn Posted April 8, 2016 Author Share Posted April 8, 2016 4 hours ago, bsmither said: On a storefront View Category page Where is it? Quote Link to comment Share on other sites More sharing options...
bsmither Posted April 8, 2016 Share Posted April 8, 2016 In the skin template file content.category.php, find near line 65 (for Foundation): <div id="ccScroll"> <ul class="small-block-grid-1 product_list" data-equalizer> {foreach from=$PRODUCTS item=product} <li> Change to: <div id="ccScroll"> <ul class="small-block-grid-1 product_list" data-equalizer> {foreach from=$PRODUCTS item=product} {if $product@iteration is div by 3} <!-- Stop the list --> </ul> <p>Text break</p> <!-- Resume the list (be sure to include the attributes of the previous <ul> tag --> <ul class="small-block-grid-1 product_list" data-equalizer> {/if} <li> Have your browser ask for a category page from the storefront. You should now see Text break every so often in the list. We can adjust the test that determines when and where the interstitial happens. Quote Link to comment Share on other sites More sharing options...
njohn Posted April 8, 2016 Author Share Posted April 8, 2016 It absolutely WORKS! Thanks AGAIN "We can adjust the test that determines when and where the interstitial happens." You like this Unlike this Yes it happens in ALL cats. I only want it to happen in 1 cat. Quote Link to comment Share on other sites More sharing options...
bsmither Posted April 8, 2016 Share Posted April 8, 2016 (edited) You would need to know the category ID of the one category you want this to happen with. For example, when the cat_id is 5. {if $category.cat_id == 5 && $product@iteration is div by 3} Edited April 8, 2016 by bsmither Stupid syntax error Quote Link to comment Share on other sites More sharing options...
njohn Posted April 8, 2016 Author Share Posted April 8, 2016 That's logical, and quite simple. Mark this [SOLVED] Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted April 8, 2016 Share Posted April 8, 2016 Fantastic! I would like to see this in action, if you don't mind providing a link, @njohn Quote Link to comment Share on other sites More sharing options...
njohn Posted April 8, 2016 Author Share Posted April 8, 2016 I set up a mirror of the site 2 weeks or so back and I use it for tweaking (to avoid disasters). A LOT has happened to the actual site since then The url (I set it up on a FREE but very good host, x10 hosting) is: http://misc.x10host.com/shop the category affected is Mix-Fix Cooking Goodies Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted April 8, 2016 Share Posted April 8, 2016 Very attractive, and I thoroughly enjoyed looking around your store, too. I did notice that the soda can airplanes were extremely light weight - surprised me, as I would expect them to be shipped in a sturdy box with bubble wrap. And the pralines made my mouth water!! Quote Link to comment Share on other sites More sharing options...
njohn Posted April 8, 2016 Author Share Posted April 8, 2016 Yeah, the store owner liked it so much he said put it everywhere sooo: http://natchezshop.com/shop . Originally we were thinking about inserting comments about the people who make that product and I only put that image on the test site to see if an image would work. The airplane weight was corrected already on the production site Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.