Composr Tutorial: Web-applications, Composr, and PHP

Written by Chris Graham
This tutorial will provide some background into the different kinds of solutions that are out there for creating websites. It is not only specific to Composr – we hope to explain the inherent advantages of using a CMS such as our own – as well as what makes Composr special.

To read more about Composr's extensive features, see the Features page. To read more about the USPs see the Why we're different page .


What a website is

You know what a website is from an experience point-of-view: a site consists of pages, with each page having a URL ('web address'), and where pages are joined to other pages via hyper-links. You probably do not know what a website is from a technical point-of-view though, and it's a good idea to understand some of the basics because it will help you decide what direction to go in with your website (by properly understanding the alternatives). Let's go through what we do know…

  • a site consists of pages
    A website is built with web pages. The natural thing is to think that a 'web page' is a self-contained document. In actual fact, a web page usually consists of separate files (such as images, sound-clips or videos) that are tied together by a programming language called 'HTML' (†). An HTML file contains code required to put all the pieces of a web page together like you see on your screen now (e-mails can also be made in HTML). Also specified in the HTML file are the instructions for displaying the text you are reading now, including the font-size, colour and style. All these elements will produce a web page, and the mix of Human-text and computer-code can often be very daunting when it comes to writing or editing an HTML -- this is why people often use additional computer software to create web pages for them.

  • each page has a URL
    URLs actually encode a number of things that together provide all the information needed to retrieve a page from the world-wide-web. This isn't unlike real-world addresses, which usually need to include a human name, a house number and a post-code/ZIP code. The main two things a URL encodes are:
    1. the computer a page is stored upon (a 'web server') – http://example.com/example.html
    2. the name of the page on that computer – http://example.com/example.html
    For a simple web-page, (2) is simply a filename that the computer reads from its hard-disk and sends back.

  • pages are joined to other pages via hyper-links
    Fortunately there is not much to explain here beyond what you already know. Pages each have their own URL, and it is these URLs that are used for hyper-links.


So, from a technical point of view, a website is a bunch of files put on a computer that you access by giving a URL through a web-browser. Well done for reading so far – there are just a lot of facts and terms, but it's not all that complex once they've sunk-in. Just like when you go to a restaurant for a meal and go through a standard ordering procedure, web browsers and web servers also have a standard operating procedure.


Types of website

In this section I will explain the different types of website, and how they tend to be made, in order to help you decide what you want.
Along with the types of site below, sites can also be categorised as 'websites', 'intranets', or 'extranets'; this has little bearing on the technology used to implement them though.

Site of pages

This is the simplest kind of website, and was predominant in the 1990s. A site would simply be a collection of files stored on a web server. People would type in the appropriate URL, and the files would be viewed.

Pages did very little – "dynamic" or "interactive" features were usually limited to things like "hit counters" and fun graphical things.

A site of pages may still be appropriate for a limited few, but web users generally expect more nowadays.

Site of dynamic pages

One step up from a "site of pages" is a "site of dynamic pages". The distinction here is that instead of our website consisting of "a bunch of files on a web-server", our website now consists of files that generate pages dynamically. The website is now a computer program rather than a document. When a page is accessed by URL, the web-server now asks the computer program to generate a page for it to send out.

By making a website dynamic we can include things such as regularly updated news, without having to edit whole front pages to manually include links to latest articles as they are written. We can make pages interactive, randomise their content, and tailor them to the visitor who is viewing them.

All further types of website type described in this section consist of dynamic pages, but are extended to further levels.

"Content Management System" powered site

The next step from a "site of dynamic pages" is a site powered by a "Content Management System" (CMS). The line between dynamic pages and a full-blown CMS is indistinct, but generally a CMS will allow you to:
  • login to your website and to manage it from a special administration part of the website itself
  • manage/change/add things in an easy fashion that does not require you to be a computer programmer. The site will have less assumptions built-in (allowing you to manipulate content, rather than having to consider content, layout, and function all at once)

"Content" of a traditional CMS consists of well-organised pages or articles.

Composr CMS falls within this category of sites.

Web applications

