Description

This Framework is to be used when starting a new site. Contained in these folders are all the files and folders typically copied over on a fresh Contao install.

Before Contao Installation

  1. Set up a new account on any given server while following Andy's Contao Installation Instructions.
  2. Using terminal, make sure the default folder for the new site is “public_html\web”
  3. Set the highest compatible version of PHP you can
  4. Make sure the SSL certificate is being installed correctly under “Manage AutoSSL”

During Contao Installation

  1. During the System Check step, the Server Configuration line will show a button on the right labeled “Change”, click it
    • Server Configuration: You should point to the php binary for the version being used. We now use PHP 8.1, so the line would read “/opt/cpanel/ea-php81/root/usr/bin/php”.
    • Uncheck “Use the Composer Resolver Cloud” option. Our servers have enough memory.

**NOTE** - Sometimes you don't have enough time to change the option. You can change this in the following file:

/public_html/contao-manager/manager.json

Add the following

"php_cli": "\/opt\/cpanel\/ea-php81\/root\/usr\/bin\/php",
"disable_cloud": true

Here's an example of what it looks like:

{
    "last_update": "2022-09-30T23:41:59+00:00",
    "latest_version": "1.6.0",
    "latest_requires": {
        "php": "^7.1.3 || ^8.0"
    },
    "php_cli": "\/opt\/cpanel\/ea-php81\/root\/usr\/bin\/php",
    "disable_cloud": true
}

Install Fail Workaround

Recently contao installs have been failing. This is the work around

  1. When you first run the install, it will crash and stop.

  2. Go onto FTP and edit public_html/composer.json, add allow-plugins code


    "config": {
    "allow-plugins": true
    }

  3. then delete the vendor folder and composer.lock

  4. run the install again and it will say that "Composer dependencies are not installed." -> click on "Run Composer"

  5. Install will complete

     

Install Popular Packages

After Contao’s installation has finished, install specific modules. Here is a list of modules install on nearly every site:

  • zyppy_class
  • zyppy_popup
  • dklemmt/contao_dk_mmenu
  • terminal42/contao-leads

Here is a list of other commonly used modules depending on the site

  • zyppy_page
  • zyppy_redirect
  • codefog/contao-news_categories
  • isotope/isotope-core

NOTE: Using Andy's custom modules

If you need to use one of Andy's custom modules, like "zyppy_page", you will need to edit the "composer.json" file in the "public_html" folder on the server. The top of the file should look like this:

{ // copy starting at this line
    "type": "project",
    "repositories":[
		{"type": "composer", "url": "https://repo.andrewstevens.consulting/"}
	],
    "require": { // copy stopping at this line
        "asconsulting/zyppy_page": "^1.5.2", // add your module to the list
        "contao/calendar-bundle": "4.13.*",
        "contao/comments-bundle": "4.13.*",
        "contao/conflicts": "*@dev",
        "contao/faq-bundle": "4.13.*",
        "contao/listing-bundle": "4.13.*",
        "contao/manager-bundle": "4.13.*",
        "contao/news-bundle": "4.13.*",
        "contao/newsletter-bundle": "4.13.*",
        
        // other potential modules
        "asconsulting/redirect_manager": "^1.1",
        "asconsulting/zyppy_class": "dev-master",
        "asconsulting/zyppy_popup": "^3.0",
        "asconsulting/zyppy_search": "dev-master",
        "asconsulting/contao_flexible_importer": "dev-master",
        "asconsulting/registration_state_select": "dev-master",
        "asconsulting/encrypted_form_pdf": "dev-master",
        "dklemmt/contao_dk_mmenu": "^3.2",
        "terminal42/contao-leads": "^1.4",
        "terminal42/notification_center": "^1.6.13"
        "pdir/social-feed-bundle": "^2.9",
        "codefog/contao-cookiebar": "^2.3",
        "codefog/contao-news_categories": "^3.4",
        "derhaeuptling/contao-lazy-images": "^3.0",
        
        //Isotope for ecomm
        "isotope/isotope-core": "^2.7",
        "asconsulting/isotope_linked_products": "dev-main",
        "asconsulting/isotope_super_sort": "^1.0",
        "asconsulting/isotope_variant_url": "dev-main",
        "asconsulting/isotope_where_to_buy": "^1.1.0",

    },
    "extra": {
        "public-dir": "web",
        "contao-component-dir": "assets"
    },
    "scripts": {
        "post-install-cmd": [
            "@php vendor/bin/contao-setup"
        ],
        "post-update-cmd": [
            "@php vendor/bin/contao-setup"
        ]
    }
}

The highlighted lines should be added towards the top of the "composer.json" file. After adding them and saving the file, reload Contao Manager and it will then allow you to install the custom module.

Using the Framework

There are two main folders, “Things to Upload” and “Things to Copy Over”. The folder “Things to Upload” contains folder structures and files used on nearly every site. The contents need to be compressed, uploaded onto the new site, and extracted. The folder “Things to Copy Over” contains folder structures with files who’s content needs to be copied into the same files found on the new site.

Directions for “Things to Upload”

  1. Compress the contents of the "public_html" folder. Upload onto the new site and extract it inside the new sites "public_html" folder.
  2. In the "templates" folder, update the folder named "site_name" with the new sites name (Example: "bright_cloud_studio").
  3. In the "files/structure/scss" folder, change the file named "site_name.scss" with the new sites name (Example: "bright_cloud_studio.scss").
  4. In the "_variables.scss" file, update the "Site Specific" variables like the font family and color.

