See our videos, builder or why us.
Engage with Amadeus WebDocs — Section @ World
Authoring Content
Authoring with Amadeus
We use a simple sytax called markdown which is easier to maintain that typical html.
The fallback is to html which is supported in txt files and includes the powerful wpautop feature of Wordpress.
More complex content can use all the php and amadeus builtin funcions in php, like an authors site or a theme that consumes a sheet or a complex, cached, delta providing sitemap or a simple one that uses the recursive_menu.
All 3 files types viz .md, .txt and .php are supported in advanced taxonomies by the renderFile method by the optional before_render and did_render_page of functions.php.
Dear Website Owner / Content Author
Authoring online never was easier than with Amadeus and Google Drive... - Ask for a project to be setup - Then ask that its content be shared on the [https://drive.google.com/drive/folders/1AxmZfNLIxhBQPYe_HPlQSYIOffL7VMbs](Amadeus Content Drive) and shared with you.
Dear Developer / Content Admin
- [Drive Download](https://www.google.com/drive/download/)
Beginners Guide
Learning by Example
- Sheet - look at ./amadeus/content/showcase.php to see how amadeus.com/showcase/ or localhost/amadeus/showcase/ works and note the following
- Sheet data comes from ./amadeus/data/showcase.tsv (copy pase this into excel / google to see it)
- sheet rows are grouped by featured column value is 'Y' or '' - lines 22 and 23
- a foreach is done on the items in showcase function defined on line 25
- item_r is called wherever $item column needs to be extracted. this function is defined in ./amadeus/code/functions.php
- Menu -
Features
All Amadeus Features
Promotions in the Footer
See the full thing in action.
Engage / Form Filler
Engage will ultimately send an email to the email of the page with a cc to the site. On a PC, you may configure gmail as the mailto handler.
Amadeus' Share
with Google Analytics Tracking
Amadeus' Assistant
Native Text to Speech Wrapper
Rich Home Pages using Sheets
Mozzacart for Order Placement
In action at vidzeal.com/creations/.
Content Folders - Samples
- YieldMore.org - people, organizations, programs
- HealthInfoIndia.com - hospitals, doctors, alternate-healers
Getting Started
Pointing to Our Servers
If the Domain Name Server is to be ours, whereby the website is hosted on our server, then you will need to login to your Domain Admin and set the nameservers as
- ns10565.dizinc.com
- ns10566.dizinc.com
This is our hostdime.com where we have been customers of their shared hosting plan since May 2005.
Setup Subdomain preview.[yourwebsite.com]
(if our's is not your DNS server)
- go to your domain host
- create an A record for the subdomain
- give the IP as 198.136.61.225
Setting up Environment
This section assumes that you no longer feel a noobie, and that you have read the Don't Panic page which introduces the concepts below.
- Create folder D:\Magique. If there is no C Drive, you may have to go to Disk Management and Shrink Volume to create a D:\ drive if it doesnt exist, or any drive other than C (which data will get lost in the event of a OS / hardware failure).
- Install git and tortoisegit so code can be managed. Git requires to check-in and check-out line endings as is, so make sure to select this correctly in the Wizard. TortoiseGit First Run Wizard requires a email - give team@yieldmore.org. If you miss the line endings chane in the wizard, in git bash, you can run git config -global core.autocrlf "false"
- Download the bitbucket/amadeusweb/amadeus/ or YieldMore World. See code.amadeusweb.com for all projects. We recommend using the YM code Flavour to jump start your development. Note that the bitbucket app key can be had from Imran for account amadeuswebdev.
- Install php with administrator command prompt using chocolatey instructions below on windows or on mac.
- Make a batch file called run-web.bat in the web folder with "php -S localhost:80" after making sure Skype or anything else is not using port 80. Always make sure this is running while doing development, else localhost will not open.
- Extract the theme assets (see below) that your site is using - for Amadeus, this is biz-land (see cms.php).
- Run the server (bat file) and open localhost/amadeus/ and localhost/yieldmore/ in the browser and it should show the folder contents.
- Before uploading to a server, you will need an FTP Client like FTPSync or Beyond Compare.
- Install a Code Editor like VSCode on any platform or PSPad on Windows.
Command Lines for PHP Setup
Chocolatey, dubbed "The Package Manager for Windows" is a system for installing (with dependancies) packages like PHP which have different prerequisites depending on the version, service pack and hotfixes installed in windows. The PowerShell and choco install commands below to be run in CMD Prompt with Administrator privileges. REM indicates a batch file remark and is the source where said command is from.
rem https://docs.chocolatey.org/en-us/choco/setup
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "[System.Net.ServicePointManager]::SecurityProtocol = 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
rem https://community.chocolatey.org/packages/php
choco install php --package-parameters='"/ThreadSafe"'
Theme Extraction
This assumes a theme has been created and zipped as per this page.
If this step is not done properly for the theme the current website is using / trying to use you will get a lot of 404 not found errors and the website will appear broken / plain white.
- Save the zip from the theme downloads page into the theme folder if not done already. For Amadeus you will need biz-land.
- Extract "here" and get all the assets - css, js and default images.
- Load / refresh the website and see that there are no missing assets.
- If your git client (usually tortoisegit) shows theme assets as being different, this would be because optimizations/validation fixes have been done on that theme and these files need to be reverted since the zip file would have overwritten the changed files that are checked in. It is a good idea to see what has changed. This is the case for biz-land, so say skip replace all files when it says should it overwrite.
Additionally, if planning to use Slides, the revealjs will need to be downloaded and extracted to the assets folder.
Setting Up on Mobile
The following Apps need to be installed:
- Git Client - PocketGit on Android
- Server in Mobile - AWebServer - Android - screenshot
- Code Editor - APhPEditor - Android
In a folder called Magique in the Mobile (configured as the server's wwwroot), the Amadeus repository needs to be cloned.
Server should run on port 8080 (or any) - see port substitution code in cms.php
'url' => $local ? replace_vars('http://localhost%port%/amadeus/', 'port') : 'https://amadeusweb.com/',
NOTE:
- Php is detected when Magique is the containing folder.
- Url rewriting is only configued when running in apache (not the standalone php server we use in env setup). Hence, inner pages will have an index.php/ just after the url.
- A new method has been made available and can be seen in action as:
<a href="<?php echo am_page_url('creatively-yours/');?>">a course</a>
- The menu and recursive menu already use this.
- In renderFile (md/txt) its %page-url%
Home
What is Amadeus?
Written in PHP, Amadeus is a Microframework or Content Management System used for hand crafting powerful websites.
It's a no-nonsense proprietary system, unique for its NO-DATABASE and customizable taxonomy (content architecture).
It has been used in over 20 websites - best of all, it uses a single copy of its libraries per server and can run on your server using the standaloneapp variable.
The themes and framework folders contained in its core are accessed via an entry point by the cms file of the site's code folder.
It boasts a 20kb footprint, has a few modules and loads the html in a blazing < .05 seconds, using on average < 1MB as seen here. It extensively uses the scandir and file_get_contents which calls the disk as seen here.
It uses git technology to effectively manage content and code in a single online repository. Databases, though frowned upon, GCP may become the de facto Headless CMS for systems like Sunlight. A PWA was proven in November 2021 to bring a mobile app feel.
Next Steps
- Don't Panic
- Look under the hood.
- Get started crafting on your machine.
- Build your first website.
- See the How-Tos.
- Look at the various Features available.
How Tos
Customizing Icons Supplied by a theme
Years ago we would use individual images or css image sprites for icons for buttons and in boxes. Today there are libraries with many many usable icons made from svgs and bundled into a single font.
They may provide cheatsheets like boxicons below or have an accompanying html file or require a css class explorer (a tool Imran has made in the past and will make accessible again).
Optimizing and Validating a Theme
Use Google Photos
- Log into Google Photos on your computer. 2 .Click on the Album you want to embed. ...
- Click on Get Link and then Copy.
- Go to publicalbum.org.
- Paste your Google Albums link into the box and press Create Embed Code.
- Here you'll be able to change the way your album is displayed if you wish.
Making Websites
Prerequisites
To have amadeus running locally as per the setup.
Jumpstart with the YieldMore flavour
- To reuse backend code and avoid duplication and repetitive feature management, AmadeusWeb.com now supports a netwotk of sites as content only using the builting code flavour.
- An example of this is bitbucket.org/yieldmore/peace/ and bitbucket.org/yieldmore/healers/.
It is expected for you to amend this document as you have doubts / clarify them with Imran.
Migrating from v3.5 to the new YM flavour
After including entry.php, add this:
define('SITEPATH', __DIR__);
am_var('flavour', 'yieldmore');
runCode('cms');
rename cms to ../site-cms.php
see settings
'use-parent-slugs' => true,
'sections-have-files' => true,
'home-link-to-section' => true,
add sections and optionally featuredSections (used by directory/home)
For more details see joyfulearth/core migration of Aug 2023.
Starting a Website From Scratch
NOTE: Do this only if the design is radically different from yieldmore.org
- Add a folder matching the name of your domain (yoursite for instance) to localhost and prepare to copy over multiple files from the amadeus folder.
- Copy index.php file in the root folder and adjust the relative path of the entry.php (add a "../amadeus/" to it).
- Copy .htaccess also from the root
- Amadeus has the concept of "safeName", configured in cms.php which usually matches the site's folder name and is used for the logo / icon which files are expected. Therefore, if your safeName is "yoursite" then pls add icon-yoursite.png | logo-yoursite@2x.png | logo-yoursite.png.
- Now create a "code" folder and copy the cms.php from it and make an empty functions.php
- Open cms.php and change the name | byline | safeName, reset the version to 1 with the current date, include contact information, comment out image-in-logo for now and styles and scripts also update the social items
- It is good to remember the fact that the urls inside the app are either relative (in content) or absolute (in the menu). It is mixed because the home page is one level up from the inner urls (we always end with a trailing slash). Hence change the url variable to match the site folder name for local and your domain name for the other. Do note that ternary conditions are used and it's a double ternary when maintaining preview subdomains separately.
- Please also remove the section on "standalone.php". With this, the work on the code folder is done.
- Add a "content" folder to the site root with and index.md file and use the markdown syntax for it's content.
- Add other file names in kebab casing and keep watching as they get added to the menu automatically on refresh. In the root content folder, Amadeus will recognize (in it's renderFile method) .html, .md, .php and .txt, using wordpress' wpautop (auto paragraph) function for txt files unless # or are detected.
Migrating From Version2
Backward Compatibility
Amadeus 3.x does not disrupt the entry point of v2 and will simply pass execution onto the v2 folder provided it has been downloaded on your machine.
In this way, it was possible to start a fresh rewrite of 3.0 with zipped theme distribution architecture making the bitbucet repository superlite.
Steps to Migrate Site
- Create a code folder and move (rename in git), the _xyz.php without the underscore. If using legacy theme, dont move _menu and _footer_content
- Add a index.php file to the root with following code
<?php
error_reporting(E_ALL);
ini_set('display_errors', '1');
include_once '../amadeus/framework/entry.php';
define('SITEPATH', __DIR__);
include_once 'code/cms.php';
?>
- Change .htaccess from _cms.php to index.php (lines 6 and 8)
- Now run the website, you will get "cannot redeclare" and other errors ->
Remove include to framework from cms.php Change entry point from core.php to entry.php Change path to 'path' => SITEPATH, add 'folder' => 'content/',
- Replace cs_var with am_var in cms.php and functions.php
- Remove _ga.php and add 'google-analytics' => '[ga4id]'
Rich Home Pages
Prerequisites
Once the website is setup locally, do the following
- Look at the new theme and understand its various elements.
- Compare it with BizLand to know that rich page sections can vary.
- See ./amadeus/themes/cv-yoga/home.php / view source of the output to understand the html.
- See Rich Pages built in Amadeus that are sheet driven.
- Start correlating the content with the sheet and take a note on what section to be done.
Understanding the System
Basic Syntax
Load Sheet
This command will load the 'home' sheet from the data folder of the website
<?php $sheet = get_sheet('home', 'homeSection'); ?>
Looping
This will let you loop through rows matching a given section. Once you start a flower brackets { and switch to html by typing ?> then you need to make sure there is a closing bracket.
<?php foreach ($home->sections['hero'] as $item) {?>
//html that may use item_r
<?php } ?>
Load Column
An item_r function is defined in functions.php and it handles any needed substitutions and strategies for the website. It will include | to newline character replacement as sheets do not support multiline content. For Example, to render the Heading, you may say
<h1><?php item_r('title', $item); ?></h1>
Full Sample
<ul>
<?php foreach ($home->sections['abouts'] as $item) {?>
<li>
<i class="<?php item_r_or('css', $item, 'bx bx-store-alt'); ?>"></i>
<div>
<h5><?php item_r('title', $item); ?></h5>
<p><?php item_r('content', $item); ?></p>
</div>
</li>
<?php } ?>
</ul>
Wrapping Up
- Make a new sheet copying the column names and rows of the section column alone
- Correlate the html you are converting with what you are defining. Try to use the same names as the sections in html.
- Remember html will copy the same seeming block multiple times but in our case, we use a template and content will come from the sheet as multiple rows.
- Even a single item will need to use the foreach syntax and it is understood that whoever is loading the content will have a single row only. Example is the about section heading text / the hero section
Theme Creation
Zip file per Theme
- Copy theme folder.
- Add everything except home.php, header.php, footer.php to the zip file.
- move zip file to amadeus/themes/downloads & upload it to server using ftp sync.
- copy install-theme.bat (from cv-modern-blog) and change file name.
- delete extrected contents (from zip file) and test batch file.
Converting Legacy Theme
- replace cs_var with am_var
- use new run_site_code('menu') which returns false to be used to call menu() or render the default footer content.
1. Finding a Theme
Start with a HTML Template from the internet. Some good places to start:
- https://bootstrapmade.com/
- http://themeforest.com/
2. Save to themes folder
- Download the zip file to the "amadeus/themes/" folder / move it there
- Extract the folder to themes so that the subfolder contains "index.html"
- Rename the folder to add hyphens before new words and remove capitals.
- For eg: BizLand should become biz-land (we prefer lowercase for urls so all folder/file names should follow that rule.
3. header.php
- Save the index.html as header.php
- Use a code editor like PSPad to edit the php, html, css, js files
a. Title and Meta
Search For
<title>
and replace the line with:
<title><?php title(); ?></title>
Search for
<meta content="" name="description">
<meta content="" name="keywords">
and replace with (a single)
<?php seo_tags(); ?>
b. Icon (for browser tab)
and add this line just after that
`
<link href="<?php echo am_var('url'); ?><?php echo am_var('safeName'); ?>-icon.png" rel="icon" />
## c. $theme
Search for
**"assets**
and replace with
**"<?php echo $theme; ?>assets**
* some themes use directly css/ and js/ folders and this may need to be treated separately
## d. site assets
Search for all the css/js files in the file. This is either in the head or just before </body>.
After it, add the line:
<?php styles_and_scripts(); ?>
<?php foot_hooks(); ?>
`
e. head hooks
Before the tag ends, add the line
<?php head_hooks(); ?>
f. Menu
In bootstrapmade.com, its usually within this tag
<nav class="nav-menu d-none d-lg-block">
Move it to menu.html and replace it with
<?php if (!run_site_code('menu')) menu(); ?>
4. Specific Features
head.php
Some themes have a right first page header or a splash image. This code can be controlled pagewise using
<?php run_site_code('head'); ?>
LOGO / link to home
This should look something like this:
<a href="<?php echo am_var('url');?>"><img src="<?php echo am_var('url'); ?><?php echo am_var('safeName'); ?>-logo.png" alt="<?php echo am_var('name'); ?>" class="img-fluid"></a>
5. Chop into home.php and footer.php
Detect home.php
Detect begin of content of the page
This is sometimes where
</header>
ends
On bootstrapmade, this is the beginning of the hero section rest of content should go to home.php or content/index.php
Detect Footer
This is sometimes where the tag ends
Rest of file should go into footer.php
6. Footer
Footer Content
this is usually a footer-top sort of div above which this line should be placed
<?php if (!run_site_code('footer-content')) { ?>
//[default theme content]
<?php } ?>
this will tell php to use the [optional] _footer-content.php from the website
Copyright
<?php copyright(); ?>
//this is same as
© Copyright <strong><span><?php echo am_var('name'); ?></span></strong>. <?php echo (am_var('start_year') ? am_var('start_year') . ' - ' : '') . date('Y'); ?> All Rights Reserved
Credits
Add
<br /><?php amadeus_credits(); ?>
in the footer (usually below the theme credits
Post Credits
if necessary, add
<?php if (am_var('footer_post_credits')) { echo renderFile(am_var('footer_post_credits')); } ?>
Under The Hood
Introduction
Amadeus uses a server(Apache or PHP standalone) and when localhost/amadues is visited in the browser, this server executes index.php which loads the framework(entry.php) and configures the website(cms.php). By default the framework looks for files in the configurable content folder. If the website requires to organize by sub-folder, functions.php will have to define did_render_page.
Basic Flow
- sitepath/index.php is loaded(if Apache, .htaccess is used).
- framework/entry.php loads all framework files which defines the various methods used by framework, site and content PHP files.
- code/cms.php bootstraps the framework with an array of site configurations. It then calls render() which includes the theme files and loads the content of the current page(node).
- code/functions.php defines further variables such as sections. It also may
- define sections(sub-folder for content).
- parse the current url(node) and search for a match, setting filename found.
- call render_text_or_md if url is in sub-folder. Additionally, as in the case of YieldMore.org it supports multiple files of same name but with different extension for example pdfs, mp3s, jpgs etc.
- reads the sitemap sheet to build the menu and set SEO information.
- insert HTML above & below the page when home.php is different from inner pages.
- //amadeusweb.com/themes/biz-land//header.php of the theme will be included before the page content and it begins the HTML output and is the first part of the theme.
- title, SEO, icon, scripts & styles, head_hooks and analytics are all included here as part of the head tag.
- logo & menu are also rendered here.
- code/menu.php is optional and will be loaded if it exists.
- content/index.php may call //amadeusweb.com/themes/biz-land//home.php for rich single page website home page. Amadeus prefer to drive content using data/home.tsv, a spreadsheet having rows for each section of the page.
- //amadeusweb.com/themes/biz-land//footer.php called after content.
- ends the wrapper divs used by the theme.
- code/footer-content.php is optional and may include footer menus, prominent logo and contact details.
- copyright, theme credits and Amadeus credits are added.
- non essesntial CSS and themes are included here.
- ends the body tag.
- render calls print_stats if not disabled. This however appears after the body tag.