The concept of a "web application" has been narrowed a bit over the years. They are generally considered full-blown interactive applications loaded up in a visitor's browser. They often consist of many separate components compiled and loaded up together into a single interface. Sometimes, you can also 'install' a web application to your phone or computer and run the website as if it were a native application on your computer (but it is only pretending to be) (we call this a 'progressive web application').

Web applications are often proprietary (closed source) and run as Software as a Service (can only be run off of the website hosting it and not actually downloaded to your system).

Web application suites

This is a super-set of web applications. A suite is a series of web applications offered by a company (often you use one account with the company to access all of the applications for which you have access). Examples might include Google (e.g. Docs, Sheets, Drive, Gmail, YouTube), Meta (e.g. Facebook, Instagram, Threads), Microsoft 365 (e.g. Word, Excel, OneNote, Outlook), and so on.

Headless sites

Headless sites have a separate front-end (for the graphics and layout) and back-end API (for getting the data, often including facilities such as web sockets to receive updated content in real time). This is very advanced functionality, but it allows great control over how the website looks and behaves. Developers can pair their favourite front-end frameworks or templates together with their favorite back-end headless Content Management Systems.

Often, web applications will run using some headless tools and functionality.

Content-type sites

Blogs are a good example of a content-type site. Blogs are like cut-down CMS, where the content consists only of very simple, and generally unorganised, news postings.

Gallery sites are also popular, where the content consists of images and/or videos.

Shopping-cart (eCommerce) sites

I'm sure you know what a virtual shopping-cart is due to websites such as Amazon. Shopping-cart sites tend to focus on products listings, and methods for choosing and purchasing products in-bulk. In many ways, a shopping-cart site is a CMS site that is focused on products.

Community/social-networking sites

Community sites provide features for interaction between users, such as:
  • member registration (to get a unique username and account)
  • discussion forums
  • polls
  • chatrooms
  • content-commenting

Through these features, a virtual community is created: members register themselves, and communicate with yourself and each other. Members tend to become further drawn in over time, and like in the real-world, develop a sense of belonging.

Portal sites

A portal site is a site generally centred around a vibrant front-page, where fresh and varied content is presented. Some forms of portal site are very corporate, and focused on providing facilities to a user (Yahoo!, for example), while others are more community-orientated.

Website builders

These are typically proprietary SaaS web applications which allow people to easily build websites through a drag-and-drop 'What You See Is What You Get' editor. While these services arguably make building a simple website very easy (as the person building the site often does not have to touch any code), they often lack the flexibility of using your own pages or Content Management System.

Trends

Over time small personalised websites have largely disappeared in favour of using larger corporate-run websites such as Facebook, or website builders such as Weebly.

Web applications have grown in complexity, as web developers have become increasingly aware of methods for interaction that are as quick and easy to use as normal desktop applications (due to the influence of Google / Chrome). These techniques are popularly named "Ajax techniques". Now instead of filling in forms, applications are being made that incorporate techniques such as "drag & drop".

There has been a lot of hype about "Web applications" over past years using different technologies, that you may not have heard of, such as "Java" or "SOAP" – but "Ajax" is used on a scale that these never actually reached.

CMSs are becoming more sophisticated and all-encompassing, with support for wider varieties of content. Forums (from "community sites") and galleries (from "content-type sites"), for example, are now available in CMSs alongside the more traditional articles and pages. One example of this is our own system, Composr.

And unfortunately the influence of larger corporate companies have pushed many people and companies to use locked-down and proprietary website systems. These usually come with questionable EULAs and Privacy Policies where the webmaster does not even own (or have full control of) their own data or site.

Overview of the advantages/disadvantages of different types of website

Site of Pages

Likely technologies

Simple collection of files (usually HTML and assets)

Likely deciding factor

Want to make simple pages, with little need to modify them again.

Cost

Low

Negative factors

Very tedious to update.

Unimpressed visitors.

Severe limit on functionality.

Options for you

Use an editing application such as Microsoft Frontpage.

OR

Employ a web-designer.

OR

Use a 'site builder' tool, like those that are often provided with webhosting.

Site of Dynamic pages

Likely technologies

PHP, Java, ASP, Ruby on Rails

