Home Web-development Building Websites with ExpressionEngine 2

Building Websites with ExpressionEngine 2

By Leonard Murphy
books-svg-icon Book
Subscription
$10 p/m for first 3 months. $15.99 p/m after that. Cancel Anytime!
What do you get with a Packt Subscription?
This book & 7000+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with a Packt Subscription?
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with eBook + Subscription?
Download this book in EPUB and PDF formats, plus a monthly download credit
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with a Packt Subscription?
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with eBook?
Download this book in EPUB and PDF formats
Access this title in our online reader
DRM FREE - Read whenever, wherever and however you want
Online reader with customised display settings for better reading experience
What do you get with video?
Download this video in MP4 format
Access this title in our online reader
DRM FREE - Watch whenever, wherever and however you want
Online reader with customised display settings for better learning experience
What do you get with video?
Stream this video
Access this title in our online reader
DRM FREE - Watch whenever, wherever and however you want
Online reader with customised display settings for better learning experience
What do you get with Audiobook?
Download a zip folder consisting of audio files (in MP3 Format) along with supplementary PDF
What do you get with Exam Trainer?
Flashcards, Mock exams, Exam Tips, Practice Questions
Access these resources with our interactive certification platform
Mobile compatible-Practice whenever, wherever, however you want
BUY NOW $10 p/m for first 3 months. $15.99 p/m after that. Cancel Anytime!
Subscription
What do you get with a Packt Subscription?
This book & 7000+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with a Packt Subscription?
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with eBook + Subscription?
Download this book in EPUB and PDF formats, plus a monthly download credit
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with a Packt Subscription?
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with eBook?
Download this book in EPUB and PDF formats
Access this title in our online reader
DRM FREE - Read whenever, wherever and however you want
Online reader with customised display settings for better reading experience
What do you get with video?
Download this video in MP4 format
Access this title in our online reader
DRM FREE - Watch whenever, wherever and however you want
Online reader with customised display settings for better learning experience
What do you get with video?
Stream this video
Access this title in our online reader
DRM FREE - Watch whenever, wherever and however you want
Online reader with customised display settings for better learning experience
What do you get with Audiobook?
Download a zip folder consisting of audio files (in MP3 Format) along with supplementary PDF
What do you get with Exam Trainer?
Flashcards, Mock exams, Exam Tips, Practice Questions
Access these resources with our interactive certification platform
Mobile compatible-Practice whenever, wherever, however you want
  1. Free Chapter
    Introduction to ExpressionEngine
About this book

ExpressionEngine is a flexible, feature-rich content management system used by top designers and web professionals across the world to build and manage their websites. It is written in the world's most popular web scripting language, PHP, and built on the MySQL database server. Are you eager to start creating websites with ExpressionEngine?

Written for ExpressionEngine version 2.1 and later, this book will give you clear, concise, and practical guidance to take you from the basics of setting up ExpressionEngine to developing the skills you need to create ExpressionEngine websites to be reckoned with.

You will begin with setting up a basic installation of ExpressionEngine. You will then learn how it works, before learning how to create and manage your website in ExpressionEngine. As you progress further into the book you will learn how to build an events calendar and how to build a photo gallery and before you know it, visitors to your website will be able to post comments, search your content, sign-up for a mailing list, and even send their friends an e-mail. As you consider the benefits of buying this book, you will learn how to manage members and member groups, how to optimize your website and avoid repetition, how to remove the index.php file for cleaner URLs, and how to take backups. At the end of the book, you will learn how to update ExpressionEngine to its latest version.

Publication date:
September 2010
Publisher
Packt
Pages
328
ISBN
9781849690508

 

Chapter 1. Introduction to ExpressionEngine

ExpressionEngine is a content management system that is designed to manage websites. This chapter will briefly review what ExpressionEngine is and what it can do for you.

 

What is a content management system?


A content management system (CMS) is software designed to make it easier to build and maintain a website. It acts as an interface between the database where your content is stored and the pages that your visitors see — providing an easy way for content to be added to your database and an easy way to retrieve the content and display it on your website.

A website has three parts to it:

  1. 1. The CSS stylesheet specifies how different components of your website should be styled — you can define margins and paddings as well as what colors and fonts to use.

  2. 2. The HTML code lays out the page. This code indicates where different components are and which styles from the stylesheet should be applied to them.

  3. 3. Finally, there is the content itself — the images, headings, and text that appear on your website.

Before content management systems came along, you either needed a database programmer or you had to have a static website with all your content stored in the same file as the HTML that lays out the page. For a small website, this is perfectly feasible. To update the website, you simply update the files and upload them to your server.

However, even with small websites, the person who creates the website is often not the person who needs to make updates to the site. With the content of the website and the HTML code intermingled in the same file, it is difficult to update the content without understanding the code. Due to this, the person who builds the website is often still called upon to make even minor adjustments, long after the website is built. This is not always practical, and so the site is not updated as much as it could be.

