Xgenious/ docs
Products
Get support

Example: Blog List Template

themes/mytheme/views/modules/blog/tenant/frontend/blog/blog-all.blade.php

@extends('tenant.frontend.frontend-page-master')

@section('title') {{ __('Blog') }} @endsection
@section('content')

<!-- Page banner -->
<div class="my-banner">
    <a href="{{ theme_home_url() }}">Home</a> / Blog
</div>

<div class="container">
    <div class="row">

        <!-- Posts grid -->
        <div class="col-lg-8">
            @forelse(theme_blogs() as $post)
                <article>
                    @if($post->has_image())
                        <img src="{{ $post->image_url('grid') }}" alt="{{ $post->title() }}">
                    @endif

                    @if($post->category())
                        <a href="{{ $post->category()->url() }}">
                            {{ $post->category()->name() }}
                        </a>
                    @endif

                    <h2><a href="{{ $post->url() }}">{{ $post->title() }}</a></h2>

                    <p>
                        {{ $post->author() }} ·
                        {{ $post->date('M d, Y') }} ·
                        <a href="{{ $post->comment_url() }}">
                            {{ $post->comment_count() }} comments
                        </a>
                    </p>

                    <p>{{ $post->excerpt(25) }}</p>

                    <a href="{{ $post->url() }}">Read More →</a>
                </article>
            @empty
                <p>{{ __('No posts found.') }}</p>
            @endforelse

            <!-- Pagination -->
            @if(theme_blogs_paginator()?->hasPages())
                {{ theme_blogs_paginator()->links() }}
            @endif
        </div>

        <!-- Sidebar -->
        <div class="col-lg-4">

            <!-- Search -->
            <form action="{{ theme_blog_search_url() }}" method="POST">
                {!! theme_csrf_field() !!}
                <input type="text" name="search" placeholder="Search…">
                <button type="submit">Search</button>
            </form>

            <!-- Categories -->
            @foreach(theme_blog_categories() as $cat)
                <a href="{{ $cat->url() }}">{{ $cat->name() }} ({{ $cat->count() }})</a>
            @endforeach

            <!-- Tags -->
            @foreach(theme_blog_tags() as $tag)
                <a href="{{ $tag->url() }}">{{ $tag->name() }}</a>
            @endforeach

        </div>
    </div>
</div>
@endsection

Example: Blog Single Template

themes/mytheme/views/modules/blog/tenant/frontend/blog/blog-single.blade.php

@extends('tenant.frontend.frontend-page-master')
@section('title') {{ theme_post()->title() }} @endsection
@section('content')
@php $post = theme_post(); @endphp

<article>
    @if($post->has_image())
        <img src="{{ $post->image_url('full') }}" alt="{{ $post->title() }}">
    @endif

    <h1>{{ $post->title() }}</h1>

    <p>
        By {{ $post->author() }} ·
        {{ $post->date('F d, Y') }} ·
        {{ theme_comments_count() }} {{ __('Comments') }}
    </p>

    <div class="content">{!! $post->content() !!}</div>

    <!-- Tags -->
    @foreach($post->tags() as $tag)
        <a href="{{ $tag->url() }}">#{{ $tag->name() }}</a>
    @endforeach

    <!-- Share -->
    {!! $post->share_links() !!}
</article>

<!-- Comments -->
<section id="comment-area">
    @foreach(theme_comments() as $comment)
        <div>
            {!! $comment->author_avatar() !!}
            <strong class="title" data-parent_name="{{ $comment->author() }}">
                {{ $comment->author() }}
            </strong>
            <time>{{ $comment->date() }}</time>
            <p>{!! $comment->body() !!}</p>

            @if($comment->can_reply())
                <button class="btn-replay" data-comment_id="{{ $comment->id() }}">
                    Reply
                </button>
            @endif

            <!-- Nested replies -->
            @foreach($comment->replies() as $reply)
                <div class="reply">
                    <strong>{{ $reply->author() }}</strong>
                    <p>{!! $reply->body() !!}</p>
                </div>
            @endforeach
        </div>
    @endforeach
</section>

<!-- Comment form -->
@if(theme_is_logged_in())
    <!-- Comment form here — see full ChefHome example -->
@else
    <a href="{{ theme_login_url() }}">Sign In to comment</a>
