{"id":543,"date":"2020-06-09T14:12:22","date_gmt":"2020-06-09T13:12:22","guid":{"rendered":"https:\/\/www.graphicz.co.uk\/blog\/?p=543"},"modified":"2020-06-09T14:25:20","modified_gmt":"2020-06-09T13:25:20","slug":"one-fragment-column-in-swift-section-page","status":"publish","type":"post","link":"https:\/\/www.graphicz.co.uk\/blog\/one-fragment-column-in-swift-section-page\/","title":{"rendered":"One Fragment Column in Swift Section Page"},"content":{"rendered":"\n<p>Sellerdeck Swift is an excellent design template. One drawback is that the number of columns for product summaries is fixed, you can no longer specify it. This means that with four columns across of product summaries if you have a single fragment, perhaps an introductory or explanatory fragment at the top of the section it will be squashed into the  first quarter column when you would like it to be displayed across the top.<\/p>\n\n\n\n<p>Here is how to fix that:<\/p>\n\n\n\n<p>In Design Library go to Product Lists and right click and copy &#8216;Responsive Product List&#8217; twice.<br><br>Rename one &#8216;Responsive Product List Products&#8217; and one &#8216;Responsive Product List Fragments&#8217;<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><a class=\"fancybox\" href=\"https:\/\/www.graphicz.co.uk\/blog\/wp-content\/uploads\/2020\/06\/image_7050-1.jpg\" rel='magnific'><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.graphicz.co.uk\/blog\/wp-content\/uploads\/2020\/06\/image_7050-1.jpg\" alt=\"\" class=\"wp-image-549\" width=\"949\" height=\"393\" srcset=\"https:\/\/www.graphicz.co.uk\/blog\/wp-content\/uploads\/2020\/06\/image_7050-1.jpg 949w, https:\/\/www.graphicz.co.uk\/blog\/wp-content\/uploads\/2020\/06\/image_7050-1-600x248.jpg 600w, https:\/\/www.graphicz.co.uk\/blog\/wp-content\/uploads\/2020\/06\/image_7050-1-300x124.jpg 300w, https:\/\/www.graphicz.co.uk\/blog\/wp-content\/uploads\/2020\/06\/image_7050-1-768x318.jpg 768w, https:\/\/www.graphicz.co.uk\/blog\/wp-content\/uploads\/2020\/06\/image_7050-1-250x104.jpg 250w\" sizes=\"(max-width: 949px) 100vw, 949px\" \/><\/a><\/figure>\n\n\n\n<p>Open each in turn, in the product one remove all the fragment stuff and in the fragment one remove all the product stuff: <\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><a class=\"fancybox\" href=\"https:\/\/www.graphicz.co.uk\/blog\/wp-content\/uploads\/2020\/06\/image_7050-2.jpg\" rel='magnific'><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.graphicz.co.uk\/blog\/wp-content\/uploads\/2020\/06\/image_7050-2.jpg\" alt=\"\" class=\"wp-image-550\" width=\"949\" height=\"366\" srcset=\"https:\/\/www.graphicz.co.uk\/blog\/wp-content\/uploads\/2020\/06\/image_7050-2.jpg 949w, https:\/\/www.graphicz.co.uk\/blog\/wp-content\/uploads\/2020\/06\/image_7050-2-600x231.jpg 600w, https:\/\/www.graphicz.co.uk\/blog\/wp-content\/uploads\/2020\/06\/image_7050-2-300x116.jpg 300w, https:\/\/www.graphicz.co.uk\/blog\/wp-content\/uploads\/2020\/06\/image_7050-2-768x296.jpg 768w, https:\/\/www.graphicz.co.uk\/blog\/wp-content\/uploads\/2020\/06\/image_7050-2-250x96.jpg 250w\" sizes=\"(max-width: 949px) 100vw, 949px\" \/><\/a><\/figure>\n\n\n\n<p>In the Fragment one open &#8216;Click Here to Edit List Layout Settings&#8217;,<br><br>Click the &#8216;Edit Rows and Columns&#8217; tab<br><br>Under No Of Items, Middle rows delete &#8216;dynamic&#8217; and replace it with 1.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.graphicz.co.uk\/blog\/wp-content\/uploads\/2020\/06\/image_7050-3.jpg\" alt=\"\" class=\"wp-image-551\" width=\"678\" height=\"570\" srcset=\"https:\/\/www.graphicz.co.uk\/blog\/wp-content\/uploads\/2020\/06\/image_7050-3.jpg 678w, https:\/\/www.graphicz.co.uk\/blog\/wp-content\/uploads\/2020\/06\/image_7050-3-600x504.jpg 600w, https:\/\/www.graphicz.co.uk\/blog\/wp-content\/uploads\/2020\/06\/image_7050-3-300x252.jpg 300w, https:\/\/www.graphicz.co.uk\/blog\/wp-content\/uploads\/2020\/06\/image_7050-3-238x200.jpg 238w, https:\/\/www.graphicz.co.uk\/blog\/wp-content\/uploads\/2020\/06\/image_7050-3-476x400.jpg 476w\" sizes=\"(max-width: 678px) 100vw, 678px\" \/><\/figure>\n\n\n\n<p>Click Overal Design, change &lt;div class=&#8221;product-list&#8221;&gt; to &lt;div class=&#8221;product-listx&#8221;&gt;<br><br>Add to stylesheet:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">@media (min-width: 768px) {\n.product-listx &gt; div, .product-listx &gt; .product-details {\npadding-left: 15px !important;\npadding-right: 0 !important;\npadding-top: 15px;\nmargin-bottom: 30px;\nwidth:100%\n}\n.product-listx {\nwidth:100%\n}\n}<\/pre>\n\n\n\n<p>In Section Page Body, comment out &#8216;Product List&#8217;<br>And add your two new layouts Fragment one first:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"> &lt;!--&lt;actinic:variable name=\"ProductList\" \/&gt;--&gt;\n&lt;actinic:variable name=\"ProductList\" value=\"Responsive Product List Fragments\" \/&gt;\n&lt;actinic:variable name=\"ProductList\" value=\"Responsive Product List Products\" \/&gt;<\/pre>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.graphicz.co.uk\/blog\/wp-content\/uploads\/2020\/06\/image_7050-4.jpg\" alt=\"\" class=\"wp-image-552\" width=\"682\" height=\"447\" srcset=\"https:\/\/www.graphicz.co.uk\/blog\/wp-content\/uploads\/2020\/06\/image_7050-4.jpg 682w, https:\/\/www.graphicz.co.uk\/blog\/wp-content\/uploads\/2020\/06\/image_7050-4-600x393.jpg 600w, https:\/\/www.graphicz.co.uk\/blog\/wp-content\/uploads\/2020\/06\/image_7050-4-300x197.jpg 300w, https:\/\/www.graphicz.co.uk\/blog\/wp-content\/uploads\/2020\/06\/image_7050-4-250x164.jpg 250w\" sizes=\"(max-width: 682px) 100vw, 682px\" \/><\/figure>\n\n\n\n<p>The problem now is that you will get empty divs in the fragment list where products should be and empty divs in the product list where fragments should be!<br><br>This is solved thus:<br><br>Add this above the two layouts in the Section Page Body:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;script&gt;\n$(\"div.product-details\").filter(function(){\nreturn $(this).text().trim() == \"\"\n}).remove();\n&lt;\/script&gt;<\/pre>\n\n\n\n<p>Add to stylesheet:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">.product-details:empty {\ndisplay: none!Important;\nwidth:0;\nmargin:0;\npadding:0;\nborder:0;\n}<\/pre>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.graphicz.co.uk\/blog\/wp-content\/uploads\/2020\/06\/image_7050-5.jpg\" alt=\"\" class=\"wp-image-553\" width=\"592\" height=\"361\" srcset=\"https:\/\/www.graphicz.co.uk\/blog\/wp-content\/uploads\/2020\/06\/image_7050-5.jpg 592w, https:\/\/www.graphicz.co.uk\/blog\/wp-content\/uploads\/2020\/06\/image_7050-5-300x183.jpg 300w, https:\/\/www.graphicz.co.uk\/blog\/wp-content\/uploads\/2020\/06\/image_7050-5-250x152.jpg 250w\" sizes=\"(max-width: 592px) 100vw, 592px\" \/><\/figure>\n\n\n\n<p>NB. This only works in the live site, you will see the empty divs in preview.<br><br>See it here: <a rel=\"noreferrer noopener\" href=\"https:\/\/www.graphicz.solutions\/onefragcol\/acatalog\/Rings.html\" target=\"_blank\">https:\/\/www.graphicz.solutions\/onefr&#8230;log\/Rings.html<\/a><br><br>The other thing to mention is that in Swift the Section Description now appears at the top of the section page which will sometimes remove the need for a separate fragment &#8211; maybe?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sellerdeck Swift is an excellent design template. One drawback is that the number of columns for product summaries is fixed, you can no longer specify it. This means that with four columns across of product summaries if you have a<span class=\"ellipsis\">&hellip;<\/span> <a href=\"https:\/\/www.graphicz.co.uk\/blog\/one-fragment-column-in-swift-section-page\/\"><\/p>\n<div class=\"read-more\"><b>Read more &#8250;<\/b><\/div>\n<p><!-- end of .read-more --><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-543","post","type-post","status-publish","format-standard","hentry","category-graphicz-articles"],"_links":{"self":[{"href":"https:\/\/www.graphicz.co.uk\/blog\/wp-json\/wp\/v2\/posts\/543"}],"collection":[{"href":"https:\/\/www.graphicz.co.uk\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.graphicz.co.uk\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.graphicz.co.uk\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.graphicz.co.uk\/blog\/wp-json\/wp\/v2\/comments?post=543"}],"version-history":[{"count":3,"href":"https:\/\/www.graphicz.co.uk\/blog\/wp-json\/wp\/v2\/posts\/543\/revisions"}],"predecessor-version":[{"id":555,"href":"https:\/\/www.graphicz.co.uk\/blog\/wp-json\/wp\/v2\/posts\/543\/revisions\/555"}],"wp:attachment":[{"href":"https:\/\/www.graphicz.co.uk\/blog\/wp-json\/wp\/v2\/media?parent=543"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.graphicz.co.uk\/blog\/wp-json\/wp\/v2\/categories?post=543"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.graphicz.co.uk\/blog\/wp-json\/wp\/v2\/tags?post=543"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}