A good content management system makes it easier to update the website without any knowledge of the HTML that designs and formats the page. The person who creates the website still needs to know HTML in order to design the page, but the person who updates the website does not. Since the website is easier to update, the site changes more frequently, visitors come back more often, and the site becomes more popular.

A content management system can also turn your website from a one-way flow of information (you write the content, the visitors read it) into a more conversational website. Not only are visitors reading the content you wrote, they can add their own comments into the mix. Your site becomes dynamic, changing even when you are not around.

To illustrate the difference between a static and dynamic website, consider a news website. If, every day, the site had the same articles, you would stop visiting. Why would you read an article you have already read? To keep visitors coming back, it pays to keep the content of your website dynamic. If there is always something new to read, there is more incentive for your visitors to keep coming back.

 

Introducing ExpressionEngine


ExpressionEngine makes it easy to separate the HTML code from the content of your website. Once the design of your website is built, you can add new content to the website simply by filling in a web form, which then automatically saves the content to your database. It is easy enough that anyone can learn to do it.

The HTML code that formats the pages exist in templates. However, instead of having paragraphs of content inside these templates, like you would in most HTML files, your content is stored in a database and retrieved dynamically using special ExpressionEngine tags. These tags simplify the process of accessing the database, making it easy to build a database-driven website without any knowledge of database programming.

This separation of the HTML that builds the website from the content that is displayed on your website makes it much easier for the website designer to update the design without any risk of accidentally changing the content, and makes it easier for someone else to update the content without any knowledge of the HTML that builds the website.

With that said, ExpressionEngine also brings value even when you are building your own website. With HTML files, every time you want a new page, you have to create a new file. In ExpressionEngine, one template can be used to generate hundreds of pages of content on your website, with ExpressionEngine using the URL to determine what content to display. Furthermore, snippets and global variables allow you to re-use design elements across multiple templates. Reducing repetition in this way makes it easier for you when there are updates — if the logo changes, you only have one place to update, instead of hundreds of individual pages.

In addition, ExpressionEngine makes it easy to implement advanced features such as RSS feeds, a photo gallery, a mailing list, or a calendar. You can allow visitors to leave comments, or join your site as members.

Finally, ExpressionEngine comes packed with industry-leading features to keep your website secure and spam-free. You can require people to register as members before they can submit comments to your site, you can personally review every comment before it appears on your website, or you can allow non-members to submit a comment if they type in a CAPTCHA correctly (a CAPTCHA is a randomized image of letters that a person must correctly type in order to submit data; it ensures that it is not an automated spambot that is submitting the data).

Furthermore, you can prevent people from submitting the same comment twice, restrict how much data one person can request from your website in a certain timeframe (to prevent denial of service attacks), blacklist certain words so they cannot be used in comments, and blacklist URLs or IP addresses of spammers that you do not want accessing your site.

 

How does ExpressionEngine compare?


ExpressionEngine is not the only content management system on the market, and indeed, it is often compared side-by-side to open source and other free CMS/blogging tools. A question that is often asked on the forums is why should you pay for ExpressionEngine if you can get another tool for free?

The bottom line is that there is a lot more to the cost of building a website than the cost of the software. When you take into account all the hidden costs, ExpressionEngine provides excellent value for money.

The business case

Although ExpressionEngine is not free, it is very reasonably priced for the features (especially for a non-commercial license). The fee goes to support future development as well as software support via the forums. EllisLab employs a number of dedicated technical support specialists in a number of time zones who all diligently monitor the support forums. For you, this means that the response times are very good and there will be support when you need it. (If you are looking at a free alternative, you will often find support is provided on a volunteer-only basis or that the cost for commercial support far exceeds that of an ExpressionEngine license).

If you are a business choosing a content management system, it is reassuring to know that EllisLab is a company in it for the long haul. To stay in business, they need to keep ExpressionEngine attractive to new and existing users — by delivering a robust product that works, by providing world class support, and by developing innovative features that people want.

ExpressionEngine also has a vibrant and growing developer community, building add-ons that further extend the functionality in many ways (See Chapter 10, Extending ExpressionEngine for key ExpressionEngine add-ons). Many add-ons that are available are commercial-grade applications in their own right, easy to install, and complete with support so you can feel confident using these add-ons without the feeling that you are somehow hacking ExpressionEngine. ExpressionEngine 2's base in CodeIgniter (a respected open source PHP framework also created by EllisLab) has further increased the pool of developers, which is resulting in more and more high-quality add-ons. Generally speaking, if the core features of ExpressionEngine lack something you would like to see, someone else may have already thought of it and built an add-on that would meet your needs. If you need something a little more specific (that would not appeal to most users), ExpressionEngine maintains a Pro Network listing of ExpressionEngine experts that you could approach (http://expressionengine.com/professionals/) and there is also a job board forum where you can post your needs.

