2015-10-13 65 views
0

大家好,我是液體標記語言的新手。我正在創建一個電子商務shopify網站,並在頁面上半部分放置了一個完整頁面(右側導航鏈接下方)。它看起來不錯,但唯一的問題是當您單擊另一個頁面時該圖像在該頁面上也是固定的。如何在Shopify(液體標記)中的導航鏈接下的主頁上添加完整頁面圖像?

我只喜歡這個圖片在我的網站的主頁上,有人能幫我解決這個問題嗎?

這裏是鏈接到實際的站點:http://starpro-greens.myshopify.com/

這裏是我爲這個圖象代碼:

HTML(佈局選項卡下theme.liquid配售):

<div class="grid__item large--two-thirds large--display-table-cell   medium-down--hide"> 
      {% include 'site-nav' %} 
     </div> 
     </div> 
    </div> 
    </header> 

     <div class="imagetop"> 
     . 



    <div class="grid__item large--four-fifths bg "> 

      {{ content_for_layout }} 
     </div> 
     </div> 

CSS(放置在theme.scss.liquid資產標籤下):

.imagetop{ 
    background-image: url({{ 'top.png' | asset_url }}); 
    background-repeat: no-repeat; 
    background-position: center center; 
    background-attachment: fixed; 
    -webkit-background-size: cover; 
    -moz-background-size: cover; 
    -o-background-size: cover; 
    background-size: cover; 
    padding: 250px; 
    width: 100%; 
    text-align: center; 
    border-bottom: 1px solid #000; 

回答

0

你可以用,在顯示圖像的代碼中的if語句是這樣的:

{% if template contains 'index' %} 
    Your code to display the image goes here... 
{% endif %} 

this similar question和獲取更多信息備用模板的Shopify docs

+0

完美。謝謝,它工作。 – Every1sasuperhero

相關問題