Likely deciding factor

Want highly customised dynamic pages, but without a need to make regular changes.

Cost

Medium, assuming needs are limited to a very small set of specific features.

Negative factors

Very tedious to update.

Why not go for a full CMS? It's a similar cost, but with much greater value.

Options for you

Employ a programmer.

“Content Management System” powered site

Likely technologies

[Product]

Likely deciding factor

Want to be able to add content and not worry about page layout for everything added.

Have more advanced needs, such as the need to be able to turn content on and off, or have multiple members of staff.

Cost

Medium (something like Composr, which is free, but might take a bit of time to setup for a very tailored website)

Very high (a corporate-only solution such as Vignette)

Negative factors

As a more advanced technology, there is more to understand if the product is customised by the same person who is to regularly use it.

Options for you

Use a product such as Composr. Depending on needs and experience, employ specialists in Composr to get the website installed and customised.

Content-type sites

Likely technologies

[Product]

Likely deciding factor

If needs are very specific and common (such as only needing a gallery or a Blog).

Cost

Low

Negative factors

The potential for expansion is severely limited.

Why not go for a full modern CMS that incorporates the content-type (such as Composr)?

Options for you

Find an appropriate product. Depending on your experience, you may wish to employ specialists in Composr to get the product installed and customised.

Shopping-cart (eCommerce) sites

Likely technologies

[Product] / CMS customisation

Likely deciding factor

If you need to sell items from a medium+ inventory online.

Cost

High

Negative factors

An online-store must face complex sales tax, legal, and shipping issues.

Options for you

Find an appropriate product.

OR

Pay for a CMS to be customised. This would be appropriate when general-CMS features are needed as well as shopping-cart features.

Community sites

Likely technologies

[Product(s)] / Forums

Likely deciding factor

If it is desired for visitors to get involved with the site. Whether this is desired is often dependant on the “personality” of the organisation, but having a community can create brand value, improve customer service, help you engage with your users, and improve your market presence.

Cost

Low

Medium if you go with a proprietary product

Negative factors

When visitors can interact with each other on a “private virtual property”, issues of responsibility and exposure need to be considered.

Options for you

Find an appropriate product.

Portal sites

Likely technologies

[Product] / Bespoke solution

Likely deciding factor

If it is important to get repeat-visits for something other than the primary content of a website.

Cost

Medium (Product)

High to very-high (Bespoke)

Negative factors

It is difficult to effectively compete with large portals, such as that of AOL, unless the portal fits in a yet-untapped niché.

Options for you

Find an appropriate product.

OR

Hire programmers to create a bespoke solution.

Web applications

Likely technologies

Bespoke solution, often based on frameworks

Likely deciding factor

If something very unique is needed or if it needs to run like a desktop application would run.

Cost

Very high whether in finances or time

Negative factors

This is very high cost – it is full-blown software development, requiring a variety of different skills.

A development team writing a custom system has little incentive for their code to be easily maintained, as they can just charge you more if their code is difficult to update.

You will be charged every time you want to add a feature.

Your features won't be as tried and tested as those in an established product.

Options for you

Hire programmers to create a bespoke solution.

Do it yourself

Headless systems

Likely technologies

A Bespoke solution combining several products or frameworks

Likely deciding factor

If you have a really large intranet you want to run with different technologies

Cost

Very high whether in finances or time

Negative factors

This is very high cost – it requires a high skill set to understand how to put together the different frameworks necessary to build the site.

The maintenance level is very high because you must maintain / update every component in the system and ensure it does not break other things.

Options for you

Use Headless CMS or frameworks

Do it yourself

Hire developers and designers to put together a solution for you



Composr

Image

A screen-shot from a default Composr site

A screen-shot from a default Composr site

(Click to enlarge)

Image

Logging in to Composr

Logging in to Composr

(Click to enlarge)

Composr is a CMS that drives powerful interactive and dynamic websites, by providing a wide range of features that are useful on many different kinds and themes of website. For example, Composr can easily power any of the following:
  • a community forum
  • a corporate intranet
  • a corporate website
  • a personal blog
  • a community blogging system with thousands of different bloggers
  • a collaboration community
  • a community gallery
  • a simple shopping-cart site
  • a headless solution (via WebDav or Commandr-fs; see The Composr enterprise repository)
  • and much more, and any combination thereof