The bottom line is that ExpressionEngine is a solid choice for businesses and individuals looking to balance value for money with a high-quality product from a company that will be around for a long-time to come.

The technical case

You can always identify the best tools of a trade by looking at what the professionals in that trade use. ExpressionEngine is hugely popular among website developers and designers. Many web design businesses use ExpressionEngine for their clients almost exclusively, and the reason for this is simple — ExpressionEngine does not get in the way.

Other tools make it difficult to make your website your own. For example, they might make it easy to create an initial website (that looks like everyone else's), but then you have to invest a lot of time learning how to tweak the site to meet your needs (in addition to the time spent learning the software itself).

With ExpressionEngine, you are free to design any website you can imagine. If you look through the showcase of ExpressionEngine-powered websites (http://show-ee.com/) one thing that will stand out is that no two websites look the same. ExpressionEngine allows you to code a website using all the tools of the trade (HTML, CSS, JavaScript, and PHP), and then enhance that website by providing additional functionality that would be difficult to build from the ground up.

 

Who is this book intended for?


If any of the following sounds familiar, then this book is for you:

  • You have used HTML and CSS to build websites before and you are comfortable editing HTML and CSS by hand.

  • You have never used ExpressionEngine before. This book is a tutorial book, designed for new users of ExpressionEngine and will walk you step-by-step through everything you need to do.

  • You want to build an interactive, feature-packed website.

  • You want to get started using ExpressionEngine as fast as possible and you do not have time for lots of reading. This book takes a very hands-on approach and will get you using ExpressionEngine quickly.

 

Who is this book not intended for?


This book is not necessarily for you if:

  • You have never written an HTML web page before, but you want your own website. This book is focused on how to use ExpressionEngine, not on how to write HTML. Although you may be able to follow the book's step-by-step instructions, knowledge of HTML/CSS will allow you a better appreciation of how the example website is put together.

  • You want to learn advanced website building techniques and technologies such as AJAX, JavaScript, or PHP. This book does not set out to teach these things. However, anything that you learn from other books and tutorials on these subjects can be easily applied to a website powered by ExpressionEngine. The sky is the limit.

  • You have extensive experience in ExpressionEngine, but want to learn advanced tips and tricks such as add-on development. This book is intended as an introduction for new users to ExpressionEngine. That said, experienced users may pick up some new ideas or ways to do things — every ExpressionEngine user does things slightly differently.

  • You want a definitive guide to ExpressionEngine. As a printed book, it is almost a given that ExpressionEngine will have changed since this book was written. This book is meant more as a springboard into your own exploration of what ExpressionEngine can do and does not attempt to cover every available feature.

 

What can you expect from this book?


As with anything, you will learn ExpressionEngine best by using it. That is where this book comes in. By working through these tutorials on your own installation (particularly the first few chapters), you will gain practical insights into how ExpressionEngine can be used to build a website. Each chapter has step-by-step instructions; not a mouse click is missed. This makes it easy to follow-along and understand everything that you are doing and why you are doing it.

At the end of each chapter, there are exercises. These exercises are not designed to be particularly difficult, but rather to encourage you to problem-solve for yourself. Once you have completed the exercises, feel free to compare your solution with the suggested solution in Appendix B. You never know — you may even find a better solution on your own than that proposed at the back of the book!

Note that taking a step-by-step approach means that each chapter is not comprehensive — it does not tell you all the possibilities that could be. There are always multiple ways to the same solution and often the best way will vary depending on the individual site. Although the book will provide guidelines and best practices, the reality is that one template and template group structure might work great for a website with a small amount of content, but become unmanageable for a very large website. Likewise, the structure required for a very large website might be overkill if you only have a small amount of content. There is no one-size-fits-all solution. The aim of this book is to equip you with the basic training you need to venture out into the documentation or the forums and feel confident asking for help and experimenting with different ideas.

This book uses the example of building a website for a small business. The website starts out as a static HTML website. Over the course of the book, you will step through how to convert the website into ExpressionEngine and enhance it — re-writing the FAQs section to be more dynamic, allowing comments, setting up members-only content, adding a calendar, a photo gallery, a mailing list, and a search form. By the time you are done, the website will be barely recognizable from where you started.

 

New in this edition


ExpressionEngine 2 is a big update from ExpressionEngine 1.6. This book is also a big update from the first edition. First and foremost, the example site has changed to look and feel more professional — and more like a website you might want to build. The example website is adapted from a design by Free CSS Templates (http://www.freecsstemplates.org) and is released under a Creative Commons Attribution 2.5 license.

In the first edition of this book, a lot of valuable space was taken up describing HTML or CSS code. In this edition, much of the HTML and CSS will simply be provided rather than explained line-by-line, giving this edition more of a focus on ExpressionEngine itself.

Finally, ExpressionEngine 2 comes with many features that did not exist in ExpressionEngine 1.6. For example, with the introduction of snippets, how you might design and construct a website has changed. In addition, the control panel has been completely re-designed with new tools (such as an integrated file manager with built-in image-editing tools). Rest assured that this new edition has been completely re-written to show you how to work with these new features — it is not simply the first edition of the book with updated screenshots. After working through this book, you will be a pro at taking advantage of everything ExpressionEngine 2 has to offer. Enjoy!

 

Further reading and resources


While reading this book, you may want further information on a particular feature. Some of the most important resources are:

  • http://www.expressionengine.com/user_guide: The ExpressionEngine documentation is very comprehensive and it should be your first port of call when you want to learn more about a feature or tag.

    Note

    The ExpressionEngine documentation is always for the latest version. If there is any discrepancy between what you are seeing and what the documentation says, make sure that you are running the latest version of ExpressionEngine.

  • http://expressionengine.com/forums: If you have a question or need support on any aspect of ExpressionEngine, then this is the place to come. The forums are staffed by paid support representatives of EllisLab, as well as by hundreds of helpful members of the ExpressionEngine community.

    Note

    To get the best results from the ExpressionEngine forums, always search the forums first in case your question has already been answered. When posting a question, include as much detail as possible regarding what you are trying to achieve — include your template code and/or a link to your website, if possible.

  • http://www.eeinsider.com/: Ryan Irelan is a noted ExpressionEngine expert and this website is the best resource for ExpressionEngine-related news and information (aside from expressionengine.com).

  • http://devot-ee.com/: From Masuga Design, this website is the official one-stop shop for all ExpressionEngine-related add-ons.

  • http://show-ee.com/: The ExpressionEngine showcase shows you the huge variety of sites that have been built using ExpressionEngine and is a great place to get inspired.

  • http://mijingo.com/: Another website from Ryan Irelan. This one focuses on providing ExpressionEngine training resources. The EE Screencasts have long been a popular resource for new and experienced users alike. Ryan also has an ExpressionEngine 2 book available.

  • http://train-ee.com/: Michael Boyink's website is another source of tutorials, screencasts, and classes on all aspects of ExpressionEngine. Michael also has an ExpressionEngine 2 book available.

  • http://5by5.tv/eepodcast: The EE Podcasts are weekly videos discussing different aspects of ExpressionEngine. They are a great source of ideas and best practices.

  • http://eetemplates.com/ and http://www.woothemes.com/themes/ee-templates/: Both these sites provide professionally designed website templates for ExpressionEngine — useful if you need a jump-start on getting a website up and running.

  • http://director-ee.com/: This website is a directory of ExpressionEngine users and is a useful tool if you want to find ExpressionEngine developers in your area.

  • http://eehash.com/: This website is a compilation of ExpressionEngine news and articles from all the major ExpressionEngine websites, as well as from plenty of smaller websites that feature articles on ExpressionEngine.

  • http://codeignitor.com/: CodeIgnitor is the open source PHP framework on which ExpressionEngine is based.

  • http://mojomotor.com/: MojoMotor is EllisLab's newest product — a content management system that is less powerful and has less features than ExpressionEngine, but that allows you to edit your website content directly on your website (without a control panel). It is ideal for smaller websites and includes an upgrade path to ExpressionEngine, if you find your needs outgrow what MojoMotor can do.

  • http://www.enginehosting.com/: EngineHosting is EllisLab's website hosting service and specializes in providing both shared and dedicated hosting packages for sites running ExpressionEngine (as well as other dynamic web applications).

Last, but not least, you can download the code and other files required to follow along in this book, and you can view a working example of the example website used in this book at http://www.leonardmurphy.com/book2/.

Let's get started!

About the Author
  • Leonard Murphy

    Leonard Murphy was one of the earliest adopters of ExpressionEngine when it was first released in 2004, and was the author of a series of free tutorials that helped other new users to see what ExpressionEngine had to offer. The tutorials were a hit, and over the years, ExpressionEngine became more and more popular, so in 2008 Leonard expanded his tutorials into the first edition of Building Websites with ExpressionEngine. Two years later, with the release of ExpressionEngine 2, Leonard is back with a completely revised new edition.

    Leonard started his career in the UK, graduating from the University of Wales, Aberystwyth. In 2004, he moved to the United States and currently works for Summit Credit Union (a not-for-profit financial institution headquartered in Madison, Wisconsin). He also provides consulting and technical support for small business websites.

    Browse publications by this author
Building Websites with ExpressionEngine 2
Unlock this book and the full library FREE for 7 days
Start now