Search icon CANCEL
Subscription
0
Cart icon
Cart
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Magento Extensions Development

You're reading from  Magento Extensions Development

Product type Book
Published in Jun 2016
Publisher Packt
ISBN-13 9781783286775
Pages 240 pages
Edition 1st Edition
Languages
Concepts
Author (1):
Jérémie Bouchet Jérémie Bouchet
Author Profile Icon Jérémie Bouchet
Jérémie Bouchet
Toc

Designing the TicketBlaster module's frontend


Ok, now we can create events, except that we cannot show them to our customers!

We will see that the layout can be prepared and packaged in the extension in order to provide the best integration for customers.

Declaring the layouts

The following steps show how to declare layouts:

  1. Create the [extension_path]/view/frontend/layout/events_index_index.xml file and add the following code:

    <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd">
    <body>
    <referenceContainer name="content">
    <block class="Blackbird\TicketBlaster\Block\EventList" name="event.list" template="Blackbird_TicketBlaster::list.phtml" />
    </referenceContainer>
    </body>
    </page>

    Note

    This layout file adds the block to list our events in the main container of the page.

  2. Create the [extension_path]/view/frontend/layout/events_view_index...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime