MODX. Simple snippet. Minishop2

Home » Tutorials » CMS » MODX. Simple snippet. Minishop2
In this lesson we will create simple snippet for output year in the footer and also consider possibility of making e-commerce project on MODX
Snippet is php code fragment, which can be included in chunks or templates.
Making e-commerce project on MODX is not got choice. But there are some decisions. In this lesson we will consider minishop2. With installing minishop2 there will be installed several chunks and templates for e-commerce resources. It is important that you need install pdotools and theme.bootstrap packages to use minishop2

Code lesson (main page template)

[[$header]]
   <main>
        <div class="container">
            <div class="row">
                <div class="col-sm-8 mx-auto">
[[!getResources? &parents=`3` &tpl=`postsTpl`]]
                    <div>
                        <a href="#" id="" class="btn-more float-right">Older posts →</a>
                    </div>
                </div>
            </div>
        </div>
        <hr>
    </main>

[[$footer]]

Code lesson (page template)

[[$header]]
<main id="page-content">
        <div class="container">
            <div class="row">
                <div class="col-sm-8 mx-auto">
[[*content]]
</div>
</div>
</div>
</main>
[[$footer]]

Code lesson (email chunk)

<p>Имя: [[+name]]</p>
<p>Телефон: [[+phone]]</p>
<p>Email: [[+email]]</p>

Code lesson (chunk for post on main page)

<div class="post">
                        <h2><a href="">[[+pagetitle]]</a></h2>
                        <h3>[[+longtitle]]</h3>
                        <p>Posted by <a href="">Start Bootstrap</a> on [[+publishedon:strtotime:date=`%B %e, %Y`]]</p>
                    </div>
                    <hr>

Code lesson (chunk for main menu item)

<li[[+wf.id]][[+wf.classes]]><a href="[[+wf.link]]" title="[[+wf.title]]" class="nav-item" [[+wf.attributes]]>[[+wf.linktext]]</a>[[+wf.wrapper]]</li>

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.

Pin It on Pinterest

Share This