11 MAMP & WAMP

MAMP is for server side technologies on the Mac. WAMP does the same for windows. I only talk about MAMP. If you are using a PC, replace MAMP with WAMP.

It is an acronym that stands for either Mac or Windows, Apache, MYSQL and PHP. Apache is the web server, MYSQL is the database and you all know about PHP.

MAMP allows you to run PHP and CMS on your computer, rather than relying on a server and internet connections, which can be slow or not functioning at all, as we have witnessed. Once you have a developed a site using MAMP, it is possible to transfer the PHP documents, resources and database information to a server.

Linda.com has a tutorial on how to install MAMP for wordpress

Accessing PHP files

Download MAMP. Run the MAMP software. The initial settings allows you to access information stored in the htdocs folder, located inside of the MAMP folder in your Applications folder. If you place a hello.php file into that folder, you can access it by typing http://localhost:8887/hello.php in the browser address bar.

Text for the “hello.php” file:

<!DOCTYPE html>
<?php
echo "Hello World!";
?>

That’s it! You should see “Hello World!” when you open the page. You can develop your modular final in a local environment with includes such as PHP navigation. This should make the process much more immediate.

Running WordPress

Download WordPress. Install the uncompressed WordPress files into the htdocs folder. Do not drag the folder itself, just the files inside of the folder.

WordPress requires the MYSQL database. MAMP takes care of this, but you need to manage it using Sequel Pro.

Download Sequel Pro. For Windows, try MYSQL Workbench. Open Sequel Pro and click on the Socket tab. The host name will be localhost. Default user name is root and Password is root.

This information can be found on the Open WebStart Page of MAMP. Enter name and password and hit the connect button.

Create a new database for WordPress to use by clicking in the menu and elect add Database. Make up a simple name.

Go to the localhost root folder in the browser: http://localhost:8888/. This will bring up WordPress’s famous five-minute installation process.

WordPress asks you what language you want to proceed in. Select the language and click continue

It tells you what information is required to connect to the database. Click Let’s go!

Fill in the name you gave the database, the User Name and the Password. Click Submit.

WordPress tells you that everything you have done has worked, and you can run the WordPress install. If not, you did something wrong. Click Run the install.

WordPress requires more information, like the Site Title, Username of the Administrator, Password, remain address. Click Install WorldPress when you have completed all of the information.

You now have your own locally hosted WordPress Site!

14 WordPress

You have learned how HTML and CSS work, and you can build a website. Most web sites in the real world are not hand coded, but use a Content Management System, or CMS. While a CMS does not have to use a database, most do.

CMSs

High end CMS programs run sites like Google, Amazon or financial institutions. Most sites do not need that kind of performance or redundancy, and are built using open source software, usually PHP with MySQL as the database.

WordPress, Drupal and Joomla are three popular CMS. WordPress has become the most popular of these, even though it is the least CSM like. Comparison between the three main CMS platforms.

Each of these CMSs work very different, though all use PHP to construct the pages out of information provided by the database, and content stored in the site itself, on the basis of a template.

To modify the look of the CMS, requires modification of the template. You build your website by designing the template. The CMS does the rest.

WordPress

We focus on the most popular choice. Because there is not enough time in the class, I leave developing your own WordPress theme as an alternate choice.

You will be able to create a template from scratch by following the short course: WordPress 3: Creating and Editing Custom Themes with Chris Coyier of CSS-Tricks. To click this link, you first need to log into the Newschool Portal –> Library –> Databases –> search for Lynda.com, click on the link, go to Lynda.com, sign up for an account, and then sign in. You can then use this link to go to the tutorial and download the accompanying exercise files. Lynda.com.

When A Dynamic Website is Not the Best Choice

Dynamic websites are the best thing since sliced bread, but they come with one big drawback. If you do not keep up with the software, they can contain exploits used by people with malicious intent. This can render your website hacked. This is not possible with a conventional, hand coded website.

If you plan to not update your portfolio all of the time, it better be a hand coded site. If you plant to keep up with the software updates, then by all means, use a CMS.

Installing WordPress

You will find all the resources you need at wordpress.org. You start by downloading WordPress. Put all of the files in the directory you want WordPress to appear in.

You will go to that directory, and you will be guided by the WordPress Installer. You will need to know the name and password of the database that WordPress is to use. The installer will take care of setting up everything else.

See MAMP & WAMP for setting up WordPress on your own computer.

Chris Coyier outlines a great way to experiment by using a local MAMP installation at both Linda.com with a video tutorial or the Video on CSS-tricks.com. That’s a sure way to become familiar with using WordPress as the basis for building web sites.

WordPress Template

WordPress comes with a default templates. It is possible to modify them. The problem with preexisting templates is that if they are not exactly what you want, even though they are 95% of the way there, that extra 5% sometimes requires a lot more work than you would expect, as you have to deconstruct the template and rebuild it the way you want. It can take less time to do it from black template. That is why a better way is to design the template from scratch. Start with a blank template Chris prepared.

