Welcome Servies To Emole Services Developer Documention
You Can Learn How TO Create Services And ALso Create New Mobile App
emole-theme builds store themes and page templates from your machine: files in your own editor, a live local preview with your sandbox store's data, the platform's checks before every push, and push/pull with one command. Version 1.5.0, Node.js 18+.
npm i -g command again.
login --site <url> [--email <email>]EMOLE_THEME_PASSWORD environment variable:logoutapps12 theme Aurora (Draft)
15 pages Fashion product page (Published)
18 app Offer bar (In review)theme is a full theme, pages a product/category/page template, app any other app.init <folder> --app <id>.emole-theme.json (the link, don't share it) and a .gitignore.new <folder> [--from aurora]aurora has every page, 21 sections and block-based sections (slider, FAQ). Link it afterwards with link.link --app <id>theme.json) to a theme on the platform.check [folder][x] errors and [!] warnings with file and line; exits with code 1 if there are errors, so you can use it in CI.preview [--no-open].emole-preview.html and opens it. Nothing is pushed.dev [--push] [--port 9292] [--no-open]http://localhost:9292. Every save (debounced 300 ms) runs check, re-renders the preview on the platform and reloads the browser. Errors appear in a red box over the page. With --push it also pushes every save that has no errors.push [--force]check first and refuses if there are errors; --force skips the check. Prints the number of sections pushed and how many are on the home page.pullsection presets and section new <key> [--preset <name>] [--page <page>]sections/<key>/ (section.html, section.css, schema.json) and adds it to templates/<page>.json (default home; on other pages with "position": "full"). The key is lowercase latin letters, digits and dashes.| Preset | Creates |
|---|---|
slider | Full-width slideshow, one block per slide |
faq | Questions and answers, one block per question |
features | Icon + title + text columns |
testimonials | Customer quotes with stars |
logos | Brand / partner logos row |
product-grid | Product grid from a category, with sale badge and empty state |
image-text | Image beside text with a button |
banner | Promo banner with countdown text and button |
category-tiles | Category tiles from the store categories |
reviews | Product page: approved reviews of the shown product |
block new <section> <type> [--name "Name"]schema.json with title and text fields and maxBlocks: 12, and a starter {{#each blocks}} loop to section.html if it has none.upload <file…>default in schema.json or in a page's settings.pack [file] and unpack <file> <folder>theme-package.json), for backup or sharing, and back into folders.my-theme/
├─ theme.json name, global settings, merchant options
├─ assets/global.css global CSS
├─ sections/<key>/
│ ├─ section.html HTML with {{…}} variables
│ ├─ section.css section CSS (var(--t-primary) …)
│ └─ schema.json fields and blocks
├─ templates/
│ ├─ header.json home.json footer.json
│ ├─ product.json category.json topic.json
│ └─ cart.json … completed.json optional platform pages
└─ .emole-theme.json link to the platform (don't share)
templates/<page>.json is an array of elements: { "section": "<key or @element>", "position": "…", "settings": {…}, "blocks": […] }. At most 40 elements per page.| Page | Positions | Platform elements |
|---|---|---|
header | top start center end bottom | @logo @menu @search @account @cart @wishlist @currency @language |
home | — | Your sections only, in order |
product | full start end | @breadcrumb @gallery @title @rating @price @availability @sku @attributes @addtocart @wishlist @shortdesc @fulldesc @specs @tags @share @related @alsopurchased |
category | full start end | @breadcrumb @title @description @subcategories @featured @selectors @filters @products |
topic | full start end | @breadcrumb @title @body |
cart login register checkout search wishlist compare notfound blog news completed | full start end | @content (required) |
account | full start end | @navigation @content |
footer | top col bottom | @logo @links @categories @account @social @newsletter @contact @copyright |
| Syntax | Value |
|---|---|
{{config.title}} | A field from schema.json |
{{config.theme.primary}} | A global setting from theme.json |
{{store.name}} {{store.phone}} {{store.address}} {{year}} | Store details (header and footer) |
{{#each products}}{{name}} {{price}} {{image}} {{url}}{{/each}} | Products (with limit and categoryId fields) |
{{#each categories}}{{name}} {{url}}{{/each}} | Categories |
{{#each featured}} {{#each topics}} {{#each cart}} {{cart.count}} {{cart.total}} | Other collections |
{{#each images}} {{#each reviews}} | Product page only |
{{#if config.x}}…{{else}}…{{/if}} {{#unless config.x}}…{{/unless}} | Conditions |
{{name | truncate:40 | upper}} | Filters: truncate default upper lower date number image striphtml nl2br urlencode append prepend |
var(--t-primary) var(--t-accent) var(--t-font) var(--t-radius) | Theme settings in CSS |
// schema.json
{ "blocks": { "slide": { "name": "Slide", "limit": 0, "schema": [ {"key":"title","label":"Title","type":"text"} ] } }, "maxBlocks": 8 }| Where | Key | Effect |
|---|---|---|
theme.json | "companions": [12, 15] | Up to 10 of your apps installed free with the theme |
theme.json | "merchantReorder": true | Merchant may reorder elements |
theme.json | "merchantCss": true | Merchant may add their own CSS |
theme.json | "presets": [{ "key": "dark", "name": "Night", "values": { "primary": "#111827" } }] | Up to 12 one-click color sets |
schema.json | "merchantAdd": true | Merchant may add the section to the home page |
| Page element | "merchantHide": true | Merchant may hide the element |
| Field | "locked": true | Hidden from the merchant |
check enforcespush):theme.json, no sections, more than 60 sections, home page with no sections.key, invalid or duplicate key, unknown type, select without options. Types: text textarea color number url image select boolean font category sort.@content on platform pages.maxBlocks, a block type not defined in schema.json, {{#each blocks}} with no blocks defined.companions that isn't a list of IDs or has more than 10, invalid presets, </style inside CSS.{{#if}}/{{#each}}, images without alt, <script> in a section, Razor code (@model, @{) that won't run, fields without a label, block types never shown, missing primary/accent/font settings, a product card without {{product.url}} or an add-to-cart button, no header/footer/product/category design.| Message | Fix |
|---|---|
emole-theme not found | Reopen the terminal; make sure npm -v works and the npm global folder is in PATH |
Please log in first | emole-theme login --site https://partners.emole.sa |
This folder is not linked to a theme | Run from the init folder, or emole-theme link --app <id> |
theme.json not found | You're outside the theme folder |
Folder "x" is not empty | init, new and unpack need a new or empty folder |
Fix the errors above, or push anyway with --force | Fix the [x] lines; --force only if you're sure |
Unexpected response from the site (HTTP …) | Check the --site URL and your connection, then log in again |
