views/ directory contains all Twig templates that define the theme’s structure and markup. Templates are organized into three categories: reusable components, master layouts, and page templates.
Directory structure
All templates use the Twig templating engine, which provides powerful features like template inheritance, includes, and filters.
Layouts
Layout templates define the overall page structure and are extended by page templates.master.twig
Location:src/views/layouts/master.twig
The main layout template used by all public-facing pages.
Features:
- HTML document structure
- Header and footer inclusion
- Meta tags and SEO elements
- Asset loading (CSS, JavaScript)
- Content block definitions
- RTL/LTR language support
- Analytics and tracking scripts
customer.twig
Location:src/views/layouts/customer.twig
Specialized layout for customer dashboard pages.
Features:
- Customer navigation sidebar
- Account menu
- User profile information
- Dashboard-specific styling
Components
Reusable UI components used across multiple pages.Header component
Location:src/views/components/header/header.twig
Features:
- Site logo and branding
- Main navigation menu
- Search functionality
- Shopping cart icon with count
- User account menu
- Mobile menu toggle
- Language/currency switchers
master.twig
Footer component
Location:src/views/components/footer/footer.twig
Features:
- Footer navigation links
- Newsletter subscription form
- Social media links
- Payment method icons
- Copyright and legal links
- Contact information
master.twig
Home components
Thecomponents/home/ directory contains 21 specialized block components for building custom homepages.
Product display blocks
Product display blocks
Featured products:
featured-products-style1.twig- Grid layout with hover effectsfeatured-products-style2.twig- Card-based layoutfeatured-products-style3.twig- Compact list viewlatest-products.twig- Recent additionsfixed-products.twig- Pinned/highlighted products
products-slider.twig- Horizontal scrolling productsslider-products-with-header.twig- Slider with title section
src/views/components/home/Banner and media blocks
Banner and media blocks
Feature and information blocks
Feature and information blocks
store-features.twig- Store benefits (free shipping, returns, etc.)main-links.twig- Quick navigation linksbrands.twig- Brand logo carouseltestimonials.twig- Customer reviews slidercustom-testimonials.twig- Custom testimonial layout
src/views/components/home/Pages
Page templates define the content structure for each page type.Homepage
Location:src/views/pages/index.twig
The main landing page that includes various home components based on theme settings.
Structure:
Shopping cart
Location:src/views/pages/cart.twig
Features:
- Cart items list with thumbnails
- Quantity adjustment controls
- Remove item functionality
- Coupon code input
- Cart totals and summary
- Checkout button
- Empty cart state
- Suggested products
Product pages
Product listing
Product listing
Location:
src/views/pages/product/index.twigFeatures:- Product grid/list view toggle
- Filtering sidebar
- Sorting options
- Pagination
- Breadcrumbs
- Active filters display
- No results state
Single product
Single product
Location:
src/views/pages/product/single.twigFeatures:- Product image gallery with zoom
- Product title and SKU
- Price display with discounts
- Product options (color, size, etc.)
- Quantity selector
- Add to cart button
- Add to wishlist button
- Product tabs (description, specifications, reviews)
- Related products
- Social sharing buttons
- Stock availability indicator
- Shipping information
Product partials
Reusable sections for product pages: Location:src/views/pages/partials/product/
Blog pages
Location:src/views/pages/blog/
Blog index
Blog index
File:
index.twigFeatures:- Blog post grid
- Post thumbnails
- Excerpt text
- Read more links
- Pagination
- Categories filter
Single blog post
Single blog post
File:
single.twigFeatures:- Post title and metadata
- Featured image
- Full content
- Author information
- Share buttons
- Related posts
- Comments section
Brand pages
Location:src/views/pages/brands/
Brand listing
Brand listing
File:
index.twigGrid display of all brands with logos and links.Single brand
Single brand
File:
single.twigBrand information and product listing for specific brand.Customer pages
Account management pages in the customer dashboard. Location:src/views/pages/customer/
Profile management
Profile management
File:
profile.twigFeatures:- Personal information form
- Email and mobile number
- Password change
- Profile picture upload
- Shipping addresses management
- Default address selection
Order history
Order history
Location:
customer/orders/Files:index.twig- Order list with statussingle.twig- Order details and tracking
- Order number and date
- Order status badge
- Product list
- Shipping information
- Payment details
- Invoice download
- Order tracking
- Review products
Notifications
Notifications
File:
notifications.twigUser notification center showing:- Order updates
- Promotional messages
- System notifications
- Mark as read functionality
Wishlist
Wishlist
File:
wishlist.twigFeatures:- Saved product grid
- Quick add to cart
- Remove from wishlist
- Empty state message
Wallet
Wallet
File:
wallet.twigFeatures:- Wallet balance display
- Transaction history
- Add funds functionality
Other pages
Landing page builder
Landing page builder
File:
landing-page.twigLocation: src/views/pages/landing-page.twigCustom landing page template with flexible block system.Loyalty program
Loyalty program
File:
loyalty.twigLocation: src/views/pages/loyalty.twigFeatures:- Points balance
- Tier status
- Rewards catalog
- Points history
- Redemption options
Testimonials
Testimonials
File:
testimonials.twigLocation: src/views/pages/testimonials.twigStandalone page for customer reviews and testimonials.Thank you page
Thank you page
File:
thank-you.twigLocation: src/views/pages/thank-you.twigFeatures:- Order confirmation message
- Order number
- Next steps information
- Continue shopping button
- Order summary
Static page
Static page
File:
page-single.twigLocation: src/views/pages/page-single.twigTemplate for static content pages (About, Terms, Privacy, etc.).Template inheritance
Theme Raed uses Twig’s template inheritance for maintainable code:Including components
Components can be included and passed data:Twig filters and functions
Theme Raed provides custom Twig extensions:Best practices
Keep templates focused: Each template should have a single responsibility. Use includes for reusable sections.
Use semantic HTML: Structure templates with proper HTML5 elements for accessibility and SEO.
Leverage template inheritance: Extend layouts rather than duplicating code across templates.
Pass explicit data: When including components, pass required data explicitly for clarity.
Next steps
Assets folder
Explore JavaScript and SCSS organization
Locales
Learn about translation system