liquid-layout

Date comparison Logic / in Liquid Filter

◇◆丶佛笑我妖孽 提交于 2021-01-28 05:10:08
问题 I'm trying to add 30 days to a pre-order date and if today's date is later, display a text string and if not display another text string. Any ideas where I'm going wrong? {% assign assign pre_date = 259200 | plus: order.created_at | date: '%s' %} {% assign today_date = 'now' | date: '%s' %} {% if pre_date > today_date %} disply this {% else %} this {% endif %} 回答1: The date filter returns a string, even when you're using %s to get a number of seconds, so Shopify may be running into situations

how to convert this site to a mobile site or make it liquid?

心不动则不痛 提交于 2020-01-07 00:33:29
问题 Im wondering if there is a way to convert static pages to mobiles pages. By mobile-pages I mean to make it possible to drag the desktop content to a smaller window-size (e.g smartphone size: 320px). Make the content to follow the size of the window? how Do I need to change the css? how do I need to make the math? thanks...I suppose there must be frameworks or tools to make this possible? Pls some guides and thoughts will be more than welcome. Check my this static example thanks for yr time! Y

Shopify Sort cart.items array using Liquid script

二次信任 提交于 2019-12-23 01:40:04
问题 I want to sort the cart.items array in the cart.liquid file. And then I can display the times in the table in my expected order. {% for item in cart.items sort_by:item.line_price %} <div class="row"> <div class="span12"> <h1>Your cart</h1> <form action="/cart" method="post" id="cartform"> <table> </table> </form> </div> </div> {% endfor %} But the code doesn't work since I can't use sort_by:item.line_price in for statement. How can I sort an array using built-in features? The other problem is

Date comparison Logic / in Liquid Template Filter

◇◆丶佛笑我妖孽 提交于 2019-12-22 09:42:42
问题 I'm attempting to create a "Pre-Order" Like mechanic where certain elements of my Shopify Liquid Template only show if the current date is more or less than the date specified in a Metafield. As of current this is what I have including logic: <!-- Check Today is correct --> <p>Today: {{'now' | date: '%d-%m-%Y' }}</p> <!-- This is the Metafield Output as a String --> <p>Release Date: {{ product.metafields.Release-Date.preOrder }}</p> <!-- Assign Variable "today_date" to the current date --> {%

How to pass {% captured %} variable from a view to the layout in Jekyll/Liquid?

五迷三道 提交于 2019-12-21 06:59:06
问题 I am trying to rebuild a blog in Jekyll and I have stubled upon a simple task. Provided I have the following set of templates: default.html: {{ head }} {{ content }} frontpage.html: --- layout: default --- {% capture head %} Frontpage {% end %} {{ content }} index.html: --- layout: frontpage --- Other stuff I was expecting that {% capture head %} would pass a variable to layout. But it seems only variables from the Front Matter are actually being passed as page.variable_name . Is there a way

How can I incorporate an image map into a fluid layout?

微笑、不失礼 提交于 2019-12-21 02:35:37
问题 I am currently having a huge headache trying to get a site I'm building to work across variable resolutions. The main navigation is through an image map that needs to fill most of the viewport. I know this is totally outmoded but an image map seems the only non-Flash solution to allow polygonal area delimiting - i'd love an alternative though! I have eventually managed to get the site to resize to allow the main image to display on smaller monitors using conditional jQuery & CSS, but that

Date Math / Manipulation in Liquid Template Filter

北战南征 提交于 2019-12-18 12:49:23
问题 I'm constructing an "Integration URL" in Desk.com, which uses the Shopify Liquid Template filter syntax. This URL needs to contain a "start date" and an "end date" for a query where the start date is 7 days ago and the end date is right now. To achieve this I think I need to subtract 7 days (604800 in Epoch time) from the 'now' object and then apply my formatting but I can't figure out valid syntax for that. For the current time, this syntax is valid and working: {{'now' | date: "%b %d, %Y %I

Div layout with 3 columns: fixed - liquid - fixed

自作多情 提交于 2019-12-12 07:55:57
问题 I'm trying to build a 3 column layout that has one fixed column on the left, a fluid column in the middle and another fixed column on the right. Anyone seen this? There are similar problems here, but not the solution I was looking for. CSS Layout 2-Column fixed-fluid 回答1: http://www.dynamicdrive.com/style/layouts/category/C13/ http://www.dynamicdrive.com/style/layouts/item/css-liquid-layout-31-fixed-fluid-fixed/ Yes? 回答2: Use fixed width and float to the appropriate side on the left and right

HTML/CSS How to wrap an image with another (Liquid Layout)?

99封情书 提交于 2019-12-12 01:00:34
问题 For a portfolio, I need to wrap all images with a computer image for presentation. I'm going to use something like this example to wrap images: Images must have fluid dimensions (height & width in percent), so the wrapper too.. Anyone has an idea about how to achieve that? Is there a way to do it cross-browser way? 回答1: Add the image as a background-image of a reziseable <div> and append a second div with another backgrund image. like: <div class="laptop-bg"> <div class="laptop-content-bg"><

Keep list elements in the same line when resizing. CSS liquid layout

六月ゝ 毕业季﹏ 提交于 2019-12-11 06:23:19
问题 I have this menu I found how to made on a tutorial but I have just one trouble. When I resize the page all the layout changes to fit into the new window size but the menu seems to make new lines when the text doesn't fit on the screen. I want that all the menu remains in one line even if the size of the window is too small to show it all. I have tried lots of hacks I've found here but no one seems to work for me. This is the CSS I'm using. #navcontainer { margin: auto; width: 95%; } #menu {