Directions for “Things to Copy Over”

  1. After installing the “zyppy_class” module, on the sites server open the “system/config/localconfig.php” file and copy over the needed contents from the framework’s “system/config/localconfig.php” file.

Starting Within Contao

After Contao and the BCS Framework have been installed, these are the basic directions for getting started within Contao.

  1. Set up a Theme
    1. Under “LAYOUT > Themes” click “(+) New” to create a new theme
      1. For “Theme Title”, use the sites name (Example: “Bright Cloud Studio”)
      2. For “Author”, use “Bright Cloud Studo”
      3. For “Folders”, select the “structure” folder we uploaded from the framework
      4. For “Templates folder”, select the “site_name” folder we renamed and uploaded from the framework

Add Front End Modules

Now that we have our new theme, we need to add front end modules and page layouts. First, lets add the front end modules.

  1. Add a “Header – Wrapper” front end module:
    1. Click “(+) New” to create a new front end module
    2. Change “Module type” to “Custom HTML”
    3. For “Title”, use “Header – Wrapper”
    4. Copy the contents from “Header – Wrapper.html” in the “Front End Modules” folder into the “HTML code” section
    5. Click “Save and Close”
  2. Add a “Footer – Wrapper” front end module:
    1. Click “(+) New” to create a new front end module
    2. Change “Module type” to “Custom HTML”
    3. For “Title”, use “Footer – Wrapper”
    4. Copy the contents from “Footer – Wrapper.html” in the “Front End Modules” folder into the “HTML code” section
    5. Click “Save and Close”

Add a Page Layout

Now that we have the minimum needed Front End Modules we can set up our first Page Layout. Under the “LAYOUT > Themes” section click on the green and white icon to the right of the gears to edit Page Layouts

  1. Add a “Default” page layout
    1. Click “(+) New” to create a new page layout
    2. For the title, use “Default”
    3. For “Rows”, select the last option which is a green rectangle above and below a white rectangle
    4. For “Columns”, select the first option which is just a blank white square
    5. For “CSS framework”, uncheck all option as we are using our own
    6. For “External style sheets”, click “Change selection”
      1. Navigate to the “structure/SCSS” folder we uploaded and select the necessary files
        1. _variables.scss
        2. standard.scss
        3. structure.scss
        4. “site_name.scss” which would be renamed to the specific sites title (Example: “bright_cloud_studio.scss”)
        5. header.scss
        6. footer.scss
      2. Drag to reorder the files into the order listed above
    7. For “Included modules”, click the green “+” button twice so there are three options
      1. For the top option select “Header – Wrapper” in the first box and “Header” in the second
      2. For the middle option leave the first box “Articles” and the second box “Main column”
      3. For the bottom option select “Footer – Wrapper” for the first box and “Footer” for the second.
  1. Under “jQuery”, select “Include jQuery”
  2. Under “Expert settings”
    1. For “Page template”, select “fe_page (site_name)”
    2. For “Viewport tag” use “initial-scale=1, maximum-scale=5”
    3. For “Body class” use “default”
  1. Click “Save and close”

Setting up Site Structure

Now that we have our minimum needed front end modules and a page template, we can set up the Site Structure and set up our first page.

  1. Set up our Website Root
    1. Click “(+) New”, then click the orange box with the white arrow to the right of the gray “Site structure” line
    2. For “Page name”, use the site’s name (Example: “Bright Cloud Studio”)
    3. Under “Language settings”
      1. For “Language” use “en”
      2. Check “Language fallback”
    4. Under “Website settings”
      1. For “Favicon”, click “Change selection”
        1. Navigate to the “structure/images” folder we uploaded and select the “favicon.svg” file
        2. Click “Apply”
      2. Under “Global settings”
        1. For “Date format”, use “F j, Y”
        2. For “Time format”, use “g:i a”
        3. For “Date and time format”, use “F j, Y”
  1. Under “Layout settings”
    1. Check “Assign a layout” and make sure “Page layout” is set to the “Default” page layout we created earlier
  2. Under “Publish settings”
    1. Check off “Publish page”
  3. Click “Save and Close”

Now that we have set up our website’s root, we need to add our first page.

  1. Add our first page
    1. Click “(+) New” then click the orange box with the right facing arrow on the lighter gray line with the site’s name
    2. For “Page name”, use “Home”
    3. Under “Expert settings”
      1. For “CSS class”, use “home”
      2. Check “Hide in navigation”
    4. Under “Publish settings”
      1. Check “Publish Page”
    5. Click “Save and close”

We’re Up and Running

If you visit the new site now, it will successfully load and display our newly created “Home” page.

Building Custom HTML Modules

A big part of templating a site is building custom HTML modules like header_wrapper to hold various elements in the header. It is important to use search indexing tags in these areas so that parts of your template don't get indexed in Contao's search. Like if the header had a tagline or custom navigation. Otherwise the search result would be every page on the website.

<!-- indexer::stop -->
phone number, search module headline, tag line or whatever
<!-- indexer::continue -->

 

 

Page Templates

This section contains information and directions related to Page Templates.

Expert Settings

For the "Expert Settings" settings of a page template

  • For "Viewport tag" use "initial-scale=1, maximum-scale=5"
  • Assign a "Body class" based on which page the template is for (Example: for "Home" template use "home")
  • For the "Additional <head> tags" section add the following code:
<!-- FontAwesome -->
<script src="https://kit.fontawesome.com/0893202e33.js" crossorigin="anonymous"></script>

<!-- Apple Stuffs -->
<link rel="apple-touch-icon-precomposed" href="files/structure/images/app-icon.png">
<meta name="apple-mobile-web-app-title" content="Website Name™">