Chi tiết bộ sưu tập

Giới thiệu

Chi tiết bộ sưu tập bao gồm ảnh bộ sưu tập , sản phẩm đính kèm của bộ sưu tập , thông tin bộ sưu tập

Thẻ meta bộ sưu tập

Thẻ Meta là các đoạn văn bản mô tả nội dung của trang, các thẻ này không xuất hiện trên chính trang mà chỉ xuất hiện trong phần mã nguồn của trang. Về cơ bản chúng giúp cho các công cụ tìm kiếm hiểu rõ hơn về nội dung của một trang web, do vậy rất tốt cho SEO.

Dưới đây là cách thức lấy thẻ meta bộ sưu tập của website:

{{ headTitle(album.name).setSeparator(' - ').setAutoEscape(false)|raw }}
<meta name="keywords" content="{{ album.metaKeywords ?: album.name }}">
<meta name="description" content="{{ album.metaDescription ?: album.name }}">
<meta property="og:title" content="{{album.name }}">
<meta property="og:url" content="{{ album.canonicalLink }}">
<meta property="og:image" content="{{ album.imageUri }}">
<meta property="og:type" content="website">
<link rel="canonical" href="{{ album.canonicalLink }}" />

Ảnh đại diện bộ sưu tập

    <img class="lazyload" data-src="{{ album.imageUri }}"
         src="{{loading}}" alt="{{ album.name }}"/>

Tên bộ sưu tập

    <h1>{{ album.name }}</h1>

Thông tin bộ sưu tập

{% set items = fetchAllItemAlbum(album.id) %}
        {% if items is not empty %}
        <div>
            {% for a in items %}
            <div>
                <a href="javascript:void(0)"
                           data-img="{{a.thumbnailUri}}"
                           data-album="{{a.id}}">
                    <img class="lazyload" data-src="{{a.thumbnailUri}}"src="{{loading}}" alt="{{a.name}}>"/>
                </a>
                <div>
                    {% set itemsTags = getAlbumTag(a.id) %}
                    {% if itemsTags is not empty %}
                         {% for it in itemsTags %}
                            {% if it.product is not empty %}
                               {% set p = it.product %}
                                <h4><a href="{{p.viewlink}}">{{p.name}}</a></h4>
                                    <div class="product_price_album">
                                        {% if (p.priceAfterDiscount > 0) %}
                                            <s class="price_old">{{ p.price|number_format(0) }} ₫</s>
                                            <span class="price">{{ p.priceAfterDiscount|number_format(0) }} ₫</span>
                                        {% elseif (p.oldprice > 0) %}
                                            <s class="price_old">{{ p.oldprice|number_format(0) }} ₫</s>
                                            <span class="price">{{ p.priceAfterDiscount|number_format(0) }} ₫</span>
                                        {% elseif (p.price == 0) %}
                                           <span>{{translate('Liên hệ')}}</span>
                                        {% else %}
                                            <span class="price"> {{ p.price|number_format(0) }} ₫</span>
                                        {% endif %}             
                                    </div>
                                    <p>{{a.description | raw }}</p>
                            {% endif %}
                         {% endfor %}
                    {% endif %}
                </div>
            </div>
            {% endfor %}
        </div>
    {% endif %}

Last updated