@endif
@endsection

Example: Shop Listing Template

themes/mytheme/views/frontend/shop/all-products.blade.php

@extends('tenant.frontend.frontend-page-master')
@section('content')

<div class="container">
    <div class="row">

        <!-- Sidebar -->
        <div class="col-lg-3">
            @foreach(theme_shop_categories() as $cat)
                <a href="{{ $cat->url() }}">
                    {{ $cat->name() }} ({{ $cat->count() }})
                </a>
            @endforeach
        </div>

        <!-- Product grid -->
        <div class="col-lg-9">
            <div class="product-grid">
                @foreach(theme_products() as $product)
                    <div class="product-card">

                        <a href="{{ $product->url() }}">
                            @if($product->has_image())
                                <img src="{{ $product->image_url('grid') }}"
                                     alt="{{ $product->name() }}">
                            @endif
                        </a>

                        <!-- Badge / discount label -->
                        @if($product->is_on_sale())
                            <span class="badge-sale">{{ $product->discount() }}% off</span>
                        @elseif($product->has_campaign())
                            <span class="badge-campaign">{{ $product->campaign_name() }}</span>
                        @elseif($product->has_badge())
                            <span class="badge-label">{{ $product->badge() }}</span>
                        @endif

                        <h3><a href="{{ $product->url() }}">{{ $product->name(8) }}</a></h3>

                        {!! $product->star_rating() !!}

                        <div class="price">
                            {{ $product->price() }}
                            @if($product->regular_price())
                                <del>{{ $product->regular_price() }}</del>
                            @endif
                        </div>

                        <!-- Wishlist -->
                        <button class="wishlist-btn" data-product_id="{{ $product->id() }}">
                            ♡
                        </button>
                    </div>
                @endforeach
            </div>
        </div>
    </div>
</div>

@endsection
@section('scripts')
<script>
$(document).on('click', '.wishlist-btn', function() {
    $.post('{{ theme_add_to_wishlist_url() }}', {
        _token: '{{ theme_csrf() }}',
        product_id: $(this).data('product_id')
    });
});
</script>
@endsection

Example: Product Detail Template

themes/mytheme/views/frontend/shop/product_details/product-details.blade.php

@extends('tenant.frontend.frontend-page-master')
@section('content')
@php $product = theme_product(); @endphp

<div class="container">
    <div class="row">

        <!-- Images -->
        <div class="col-lg-6">
            @if($product->has_image())
                <img id="main-product-img"
                     src="{{ $product->image_url('full') }}"
                     alt="{{ $product->name() }}">
            @endif
            <!-- Gallery thumbnails -->
            @foreach($product->gallery_urls('thumb') as $url)
                <img src="{{ $url }}" class="thumb" onclick="switchImage(this)">
            @endforeach
        </div>

        <!-- Details -->
        <div class="col-lg-6">
            <h1>{{ $product->name() }}</h1>

            {!! $product->star_rating() !!}

            <div id="price"
                 data-main-price="{{ $product->sale_price_raw() }}"
                 data-currency-symbol="{{ theme_static_option('site_currency_symbol') }}">
                <span class="sale-price">{{ $product->price() }}</span>
                @if($product->regular_price())
                    <del>{{ $product->regular_price() }}</del>
                @endif
            </div>

            <div id="stock">
                @if($product->in_stock())
                    <span class="in-stock">In Stock ({{ $product->stock() }})</span>
                @else
                    <span class="out-of-stock">Out of Stock</span>
                @endif
            </div>

            <!-- Cart form — include the core partial which handles variants -->
            @include(include_theme_path('shop.partials.product-partials.product-options'))
        </div>
    </div>

    <!-- Related products -->
    @if(theme_related_products()->isNotEmpty())
    <div class="related">
        <h2>{{ __('Related Products') }}</h2>
        <div class="row">
            @foreach(theme_related_products() as $related)
                <div class="col-md-3">
                    <a href="{{ $related->url() }}">
                        <img src="{{ $related->image_url() }}" alt="{{ $related->name() }}">
                        <p>{{ $related->name(6) }}</p>
                        <p>{{ $related->price() }}</p>
                    </a>
                </div>
            @endforeach
        </div>
    </div>
    @endif
</div>
@endsection

Still stuck?
Our support team is ready to help you get set up.
Get support