### Install Webasyst Framework Source: https://github.com/pro-wow/webasyst-api-docs/blob/main/README.md Provides the basic steps to clone the Webasyst framework repository, set file permissions, and initiate the web installer. This is the initial setup for a new Webasyst project. ```bash # Clone the framework git clone https://github.com/webasyst/webasyst-framework.git # Set permissions chmod 0775 /path/to/webasyst # Run web installer # Navigate to http://your-domain/webasyst/ in browser ``` -------------------------------- ### Webasyst Theme Development Environment Setup Source: https://github.com/pro-wow/webasyst-api-docs/blob/main/WEBASYST_THEME_DEVELOPMENT_GUIDE.md Guides on setting up a local development environment for Webasyst themes. This includes cloning the framework, creating a theme directory, and initializing the basic file structure required for theme development. ```bash # Development environment setup mkdir webasyst-theme-dev cd webasyst-theme-dev # Clone Webasyst framework git clone https://github.com/webasyst/webasyst-framework.git . # Set up development theme mkdir -p wa-content/themes/dev-theme cd wa-content/themes/dev-theme # Initialize theme structure mkdir -p {css,js,img,templates/{layouts,actions,includes,blocks},locale} # Create basic files touch theme.xml css/base.css js/theme.js templates/layouts/Default.html ``` -------------------------------- ### Webasyst Identify Template to Override Example Source: https://github.com/pro-wow/webasyst-api-docs/blob/main/WEBASYST_THEME_DEVELOPMENT_GUIDE.md Provides an example command to locate the original template file within the Webasyst application structure, which is the first step in overriding a core template. ```bash # Original template location wa-apps/site/templates/actions/frontend/Page.html ``` -------------------------------- ### Webasyst Theme Documentation Markdown Template Source: https://github.com/pro-wow/webasyst-api-docs/blob/main/WEBASYST_THEME_DEVELOPMENT_GUIDE.md This Markdown template outlines the structure for documenting a Webasyst theme, covering overview, features, installation, configuration, file structure, browser support, and changelog. It serves as a guide for theme developers to create comprehensive documentation. ```markdown # Theme Name ## Overview Brief description of the theme, its purpose, and target audience. ## Features - Feature 1 - Feature 2 - Feature 3 ## Installation ### Requirements - Webasyst Framework 3.7+ - PHP 7.4+ - Modern browser support ### Setup 1. Copy theme files to `wa-content/themes/theme-name/` 2. Activate theme in Site app settings 3. Configure theme settings ## Configuration ### Theme Settings - `header_color`: Header background color (default: #ffffff) - `show_sidebar`: Display sidebar (default: true) - `logo_url`: Custom logo URL ### Customization Instructions for common customizations... ## File Structure ``` theme-name/ ├── theme.xml ├── css/ ├── js/ ├── templates/ └── img/ ``` ## Browser Support - Chrome 90+ - Firefox 88+ - Safari 14+ - Edge 90+ ## Changelog See CHANGELOG.md for version history. ``` -------------------------------- ### Webasyst App Configuration Example Source: https://github.com/pro-wow/webasyst-api-docs/blob/main/WEBASYST_API_DOCUMENTATION.md Example of an `app.php` configuration file for a Webasyst application, defining its name, version, and features. ```PHP 'My App', 'description' => 'My custom application', 'version' => '1.0.0', 'vendor' => 'My Company', 'frontend' => true, 'backend' => true, 'icon' => array( 48 => 'img/icon48.png' ) ); ``` -------------------------------- ### Webasyst Default Layout Template Source: https://github.com/pro-wow/webasyst-api-docs/blob/main/WEBASYST_THEME_DEVELOPMENT_GUIDE.md An example of a default layout template (`Default.html`) using Smarty syntax for Webasyst themes, demonstrating structure, CSS/JS inclusion, and theme settings integration. ```html {$wa_title} {wa_css theme="css/base.css"} {if $wa->isMobile()} {wa_css theme="css/mobile.css"} {/if} {$wa->headJs()} {$wa->headCss()} {include file="theme:includes/header.html"}
{$content}
{if $theme_settings.show_sidebar} {include file="theme:includes/sidebar.html"} {/if} {include file="theme:includes/footer.html"} {wa_js theme="js/theme.js"} {$wa->js()} ``` -------------------------------- ### Webasyst App Structure Example Source: https://github.com/pro-wow/webasyst-api-docs/blob/main/WEBASYST_API_DOCUMENTATION.md Illustrates a typical directory structure for a Webasyst application, including configuration, controllers, and templates. ```APIDOC App Structure: ``` myapp/ lib/ config/ app.php # App configuration install.php # Installation script myappConfig.class.php actions/ backend/ BackendIndex.action.php frontend/ Index.action.php templates/ actions/ backend/ BackendIndex.html Index.html ``` ``` -------------------------------- ### Webasyst Frontend Controller Example Source: https://github.com/pro-wow/webasyst-api-docs/blob/main/WEBASYST_API_DOCUMENTATION.md Example of a frontend controller (`Index.action.php`) for a Webasyst application, demonstrating how to fetch data and assign it to the view. ```PHP getAll(); $this->view->assign('items', $items); $this->setTitle('My App'); } } ``` -------------------------------- ### Responsive Images with Lazy Loading and WebP Support Source: https://github.com/pro-wow/webasyst-api-docs/blob/main/WEBASYST_THEME_DEVELOPMENT_GUIDE.md This example showcases responsive images using `srcset` and `sizes` attributes for different viewport widths, combined with `loading="lazy"` for deferred loading. It also includes a `` element to serve WebP images with a JPEG fallback for broader browser compatibility. ```html {* Responsive images with lazy loading *} {$image.alt|escape} {* WebP support with fallback *} {$image.alt|escape} ``` -------------------------------- ### Webasyst Theme PHP Class Example Source: https://github.com/pro-wow/webasyst-api-docs/blob/main/WEBASYST_THEME_DEVELOPMENT_GUIDE.md Demonstrates a typical PHP class for a Webasyst theme, including initialization methods to add CSS/JS assets and custom methods for retrieving theme settings. It also shows how to assign variables to the view. ```PHP addCss('css/base.css'); $this->addJs('js/theme.js'); } /** * Custom theme method */ public function getThemeSettings() { return array( 'header_color' => $this->settings['header_color'], 'show_sidebar' => $this->settings['show_sidebar'], 'logo_url' => $this->settings['logo_url'] ); } /** * Process theme variables */ public function assignVars($view) { $view->assign('theme_settings', $this->getThemeSettings()); $view->assign('current_year', date('Y')); } } ``` -------------------------------- ### Webasyst Framework System Requirements Source: https://github.com/pro-wow/webasyst-api-docs/blob/main/WEBASYST_THEME_DEVELOPMENT_GUIDE.md Lists the essential system requirements for running the Webasyst framework, including web server, PHP version, required PHP extensions, and database. ```bash # System Requirements - Web Server: Apache, nginx, or IIS - PHP: 7.4+ - PHP Extensions: spl, mbstring, iconv, json, gd/ImageMagick - Database: MySQL 4.1+ ``` -------------------------------- ### Shop-Script Product Template Functions (Smarty) Source: https://github.com/pro-wow/webasyst-api-docs/blob/main/WEBASYST_THEME_DEVELOPMENT_GUIDE.md Provides examples of Smarty template functions for interacting with product data. These functions help generate product URLs, display product images with specified sizes and alt text, format prices, and iterate through product features. ```smarty {* Product URL generation *} {$product.name|escape} {* Product image display *} {shopProductImage product=$product size="300x300" alt=$product.name class="product-img"} {* Product price formatting *} {shopPrice price=$product.price currency=$currency} {* Product features *} {if $product.features} {/if} ``` -------------------------------- ### Webasyst Plugin Structure Example Source: https://github.com/pro-wow/webasyst-api-docs/blob/main/WEBASYST_API_DOCUMENTATION.md Demonstrates the basic structure of a Webasyst plugin class, including initialization, accessing settings, and defining backend menu items. It extends the base `waPlugin` class. ```php class myappMypluginPlugin extends waPlugin { public function init() { // Plugin initialization } public function getSettings($name = null) { return parent::getSettings($name); } public function backendMenu() { // Add backend menu items return array( array( 'name' => 'My Plugin', 'url' => '?plugin=myplugin' ) ); } } ``` -------------------------------- ### Webasyst Backend Controller Example Source: https://github.com/pro-wow/webasyst-api-docs/blob/main/WEBASYST_API_DOCUMENTATION.md Example of a backend controller (`BackendIndex.action.php`) for a Webasyst application, including user rights checking and data assignment. ```PHP getUser()->getRights('myapp', 'backend')) { throw new waRightsException('Access denied'); } $model = new myappItemModel(); $items = $model->getAll(); $this->view->assign(array( 'items' => $items, 'can_edit' => wa()->getUser()->getRights('myapp', 'edit') )); } } ``` -------------------------------- ### Desktop Responsive Styles (min-width: 1024px) Source: https://github.com/pro-wow/webasyst-api-docs/blob/main/WEBASYST_THEME_DEVELOPMENT_GUIDE.md Applies styles for desktop viewports starting from 1024px. Includes container width adjustments, a 12-column grid system, and larger font sizes for headings. ```css /* Desktop styles */ @media (min-width: 1024px) { .container { max-width: 980px; } /* Grid system for desktop */ .col-lg-12 { width: 100%; } .col-lg-11 { width: 91.66667%; } .col-lg-10 { width: 83.33333%; } .col-lg-9 { width: 75%; } .col-lg-8 { width: 66.66667%; } .col-lg-7 { width: 58.33333%; } .col-lg-6 { width: 50%; } .col-lg-5 { width: 41.66667%; } .col-lg-4 { width: 33.33333%; } .col-lg-3 { width: 25%; } .col-lg-2 { width: 16.66667%; } .col-lg-1 { width: 8.33333%; } /* Larger font sizes for desktop */ h1 { font-size: 2.5rem; } h2 { font-size: 2rem; } h3 { font-size: 1.75rem; } } ``` -------------------------------- ### Webasyst Smarty Date and Time Formatting Source: https://github.com/pro-wow/webasyst-api-docs/blob/main/WEBASYST_THEME_DEVELOPMENT_GUIDE.md Shows how to format dates and times using Webasyst's `wa_date` and `wa_date_relative` functions. Includes examples for standard and custom formats, relative time display, and timezone handling. ```smarty {* Basic date formatting *} {* Custom date formats *} {$item.date|wa_date:'%B %d, %Y'} {* January 15, 2024 *} {$item.date|wa_date:'%d.%m.%Y'} {* 15.01.2024 *} {$item.date|wa_date:'%Y-%m-%d %H:%M:%S'} {* 2024-01-15 14:30:00 *} {* Relative time *} {$item.date|wa_date_relative} {* Timezone handling *} {$item.date|wa_date:null:$user_timezone} ``` -------------------------------- ### Create CSS Files Source: https://github.com/pro-wow/webasyst-api-docs/blob/main/WEBASYST_THEME_DEVELOPMENT_GUIDE.md Creates three CSS files (layout.css, components.css, utilities.css) within a specified theme directory using the touch command. ```shell touch wa-content/themes/mytheme/css/{layout,components,utilities}.css ``` -------------------------------- ### Webasyst Navigation Menu (HTML/Smarty) Source: https://github.com/pro-wow/webasyst-api-docs/blob/main/WEBASYST_THEME_DEVELOPMENT_GUIDE.md This snippet generates a main navigation menu for a Webasyst site. It dynamically lists pages from the 'site' app, marks the current page as active, and includes conditional links for 'blog' and 'shop' apps if they are installed. It uses Smarty templating for loops, conditionals, and Webasyst helpers like `wa_url` and `wa->currentAction()`. ```html {* Main navigation menu *} {* Mobile menu toggle *} ``` -------------------------------- ### Step-by-Step Audit Process: Repository Structure Analysis Source: https://github.com/pro-wow/webasyst-api-docs/blob/main/WEBASYST_THEME_DEVELOPMENT_GUIDE.md Illustrates bash commands used to clone the Webasyst framework repository and navigate to the site themes directory for analysis. It includes a command to list available themes. ```bash # Clone and examine the repository git clone https://github.com/webasyst/webasyst-framework.git cd webasyst-framework/wa-apps/site/themes # List available themes ls -la ``` -------------------------------- ### Accessibility HTML Template Example Source: https://github.com/pro-wow/webasyst-api-docs/blob/main/WEBASYST_THEME_DEVELOPMENT_GUIDE.md This HTML snippet demonstrates best practices for web accessibility, including ARIA attributes for navigation, form elements, and skip links. It uses a templating language common in frameworks like Webasyst for dynamic content and internationalization. ```html {* Accessibility-focused template example *} {* Form with proper labels and error handling *}
{* Skip navigation for screen readers *} ``` -------------------------------- ### PHP Plugin Class Example Source: https://github.com/pro-wow/webasyst-api-docs/blob/main/WEBASYST_API_DOCUMENTATION.md Demonstrates a basic Webasyst plugin class. It includes methods for handling order completion events and defining backend menu items, showcasing how to access settings and trigger internal methods. ```php sendNotification($order_id); return array('status' => 'notification_sent'); } private function sendNotification($order_id) { $settings = $this->getSettings(); if ($settings['notifications_enabled']) { // Send email logic here } } public function backendMenu() { return array( 'name' => 'My Plugin', 'url' => wa()->getAppUrl('myapp') . '?plugin=myplugin', 'icon' => 'icon.png' ); } } ``` -------------------------------- ### Webasyst Theme Configuration (theme.xml) Source: https://github.com/pro-wow/webasyst-api-docs/blob/main/WEBASYST_THEME_DEVELOPMENT_GUIDE.md Defines the structure and content of the `theme.xml` file, which specifies theme metadata, settings, and required files for Webasyst. ```xml My Custom Theme A custom theme for Webasyst Your Name Your Company 1.0.0 1 ``` -------------------------------- ### Directory Structure for Multi-App Support Source: https://github.com/pro-wow/webasyst-api-docs/blob/main/WEBASYST_THEME_DEVELOPMENT_GUIDE.md Describes the theme's directory structure, showing its compatibility across various Webasyst apps like Shop-Script, Site, Blog, etc. This structure ensures consistent theming. ```text hypermarket-theme/ ├── shop/themes/hypermarket/ # Shop-Script theme ├── site/themes/hypermarket/ # Site app theme ├── blog/themes/hypermarket/ # Blog app theme ├── photos/themes/hypermarket/ # Photos app theme ├── helpdesk/themes/hypermarket/ # Helpdesk app theme ├── hub/themes/hypermarket/ # Hub app theme └── mailer/themes/hypermarket/ # Mailer app theme ``` -------------------------------- ### SEO Optimized Product Template Source: https://github.com/pro-wow/webasyst-api-docs/blob/main/WEBASYST_THEME_DEVELOPMENT_GUIDE.md A product template using semantic HTML and schema.org markup for improved SEO. It displays product name, price, availability, and description, along with images. ```smarty {* SEO optimized product template *}

{$product.name|escape}

{shopPrice price=$product.price}
{$product.description}
{if $product.images} {foreach $product.images as $image} {$product.name|escape} {/foreach} {/if}
``` -------------------------------- ### Webasyst Smarty Template Syntax Guide Source: https://github.com/pro-wow/webasyst-api-docs/blob/main/WEBASYST_THEME_DEVELOPMENT_GUIDE.md Provides a comprehensive overview of common Smarty template syntax, including variable output, conditional statements (if/elseif/else), loops (foreach), template includes, and built-in template functions for URL generation and date formatting. ```Smarty {* Variables *} {$variable_name} {$array.key} {$object->property} {* Conditions *} {if $condition} Content if true {elseif $other_condition} Content if other condition true {else} Content if false {/if} {* Loops *} {foreach $items as $item}
{$item.name}
{/foreach} {* Includes *} {include file="theme:includes/component.html"} {include file="theme:blocks/login.html" assign_var="value"} {* Template functions *} {wa_url action="page" id=$page.id} {wa_date date=$item.datetime} {_w}Localized text{/_w} ``` -------------------------------- ### Webasyst Theme Directory Structure Source: https://github.com/pro-wow/webasyst-api-docs/blob/main/WEBASYST_THEME_DEVELOPMENT_GUIDE.md Illustrates the standard directory layout for a Webasyst theme, detailing the purpose of key directories like `css`, `js`, `templates`, and `locale`. ```bash themes/ └── your_theme_name/ ├── theme.xml # Theme configuration ├── theme.php # Theme PHP class (optional) ├── css/ # Stylesheets │ ├── base.css │ ├── mobile.css │ └── print.css ├── js/ # JavaScript files │ └── theme.js ├── img/ # Theme images │ ├── icons/ │ └── backgrounds/ ├── templates/ # Smarty templates │ ├── layouts/ # Page layouts │ │ ├── Default.html │ │ └── Homepage.html │ ├── actions/ # Action templates │ │ ├── frontend/ │ │ └── page/ │ ├── includes/ # Reusable components │ │ ├── header.html │ │ ├── footer.html │ │ └── navigation.html │ └── blocks/ # Block templates │ ├── login.html │ └── sidebar.html └── locale/ # Translations ├── en_US/ └── ru_RU/ ``` -------------------------------- ### Shop-Script Product Display Template Source: https://github.com/pro-wow/webasyst-api-docs/blob/main/WEBASYST_THEME_DEVELOPMENT_GUIDE.md This template defines how individual products are displayed in the Shop-Script app. It handles product images, pricing, descriptions, and includes a form for selecting variants and adding to the cart. ```html {* shop/themes/hypermarket/templates/Product.html *}

{$product.name|escape}

{if $product.compare_price > $product.price} {shopPrice currency=$currency price=$product.compare_price} {/if} {shopPrice currency=$currency price=$product.price}
{$product.summary}
{* Add to cart form *}
{if $product.skus|count > 1}
{foreach $product.features as $feature}
{/foreach}
{/if}
``` -------------------------------- ### Cross-Browser Testing Checklist Source: https://github.com/pro-wow/webasyst-api-docs/blob/main/WEBASYST_THEME_DEVELOPMENT_GUIDE.md A markdown checklist for ensuring cross-browser compatibility. It lists common desktop and mobile browsers, including specific versions, that should be tested to guarantee consistent user experience across different platforms and devices. ```markdown ## Browser Compatibility Testing ### Desktop Browsers - [ ] Chrome (latest 2 versions) - [ ] Firefox (latest 2 versions) - [ ] Safari (latest 2 versions) - [ ] Edge (latest 2 versions) - [ ] Internet Explorer 11 (if required) ### Mobile Browsers - [ ] Chrome Mobile (Android) - [ ] Safari Mobile (iOS) - [ ] Samsung Internet - [ ] Firefox Mobile ``` -------------------------------- ### Base Styles (Mobile) - CSS Source: https://github.com/pro-wow/webasyst-api-docs/blob/main/WEBASYST_THEME_DEVELOPMENT_GUIDE.md Defines the foundational CSS variables, resets, typography, and a mobile-first grid system. This section sets up the core styling and layout for small screens, ensuring a consistent base for all elements. ```css /* css/base.css - Mobile-first base styles */ /* CSS Variables for theming */ :root { --primary-color: #007bff; --secondary-color: #6c757d; --success-color: #28a745; --danger-color: #dc3545; --warning-color: #ffc107; --info-color: #17a2b8; --font-family-base: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; --font-size-base: 16px; --line-height-base: 1.6; --spacing-xs: 0.25rem; --spacing-sm: 0.5rem; --spacing-md: 1rem; --spacing-lg: 1.5rem; --spacing-xl: 3rem; --border-radius: 4px; --box-shadow: 0 2px 4px rgba(0,0,0,0.1); } /* Reset and base styles */ *, *::before, *::after { box-sizing: border-box; } body { font-family: var(--font-family-base); font-size: var(--font-size-base); line-height: var(--line-height-base); margin: 0; padding: 0; color: #333; background-color: #fff; } /* Typography */ h1, h2, h3, h4, h5, h6 { margin-top: 0; margin-bottom: var(--spacing-md); line-height: 1.2; font-weight: 600; } h1 { font-size: 2rem; } h2 { font-size: 1.75rem; } h3 { font-size: 1.5rem; } h4 { font-size: 1.25rem; } h5 { font-size: 1.125rem; } h6 { font-size: 1rem; } /* Layout containers */ .container { width: 100%; padding: 0 var(--spacing-md); margin: 0 auto; } .row { display: flex; flex-wrap: wrap; margin: 0 calc(-1 * var(--spacing-md)); } .col { flex: 1; padding: 0 var(--spacing-md); min-width: 0; } /* Grid system */ .col-12 { width: 100%; } .col-11 { width: 91.66667%; } .col-10 { width: 83.33333%; } .col-9 { width: 75%; } .col-8 { width: 66.66667%; } .col-7 { width: 58.33333%; } .col-6 { width: 50%; } .col-5 { width: 41.66667%; } .col-4 { width: 33.33333%; } .col-3 { width: 25%; } .col-2 { width: 16.66667%; } .col-1 { width: 8.33333%; } ``` -------------------------------- ### Product Card Component Source: https://github.com/pro-wow/webasyst-api-docs/blob/main/WEBASYST_THEME_DEVELOPMENT_GUIDE.md Displays product information in a card layout, commonly used on category pages, search results, and the homepage. It requires a `$product` array and supports optional variables like `$show_description` and `$image_size` for customization. ```smarty {* * Product card component * * Displays product information in a card layout * Used in: category pages, search results, homepage * * Required variables: * - $product (array): Product data from shopProductModel * * Optional variables: * - $show_description (bool): Show product description (default: false) * - $image_size (string): Image size variant (default: 'crop') *}
{* Product image *}
{if $product.images} {$product.name|escape} {/if}
{* Product information *}

{$product.name|escape}

{* Optional description *} {if $show_description && $product.summary}
{$product.summary|truncate:100}
{/if} {* Price *}
{shopPrice price=$product.price}
``` -------------------------------- ### Webasyst Theme Version Control Strategy Source: https://github.com/pro-wow/webasyst-api-docs/blob/main/WEBASYST_THEME_DEVELOPMENT_GUIDE.md Details on implementing version control for Webasyst themes using Git. Covers initializing a repository, creating a `.gitignore` file to exclude unnecessary files, making an initial commit, and setting up a development branch. ```bash # Initialize git repository for theme cd wa-content/themes/your-theme git init # Create .gitignore echo "*.log *.tmp .DS_Store Thumbs.db node_modules/ .sass-cache/" > .gitignore # Initial commit git add . git commit -m "Initial theme structure" # Create development branch git checkout -b develop ``` -------------------------------- ### Large Desktop Responsive Styles (min-width: 1200px) Source: https://github.com/pro-wow/webasyst-api-docs/blob/main/WEBASYST_THEME_DEVELOPMENT_GUIDE.md Applies styles for larger desktop viewports starting from 1200px. Adjusts container width and provides an additional grid system for extra-large screens. ```css /* Large desktop styles */ @media (min-width: 1200px) { .container { max-width: 1170px; } /* Grid system for large desktop */ .col-xl-12 { width: 100%; } .col-xl-11 { width: 91.66667%; } .col-xl-10 { width: 83.33333%; } .col-xl-9 { width: 75%; } .col-xl-8 { width: 66.66667%; } .col-xl-7 { width: 58.33333%; } .col-xl-6 { width: 50%; } .col-xl-5 { width: 41.66667%; } .col-xl-4 { width: 33.33333%; } .col-xl-3 { width: 25%; } .col-xl-2 { width: 16.66667%; } .col-xl-1 { width: 8.33333%; } } ``` -------------------------------- ### Webasyst REST API Authentication and Endpoints Source: https://github.com/pro-wow/webasyst-api-docs/blob/main/WEBASYST_API_DOCUMENTATION.md Documentation for Webasyst REST API, detailing token-based authentication methods (GET and POST with Authorization header) and providing an example of a common endpoint for retrieving contact lists with parameters and response structure. ```apidoc REST API: __description__: Webasyst provides RESTful API endpoints for accessing application data. __authentication__: Token-based authentication: - GET /api.php/app/method?access_token=TOKEN - POST /api.php/app/method - Authorization: Bearer TOKEN __common_endpoints__: GET /api.php/contacts/: __description__: Gets contacts list. __parameters__: - limit (int): Number of records - offset (int): Records offset - fields (string): Comma-separated field list __response__: | { "data": [ { "id": 1, "name": "John Doe", "email": "john@example.com" } ], "total": 100 } ``` -------------------------------- ### Basic HTML Structure with Webasyst Placeholders Source: https://github.com/pro-wow/webasyst-api-docs/blob/main/WEBASYST_THEME_DEVELOPMENT_GUIDE.md A standard HTML5 document structure including meta tags, title, viewport settings, progressive enhancement script, preloaded fonts, theme CSS includes, responsive stylesheets, and placeholders for content and JavaScript. ```html {$wa_title} {* Progressive enhancement *} {* Preload critical resources *} {* Theme CSS *} {wa_css theme="css/base.css"} {wa_css theme="css/layout.css"} {wa_css theme="css/components.css"} {* Responsive CSS *} {* Skip navigation for accessibility *} {* Header *} {if $theme_settings.show_header} {include file="theme:includes/header.html"} {/if} {* Main content *}
{$content}
{* Footer *} {if $theme_settings.show_footer} {include file="theme:includes/footer.html"} {/if} {* JavaScript *} {wa_js theme="js/theme.js"} ``` -------------------------------- ### Custom Page Template Override with Smarty Source: https://github.com/pro-wow/webasyst-api-docs/blob/main/WEBASYST_THEME_DEVELOPMENT_GUIDE.md An example of a custom HTML template using Smarty syntax for overriding a default page template. It includes custom headers, displays page title and date, and embeds original content and social share blocks. ```html {* Custom page template override *}
{* Add custom header *}

{$page.title|escape}

Published: {$page.create_datetime|wa_date}
{* Original content with modifications *}
{$page.content}
{* Add custom footer *}
``` -------------------------------- ### waRequest Get GET Parameter Source: https://github.com/pro-wow/webasyst-api-docs/blob/main/WEBASYST_API_DOCUMENTATION.md Explains how to retrieve parameters passed via the HTTP GET method, with options for default values and type casting. ```APIDOC waRequest::get($name = null, $default = null, $type = null) - Gets GET parameter value. - Parameters: $name (string): Parameter name $default (mixed): Default value $type (string): Type casting ('int', 'string', 'array') - Returns: mixed - Parameter value - Example: $request = waRequest::getInstance(); $page = $request->get('page', 1, 'int'); $search = $request->get('q', '', 'string'); ``` -------------------------------- ### Shop-Script Architecture Overview Source: https://github.com/pro-wow/webasyst-api-docs/blob/main/SHOP_SCRIPT_HYPERMARKET_API.md Illustrates the directory structure of the Shop-Script application, highlighting key directories for models, configuration, classes, plugins, themes, and templates. ```text shop/ lib/ model/ # Data models config/ # Configuration classes/ # Core classes plugins/ # Payment/shipping plugins themes/ # Design themes templates/ # Backend templates ``` -------------------------------- ### waRequest Get REQUEST Parameter Source: https://github.com/pro-wow/webasyst-api-docs/blob/main/WEBASYST_API_DOCUMENTATION.md Shows how to retrieve parameters from the REQUEST superglobal, which includes both GET and POST data. ```APIDOC waRequest::request($name = null, $default = null, $type = null) - Gets REQUEST parameter value (GET or POST). - Parameters: $name (string): Parameter name $default (mixed): Default value $type (string): Type casting ('int', 'string', 'array') - Example: $request = waRequest::getInstance(); $user_id = $request->request('user_id', 0, 'int'); ``` -------------------------------- ### waSystem Get Current Application ID Source: https://github.com/pro-wow/webasyst-api-docs/blob/main/WEBASYST_API_DOCUMENTATION.md Shows how to get the ID of the currently active application within the Webasyst framework. ```APIDOC waSystem::getApp() - Gets the current application ID. - Syntax: public function getApp() - Returns: string - Current application ID - Example: $app_id = wa()->getApp(); echo $app_id; // 'site', 'shop', 'blog', etc. ``` -------------------------------- ### Webasyst Theme Build Process Configuration Source: https://github.com/pro-wow/webasyst-api-docs/blob/main/WEBASYST_THEME_DEVELOPMENT_GUIDE.md Configuration for a theme's build process using npm scripts, Sass, and Webpack. Defines commands for building CSS and JavaScript, watching for changes during development, and compiling assets in compressed or development modes. ```json { "name": "webasyst-theme", "version": "1.0.0", "description": "Custom Webasyst theme", "scripts": { "build": "npm run build:css && npm run build:js", "build:css": "sass scss/main.scss css/base.css --style compressed", "build:js": "webpack --mode production", "watch": "npm run watch:css & npm run watch:js", "watch:css": "sass --watch scss/main.scss:css/base.css", "watch:js": "webpack --mode development --watch" }, "devDependencies": { "sass": "^1.45.0", "webpack": "^5.65.0", "webpack-cli": "^4.9.0" } } ``` -------------------------------- ### Repository Structure Analysis for Webasyst Site Themes Source: https://github.com/pro-wow/webasyst-api-docs/blob/main/WEBASYST_THEME_DEVELOPMENT_GUIDE.md Provides an overview of the standard directory structure for Webasyst site themes. It outlines key directories like `default/`, `custom/`, `css/`, `js/`, and `templates/` for organizing theme assets and files. ```bash # Repository structure analysis wa-apps/site/themes/ ├── default/ # Default theme │ ├── theme.xml # Theme configuration │ ├── css/ │ │ ├── base.css # Base styles │ │ └── mobile.css # Mobile styles │ ├── js/ │ │ └── theme.js # Theme JavaScript │ ├── templates/ │ │ ├── layouts/ # Page layouts │ │ ├── actions/ # Action templates │ │ └── includes/ # Reusable components │ └── img/ # Theme images └── custom/ # Custom themes follow same structure ``` -------------------------------- ### waSystem Get Storage Handler Source: https://github.com/pro-wow/webasyst-api-docs/blob/main/WEBASYST_API_DOCUMENTATION.md Explains how to obtain the storage handler for the current domain, used for managing application data. ```APIDOC waSystem::getStorage() - Gets the storage handler for the current domain. - Syntax: public function getStorage() - Returns: waStorage - Storage instance - Example: $storage = wa()->getStorage(); $storage->set('key', 'value'); $value = $storage->get('key'); ```