This section is just a very basic overview. Much more information about Composr's features is available on the main Composr website.

Image

Composr is an extendable architecture as well as a product

Composr is an extendable architecture as well as a product

(Click to enlarge)

Image

A screen-shot from the Admin Zone of a default Composr site

A screen-shot from the Admin Zone of a default Composr site

(Click to enlarge)

The Composr philosophy is that almost all cutting-edge websites, from hobbyist communities, to those of large international companies, share a large number of common needs. Composr caters for all these needs by providing a vast pool of features that can be used as a part of the website. As you expand or change your website, Composr continues to provide: you simply start using features that you did not need to use before.

At the time of writing, we do not know any other products that have such a large built-in feature set as Composr. However, Composr also excels in customisability: the features in Composr can be fully customised on a number of levels, so that even though different websites share the same engine, they can have their own individuality.

In addition, we understand that often users will have very specific, personal needs. For this reason, we make sure that the Composr framework is fully extensible, and provide numerous features to allow such extension to be achieved, suitable for different levels of expertise and requirements. It is important to understand that adding unique features can be difficult, as it is a programming exercise: but it is considerably less difficult than creating a new web application from scratch (even with a totally custom new module, most of the needs, such as user authentication, WYSIWYG editing, or secure database access, are already available). Professional developers are available for such work.

There are some situations where Composr is not the most appropriate product. You'll find these are documented on the main Composr website ("Antifeatures"). You should always choose the most appropriate product for any particular situation.

Why not product-X?

Most of the competitors to Composr are, like Composr, Open Source. However Composr provides the best of all the main competing kinds of system, seamlessly integrated, and centrally designed. Our quality standards are extremely high, and you will find:
  • wizards make performing important tasks very easy
  • interfaces are clean, usable and beautiful
  • we are quick to fix bugs (and we release hotfixes of them)
  • the documentation is very thorough
  • the terminology is consistent
  • Composr is modular, meaning you can uninstall large parts of it if you feel them unnecessary for your website
  • design principles are common throughout the system
  • the source code is easily editable for those with programming experience, with thorough code documentation
  • you do not need to mess around with individual files on your server to configure functionality: everything has a live interface as a part of the system itself
  • interfaces are consistent; for example, the same user data input system is used throughout
  • the system supports your roles in multiple different disciplines, from design, to programming, to marketing, and tries to make them all as accessible as possible

Composr vs third party services

The Core Development Team takes pride in developing integrated systems that provide as much functionality as possible without relying upon external services. Many of our competitors provide a content management framework, however their users often have to rely upon external services or third-party developers to produce embedded code or "plug-in" packages that provide advanced or interactive functions.

While Composr fully supports embedded code and provides a plug-in architecture, the core team believes that users should be able to construct (and extend) fully featured sites without relying upon external service providers or searching through an archive of unreliable/unsupported plug-ins. Thus, Composr comes with the most comprehensive feature set in its class, maximising site functionality straight "out of the box". This holistic design philosophy aims to ensure that all features on a site work harmoniously, while maintaining maximum design fidelity and providing a unified administration interface. This ensures that you retain full control over your data and guarantees room for your site to grow as and when your needs change.

If your CMS has a limited range of features, utilising external services to provide added functionality may seem like an attractive option for extending your website. Unfortunately, there are a number of risks inherent with third-party dependencies, which can be avoided by hosting your required features directly.

Firstly, every external service provider may have outages that can affect their ability to serve customers. As each third-party service can fail independently, this will naturally increase the amount of time that your site is unable to operate at full functionality. Hosting these features directly through your chosen CMS will ensure that your site will be fully operational for as long as your site remains online.

Secondly, third-party services may go out of business, change their terms and conditions or be targeted for a buyout, any of which can cause a permanent disruption to the service you had previously been able to utilise. When you do not control the means for providing site functions, there can be no guarantee that your chosen service provider will continue to operate under the same conditions of business or even continue trading as a viable concern (either of which could impact upon functionality that you may wish to provide). Any features hosted directly through Composr will be available for use whenever your site is active, ensuring that you are always free to make full use of your site.