Having installed WordPress, you need to add this to the “themes” folder in the “wp-content” folder. Once it is there, you can activate it from within the WordPress Dashboard.

Yes I am going through this rather very fast, in part because we could never cover the whole topic anyway, and this is just to give you a taste of what is to come. Please do Chris’ tutorial if you want to learn more.

WordPress File Organization

Inside the blank template folder, you will find an index.php file. That is the main file creating each page.

You learned how PHP is able to include a number of files. That is what happens here. Everywhere you see a “get_” PHP will insert an associated file in that place. This is what the index.php looks like:

<?php get_header(); ?>
	<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
		<div <?php post_class() ?> id="post-<?php the_ID(); ?>">
			<h2><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h2>
			<?php include (TEMPLATEPATH . '/inc/meta.php' ); ?>
			<div class="entry">
				<?php the_content(); ?>
			</div>
			<div class="postmetadata">
				<?php the_tags('Tags: ', ', ', '<br />'); ?>
				Posted in <?php the_category(', ') ?> |
				<?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?>
			</div>
		</div>
	<?php endwhile; ?>
	<?php include (TEMPLATEPATH . '/inc/nav.php' ); ?>
	<?php else : ?>
		<h2>Not Found</h2>
	<?php endif; ?>
<?php get_sidebar(); ?>
<?php get_footer(); ?>

You will notice that the index file pulls in the header.php, the sidebar.php and the footer.php files, in addition to the loop that fetches the current post.

Here is a list of all the files in the template:

404.php
archive.php
comments.php
footer.php
functions.php
header.php
index.php
page.php
screenshot.png
search.php
searchform.php
sidebar.php
single.php
style.css

You need to understand that the HTML page that you otherwise code as one entity is here divided among these different files. It is quite easy to transfer your static website to a dynamic WordPress site by dividing up the web page into the existing pages like the header.php, sidebar.php, footer.php, etc.

The good news is that the CSS styles are included as an external stylesheet “style.css” exactly as you would expect.

As you translate your existing website to WordPress, you will once again learn everything that you have learned in class over again, but this time, you will be applying it to the modular structure of a dynamic php / database driven site.

There are many benefits to such a dynamic site, and a few drawbacks. Dynamic sites are a little slower and unless you keep up with the latest software, can be insecure, but that is not that large a price to pay when you add in all the benefits of a dynamic site.

I understand that this is all a little much. This is meant as a brief introduction. Watch the tutorial, and you will use WordPress to build your sites from that point on.

14 CMS: WordPress / Final Review

Week 14
12/10

Content Management Systems The basis of most professional websites is a CMS. We will take a look at how a WordPress template pulls together different PHP modules into a single HTML page, and how the CSS controls the look of the site. Activity: Modify a WordPress template, using it as the basis for our own design. Activity: 15 minutes will be taken to complete on-line student evaluations. Activity: In-class final Workshop #3.

Homework

You will be working on your final and other assignments. If you have extra time on your hands, you can build a WordPress template.

Materials

Additional materials for this unit can be found by following these links:

Goal

The goal of this unit is to:

  • Everyone is pretty busy with their finals, but I thought to wrap up the course with a guided tour of a WordPress template.
  • look at how PHP creates the WordPress Website out of different sections.
  • take a detailed look at the WordPress style sheet.

Outcomes

At the end of this unit, students will have:

  • been exposed to a content management system (CMS).
  • worked through WordPress template.
  • understood how PHP combines the page out of disparate files.
  • will have been helped with any outstanding issues remaining in their final project.

Step-by-Step

20 Review homework and answer questions.
40 Show and Tell: Content management System — WordPress: new site

15 Student Evaluations: I will leave the room while you fill out the evaluations.
10 Break
80 In Class Help on the Final

News and External Resources

Sources of information that will enrich your knowledge about web design and will help you to stay current:

  1. Move the Web Forward is the hub for how to engage the web community once you have joined it. You have all joined this community by now, and this will be a continually updated resource at the center of the web design universe.
  2. Changing the World! Web Governance
  3. Paul Irish Industry leader.
  4. Eric Meyer The original Industry Leader that helped bring in Standards based web design.
  5. Jeff Zeldman Another industry leaders that helped bring in standards based web design.

There are, of course, many more resources, but in this ever changing fast moving web culture, you can count on these to move the web forward. This will keep you going.

  1. One last article that introduces freelance bidding sites.

    As long as you are a student, your courses provide you with projects, but if you are graduating, I highly recommend checking these sites out, and doing a number of projects, if not for the money, for the experience, so that you can build up your portfolio.

Definitions

These are the terms that participants should be familiar with during this unit: