See our videos, builder or why us.

Engage with Amadeus Web

Docs — Section @ World

About Us Blog Docs

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

Read More...

Beginners Guide

Learning by Example

  1. 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
  2. Menu -
Read More...

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

  1. YieldMore.org - people, organizations, programs
  2. HealthInfoIndia.com - hospitals, doctors, alternate-healers
Read More...

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

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)

  1. go to your domain host
  2. create an A record for the subdomain
  3. 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.

  1. 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).
  2. 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"
  3. 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.
  4. Install php with administrator command prompt using chocolatey instructions below on windows or on mac.
  5. 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.
  6. Extract the theme assets (see below) that your site is using - for Amadeus, this is biz-land (see cms.php).
  7. Run the server (bat file) and open localhost/amadeus/ and localhost/yieldmore/ in the browser and it should show the folder contents.
  8. Before uploading to a server, you will need an FTP Client like FTPSync or Beyond Compare.
  9. 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.

  1. Save the zip from the theme downloads page into the theme folder if not done already. For Amadeus you will need biz-land.
  2. Extract "here" and get all the assets - css, js and default images.
  3. Load / refresh the website and see that there are no missing assets.
  4. 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:

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:

Read More...

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

Read More...

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

  1. Log into Google Photos on your computer. 2 .Click on the Album you want to embed. ...
  2. Click on Get Link and then Copy.
  3. Go to publicalbum.org.
  4. Paste your Google Albums link into the box and press Create Embed Code.
  5. Here you'll be able to change the way your album is displayed if you wish.
Read More...

Making Websites

Prerequisites

To have amadeus running locally as per the setup.

Jumpstart with the YieldMore flavour

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

Read More...

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

  1. 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
  2. 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';
?>
  1. Change .htaccess from _cms.php to index.php (lines 6 and 8)
  2. 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/',

  3. Replace cs_var with am_var in cms.php and functions.php
  4. Remove _ga.php and add 'google-analytics' => '[ga4id]'
Read More...

Rich Home Pages

Prerequisites

Once the website is setup locally, do the following

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

Read More...

Theme Creation

Zip file per Theme

  1. Copy theme folder.
  2. Add everything except home.php, header.php, footer.php to the zip file.
  3. move zip file to amadeus/themes/downloads & upload it to server using ftp sync.
  4. copy install-theme.bat (from cv-modern-blog) and change file name.
  5. delete extrected contents (from zip file) and test batch file.

Converting Legacy Theme

1. Finding a Theme

Start with a HTML Template from the internet. Some good places to start:

2. Save to themes folder

3. header.php

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 
&copy; 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')); } ?>

Read More...

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

  1. sitepath/index.php is loaded(if Apache, .htaccess is used).
  2. framework/entry.php loads all framework files which defines the various methods used by framework, site and content PHP files.
  3. 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).
  4. 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.
  5. //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.
  6. 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.
  7. //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.
  8. render calls print_stats if not disabled. This however appears after the body tag.
Read More...

Get Tracking Link — ?