Thirdly, there are frequently service limitations that aim to encourage subscription-based upgrades to premium services. This appears on the surface to be a relatively cheap option, however ongoing service charges will quickly add up to a significant cost. Without subscribing to a premium service, you may find that your features are subject to the following restrictions:
1)   Embedded advertising (e.g. YouTube adverts)
2)   Limited user-access (e.g. Free surveys on SurveyMonkey only accept the first 100 answers)
3)   Limited bandwidth (e.g. PhotoBucket accounts limit daily bandwidth for viewing images/videos)
4)   Limited customisation options (if any)
5)   Existing integration code may break if the service provider upgrades/changes their service

For example, many sites utilise the popular service "SurveyMonkey" to incorporate survey forms into their sites. Although this is a useful feature, it is extremely limited unless you are willing to pay to use the premium service. Utilising this service also means that a third party organisation has access to the data that you are gathering and you have become dependent upon a third party for a potentially sensitive business operation.

As an alternative, Composr provides a simple Survey system (via quizzes, polls, or catalogues) that can be integrated into any page you see fit, including forum posts and comment threads. As this system is a core part of your website, it can be used without any restriction or additional charge, the styling & fonts will always match that of your site, there is no requirement for you to display another company's branding on your site and there is no need to log in to a separate web-service to view and analyse your data.

When building an interactive site, it is vitally important to ensure a consistent interface that is free of third-party branding. This provides a more professional appearance, which improves the user experience and increases the user's perception of value and quality. Rather than building your site and picking from a range of service providers à la carte, combining multiple brands and user interfaces (which can appear cheap), Composr provides all of the tools required to provide a professional quality web presence.

Composr has been designed to provide integrated alternatives to the most common cloud-based services; Instead of embedding YouTube videos (with branding and advertising), Composr allows you to upload videos directly to your site. Rather than hosting images using Flickr and posting them to your blog, you can upload and incorporate images without ever leaving the Composr blog editor.

In terms of both risk and cost, there are significant advantages to hosting all of your features directly; Composr makes it easy to add new functions over time, often without any complex coding.

PHP

PHP is a very widely deployed scripting language to power dynamic websites. Because of its wide deployment, and because web applications for it are relatively easy to install from a remote connection, we chose to write Composr in it.

Information for programmers

The PHP language is heavily based on the long-standing C language, but PHP scripts do not require compilation and PHP provides a much richer feature-set (for example, powerful associative arrays, and a very large set of inbuilt functions). PHP has had a long history, evolving a lot over the years from a quick & dirty system to a very high quality language that matches other languages in quality, but beats them hands-down in efficiency. In some cases we have improved on the language via our own quality standards and assurance technology.


Enterprise vs Open Source

If you are from an 'enterprise' background, you'll be used to a different kind of lexicon and approach to what is common in OSS systems.

I'll try and summarise the difference in approaches between the two worlds:

Enterprise: Connect various big-iron systems together using web services. Each is a relatively closed ecosystem, is separately licensed, and has its own advanced interface. Either compilation of custom code is involved, or the use of relatively clunky proprietary scripting languages, and a separate skill-set for each bit of software.

Open Source: Systems tend to be more light-weight, focused on the core behaviours needed. E.g. Direct SQL queries to MySQL, rather than stored procedures (although you can do them if you want to). However, as the code is all open, and no special licences required, everything has been tuned in a meritocratic kind of way, so things tend to be simple but effective. Particularly for the case of PHP, creating new functionality is extremely time-efficient, because you don't need to compile the code, and you can just plug stuff directly into Composr and essentially have access to all our APIs without needing any web services, or limited public interface, or cut-down scripting system. Things are simple by default, and only get complex when you need to scale things out across multiple tiers etc. You can create tables directly in MySQL using any MySQL frontend you prefer (phpMyAdmin, MySQL workbench, etc).


See also


Feedback

Please rate this tutorial:

Have a suggestion? Report an issue on the tracker.