Introduction/Kasper Skårhøj
From TYPO3Wiki
Getting Started Tutorial
Introduction
What does it do?
This tutorial will introduce you to the basic principles of TYPO3. You will get started hands-on with your first TYPO3 website. After this tutorial you will have an idea of the capabilities of TYPO3 as well as complexities involved.
This tutorial will require you to install some software. If you just want to get a feel for TYPO3 before installing anything you should take a look at the demo-site at [http://demo.typo3.com/ http://demo.typo3.com/] first.
Professional creation of templates and development with TYPO3 in general are ''not'' covered in detail in this document! That is done in the next tutorial - Modern Template Building, Part 1 - and basically the remaining body of literature on TYPO3 development!
Screenshot
The example website in this tutorial is for a football club called "FC Bigfeet". The website looks like this:
With this simple website you will learn to:
- Edit and create pages, content on pages, insert images, tables, bullet lists, links etc.
- Create password protected areas of the website.
- Insert special content like email forms, search boxes, site maps etc.
- Create a guest book or a message board.
- Change colors, background images, fonts - even how to select another template!
- Manage backend users that maintain different parts of your website
- Create a workflow for news item creation on the front page
- How TYPO3 organizes pages in a tree structure and stores content.
Dedicated to
I would like to dedicate this tutorial to:
- All my TYPO3 friends I have got from the snowboard tours - meeting you and realizing there are people behind the emails is worth it all.
- My most lovely wife, Rie - thanks for all the patience and love you have shown, even when the work load needed your shoulders as well.
- My saviour, Jesus Christ - thanks for creating such a wonderful world with all its potential for us human beings to create beautiful things as well. Thanks for being the way and the truth and the life.
Happy reading!
Installation
TYPO3 is a web-application based on PHP4 and MySQL. Therefore you must have access to a web server with PHP and MySQL in order to try out TYPO3.
If you already have access to web server with PHP4 and MySQL then you can select "Installation A" below; you will have to download a zip-file, unzip it on your server space and that's it.
If you do not have a web server then select "Installation B" - that is a Windows Installer that installs all needed software (Apache, MySQL, PHP4 and TYPO3) in a few clicks - and removes it all afterwards if you like to.
Installation A - zip-file
Download the QuickStart Package
Go to typo3.org to get the quickstart.zip package (this package is no longer maintained, latest version as of 2007-07-11 is version 3.8.1 from 2005-11-14).
Unzip package on your web server
In my case I have a local Apache web server running. The web root directory is in c:\apache\htdocs - this is where I'll unzip the package (this is the same location as the installer package uses).
Start your webbrowser
Go the the URL where you unzipped the files:
In a brief second you will see this screen:
... but quickly you are directed to this screen (below) where you enter your database username, password and localhost.
Database username, password and host
In my case no username and password were needed (which is of course not very secure :-)
Create database
Then enter a name for your database. In my case "t3_quickstart" is selected. I always prefix TYPO3 databases with "t3_". That is nice if you have many different databases.
Dump database content
The final step is to "dump" some content into the database. A new database like "t3_quickstart" contains nothing of course - this step will put in a lot of information for our example website, fx. users, pages, content etc.
If you see a the "GO" become red now it means you are finished! Congratulations!
Well, lets check if it actually works now. There are two things to check - the frontend and the backend. (Read on in the section "Check the installation" after the "Installation B" chapter.)
Installation B - Windows Installer Package
Go to the package page on typo3.org and download the "WAMP - quickstart" Installer (thanks Ingmar) which contains the QuickStart website. The download is 28+ MB but worth it in terms of the trouble you save compared to installing on existing webservers - at least if you are here for a quick'n'dirty test of TYPO3!
Download installer
Click the download link, go for a bag of sweet candy in your nearby store and when you are back you will see this:
Click the "Open" button to start the installer.
Agree with the GPL License!
Then press "Agree" on the license screen. Notice that for once you can (probably) do this with perfect conscience since the GPL actually allows you to receive, copy, modify and distribute TYPO3 freely as long as the same rights to do so is passed on to the next recipient. The basic principle of GPL is that software stays free! (And that includes any modification / addition you make to TYPO3!). So just pass it on to your friends!
Options
Next... next... next...
TYPO3 installs itself in your start menu!
Probably you will accept this unless you have something else in this folder:
File copying
Then the thousands of files related to Apache, MySQL, PHP and TYPO3 are uncompressed to your hard disc. This takes a couple of minutes.
Errors? If in the process you encounter an error like the one below (a file with a special name that cannot be written) most likely you can just ignore it. I know it sounds a little odd to document stuff like this, but... :-)
Finished
After installing the files you are finished with the installation:
The final installation in "c:\apache" takes up approximately 140 MB of disc space and includes thousands of files. This is not all TYPO3 - remember both Apache, MySQL and PHP was installed...
In the START menu of Windows you can now find TYPO3 installed:
Start servers
Before you can play with TYPO3 start the two servers; "start MySQL" and "start Webserver".
When you start the web server (Apache) you will see an old DOS window. Don't close this window - it must be open, otherwise the web server will just shut down again. You can minimize it of course.
Next time you start your computer and want to work with TYPO3 you will have to start the web server again. MySQL has been installed as a service (has a little traffic-light icon in the task bar) and will be running already.
Hit you web browser
Type in "http://localhost/" and you should see this screen:
If you see this it means you are finished! Congratulations! Well, lets check if it actually works now. There are two things to check - the frontend and the backend. (Read on in the next section "Check the installation")
Check the installation
Check the frontend
The frontend is a term for the website TYPO3 generates. This is what your visitors will see - this is the product TYPO3 creates for you! The frontend should now be visible at the original URL you typed in (In my case it was http://localhost/quickstart/). You should see this screen after a second:
You can click the links in the menu to the left to explore the pages on the website.
Check the backend
The backend is a term for the administration interface you use to manage the website content in the frontend. In the backend you edit and create pages and content. The backend is normally accessible from the subdirectory "typo3/" of the installation. So try to type in "typo3/" after ".../quickstart/":
Log in
Now, type in the username "admin" and the password "password":
TIP: Make sure that cookies are enabled in your webbrowser! If you have disabled cookies you cannot login!
If you typed the correct username and password the screen will show you this:
Now, for the second time - and this time I really mean it - congratulations! TYPO3 has been installed, the frontend is working and the backend has let you in. You are ready to play around.
More details about installation
Please notice that this stepwise guide to installation only took you through the most basic requirements and is designed to get you quickly started for testing and development purposes. When you need to install and configure TYPO3 for production environments or serious development you must read and understand the background issues described in the document Installation and Upgrade of TYPO3. Further there is a mailing list and [http://typo3.org/1423.0.html archive] for seeking help on installation issues.
General principles
Backend and frontend
As you know from the installation TYPO3 is divided into two areas - the backend and the frontend. While the frontend is for everyone out there on the web - it is the website TYPO3 produces - only you and your content contributers are allowed access to the backend - the administration of the website. A username and password is always required.
Backend modules
In the backend there are a lot of modules in the menu to the left. When you want to edit and create pages, select the "Page" module:
Each module has it's own content to display. Since you are the administrator you have access to all modules. But there are other "normal" users - they have access only to the modules you have selected for them! Try to click the various modules in the menu and see how the content frame changes.
Pagetree
The header "Web" in the menu is called a "main module" and all the modules listed under it are "sub modules". All modules under the "Web" main module will show a dual view in the content frame - the page tree (left #1) and the module content in relation to a page from the page tree (right #2).
The page tree can be expanded by clicking the plus/minus icons (#3). This works exactly like folders on your own computer. Actually you can think about the page tree as a directory structure where web pages are organized in a hierarchy with main pages, sub pages and sub-sub pages etc.
Clicking titles and icons
The next important thing to know about the page tree is that you can click both the page icon and the page title - and that it makes a difference! If you click the page title you will see the current module display some content in the right frame:
In this case the "Page" module is the active one and then you will see the content on the page shown in the right frame. From here you can edit it etc. We will soon discuss that.
If you click the page icon instead of the title a little context sensitive menu appears. This is sometimes refered to as a click menu:
Notice: If you use older browsers the menu will not appear close to the icon but in the top frame of the backend instead. Further, be patient - the menu might take a few seconds to appear!
In the context menu you can select options that are related to this page! For most of them it is obvious that they do - try to play around with them if you like. For this example I have selected "Show" which means I will have another browser window opened and see this specific page shown in the frontend:
Notice how this pages was shown in the new window by calling the script ".../quickstart/index.php?id=13" (#1). In TYPO3 every page is stored in the database (in a table called "pages") and each of these page-"records" has a unique number (uid). Here the parameter called "id" was set to the value "13" - and apparently that must have been the uid-number of the page called "This week" in the page tree!
Further you can see the page content (#2) is the same as you saw (if you noticed) in the left frame of the Page module when you clicked the title! We will return to that. Then notice the page header (#3) - here the title of the page we viewed is shown ("This week") but the parent page in the page tree - "Results" - is shown as well. This communicates the logic of the page tree - that the "This week" page is a sub page (child) to the "Results" page (parent).
The final thing to notice is the menu in the left frame. This clearly reflects the hierarchy we also saw in the page tree:
The technical implementation of parents and children
This is for people who wants to understand how the tree structure works technically in the database:
Technically the relationship between a page and sub pages is established by the field called "pid" (parent id/page id) in the pages table in the database - the "pid" field of "This week" page will contain the "uid" value of the page called "Results". By holding the mouse over the page icon of the "Results" page for a second you will see this title-text appear:
This tells us that the page "Results" has the uid-number "4". We know that the "This week" page had the uid "13" (and the pages "Last week" and "Report results" have uid's 12 and 11).
If we go to the module "phpMyAdmin" and browser the "pages" table (which contain all the page header records) we should be able to see this relationship quite easily:
Clearly the three subpages to "Results" has their "pid" field values set to "4" - as we would expect. Now you have learned that
- Pages (and all other records by the way!) are uniquely identified by their "uid" field number - sometimes referred to as the "id"
- Pages (and all other records!) point to their parent page by their "pid" field number.
Special pages
Maybe you notice that some pages from the page tree was not shown in the menu of the website? Well, the pages were these:
Not in menu
The "Log in" page (#1) was not shown because the page type was set to "Not in menu". This is useful if you want to create a page which should not appear as a menu item. Still you can access the page by creating a link to it manually - or just type in its id-number in the URL directly!
Setting the "Not in menu" mode for a page is done by editing the page header:
Access restricted page
The "Team pages" page (#2) is not visible because it has been access restricted. This means it will only be shown when a frontend user has logged in. This is covered later in this tutorial. But the short story is that you edit the page header and select the user group you want to allow access for:
sysFolders - what is that?
Finally the two socalled "sysFolders" are not displayed (#3). You create a sysFolder like you created the "Not in menu" page - simply select "sysFolder" as the page type (see previously).
But what is it? Well, by default pages created in TYPO3 are meant to contain web page content. They appear in the menu and can have a title. 95% of all pages are used like that. But pages can also serve as simple containers of database elements that are not meant to be content on a visible webpage. This is what sysFolders are for! Use them just like you use folders on your computers filesystem to store different files in an organized manner! In the same way sysFolders are "folders" that nicely organize database elements inside TYPO3!
In this specific case the sysFolder "Users" contains the website users that can log in on the website (more about that later on). You can view the content of the sysFolder by using the "List" module (that is the "Explorer" inside of TYPO3...):
Shortcuts
Apart from the page types that did not show up in the menu there are also two mysterious pages with a "shortcut icon":
A shortcut is a neat feature if you have a page (empty, without content on) that should simply jump to another page directly! That is very convenient if you still want the link to appear in the menu for instance! In our case the "Home" page jumps to the frontpage and the "Results" page to "This week". Try it yourself!
You create shortcuts by editing the page type. For the "Home" page it looks like this:
You use the Element Browser to select a page to refer to. The Element Browser is used to create relations between records and files in TYPO3s editing forms. You can read more details on the Element Browser here. For the page "Results" the shortcut is a little more fancy - it simply jumps to the first sub page it finds! That is in our case the "This week" page:
The "Shortcut mode" is a socalled secondary option to the "Shortcut to page" field - that means the field is only shown (in the palette / top frame) when you click the "More options..." icon (see picture above).
Help at your fingertips!
Now, what might all the other interesting page types do? Well you can find out directly if you just click the little "?" icon close to the field:
Then a window like this pops up:
This is called Context Sensitive Help and can be found for almost all elements in TYPO3 where you need some information about its function! Use it! It's easy and it's right at your fingertips when you work inside the system!
Page content
Now we have looked at the page tree, seen how the page tree is reflected in the website menu hierarchy and how pages can be viewed etc.
The next question is - how is content on a page organized? Lets take a look at the "This week" page again:
The page content on that page is made up of three page content elements - here numbered 1-3. And because each content element can have a different type you can create pages with very flexible structures! In this case the page consists of a "Text" type content element, then two "Table" type content elements.
Side note: TYPO3 - an element based CMS
This method of constructing pages is a very foundational concept in most websites made by TYPO3. The method of putting together pages of content elements are also known from other CMSs today. This makes TYPO3 an "element-based" CMS. It gives a lot of flexibility but yet it makes the pages consistently designed - as it is one of the objectives of a CMS! The alternative method is a more fixed approach where a page has a fixed number of content areas - one for header, bodytext and image for instance. TYPO3 can do that as well (it can allow for anything you like!) but most likely you don't want that in the end. If you have some questions to professional implementation techniques for template-designs, content elements etc. please look in the tutorials called "Modern Template Building", Part 1 and [http://typo3.org/doc.0.html?&tx_extrepmgm_pi1[extUid]=490&tx_extrepmgm_pi1%5btocEl%5d=1289&cHash=049218db2e Part2+3].
For now, please notice that these documents are on a far higher level than this one and you should take one step at a time if you are a beginner to TYPO3.
Order of content elements
Well, back to the content elements on the webpage; take a look at them in the backend:
Make a comparison of the frontend and backend views now. Can you see how the elements from the backend are clearly the same as those in the frontend?
Try to rearrange a backend element by moving it up in the order:
This will yield this order from the top:
... and on the webpage it looks like:
Parent page of content elements
This is for people who wants to understand the technical side of content elements and pages:
Remember how the page records had a field, "pid", which pointed to their parent page? Well, page content elements (records) - and any other database record configured for the TYPO3 backend - has that as well. Looking in the phpMyAdmin module again we see that the page content elements (table: "tt_content") with uids 18-20 all point to the page uid "13" - the uid of the "This week" page:
It's that logical!
Edit and create pages and content
Edit page
We know that pages store their visible content in page content elements. So editing a page must be editing page content elements!
It's really easy to edit page content in TYPO3.
Just select the Page module (#1), click the page title of the page you want to edit (#2) and in the "Columns" view (#3) you click the edit icon (#4) of the page content element you wish to change:
This brings up this edit form:
First of all the field "Type:" (#1) tells you the type of page content element! In this case "Text". I could also be "Table" (like you saw earlier) or "Image" or "Text w/Image" etc. See for yourself! Each content element type has it's own look and fields for content and by inserting different elements you can achieve great diversity on your website.
The "Header" field (#2) contains the header and the "Text" field (#3) the bodytext. On the webpage this corresponds to:
Try to change the header field value and press "Save document and view page":
Because you saved by the bottom "Save document and view page" you will automatically have the frontend window shown to you in a few seconds:
Image:Getting started html 217f4498.htm
What TYPO3 did was to send the change to the webserver, update the database with the new information, then clear the page cache and regenerate the page - the change is instantly online and people surfing on your website will now see the new header instead of the old! It's that easy and fast to maintain webpages with TYPO3!
Tip: Another way to activate page edit
Instead of clicking your way from the "Page" module to the page tree etc. there is also an "Edit item" in the click menu which also brings up the Page module:
Tip: QuickEdit - save a mouseclick...
If you want fast access to your page content elements you can change the Page module view to "QuickEdit" instead of "Columns" - then the first content element on a page is shown right away:
New page
Creating new pages are very easy. Since pages are always organized in the hierarchy of the page tree you will have to settle for a position of the page first. Of course you can change that later if you like.
To create a new page use the Page module in Columns view to start the "New page" wizard - that will help you to find the right spot to insert the page:
Then a position selector will appear. By this you can click the right position for the page visually:
Finally a form for a new page is shown and you can enter a title of the page:
Save document and close. Now the page tree should be updated:
And if you click the page icon of the new page "Topscorer" you should see that the menu in the frontend has been automatically updated as well!
Notice that the page is refered to by the id "27" - so the new page automatically got the "uid" number "27" assigned during creation. The page is still blank - we need to create some page content elements on the page!
Creating page content elements
In the Page module, click the page title of "Topscorer" in the page tree and then the button "Create page content":
Immediately you will see a nice form like this (below). This allows you to select a page content element type - as I said earlier different content element types create different kinds of content on the webpage. Lets create "Text with image below":
Right away we get this form. Now enter some dummy content and select an image from your hard drive (find a small jpeg image):
Press the "Save document" button. Now the image is uploaded to the webserver and attached to the new page content element. This should look like this if everything went fine:
On the web page the page now looks like this:
Inserting another content element
Back in the Page module the new content element is clearly shown:
Notice: Missing the thumbnail? If you don't see a nice little thumbnail of the image here TYPO3 is probably not configured correctly for using ImageMagick. This is most likely the case if you did not use the Windows Installer Package (see the install section of this tutorial). Please refer to the information on installation found on typo3.org and the install mailing list archives. You can complete this tutorial without these features working though.
Click the button "New content" to create another content element with a bullet list after this one:
This time we have to make another selection in addition to the first one - where should the element go? Before or after the current page content element?
We insert it after the current. Now there is only the content of the bullet list left:
Notice that the "Type" was preset to "Bullet list" - this could have been selected manually instead. And you can change it as you like later on! If you want to know about the various content element types available remember the little "?" icon - right at your fingertips is the help!
Now the page has two content elements, a "Text w/Image" type and a "Bulletlist" type - in that order:
In the Page module this looks like this:
Management of content elements
You just used the "New content" wizard to create new page content. However the wizards in TYPO3 just makes a common task quick and simple by taking you straight to the important options. But under the hood all the features can be selected, fine tuned and controlled manually. You will realize this as you work with TYPO3. Take your time to explore the buttons and options. There are many possibilities and you can only get to know them if you take time to play around!
Here are a few examples of interface features you can try:
Creating a new page content element after the first one can be done by this button (#1). You will by default get a "Text" type element - just change the type to whatever you want. The button "Move record down" (#2) can be used to change the order between many content elements on the same page/column. Likewise you can use the "Copy", "Cut" and "Paste after" features from the click menu (#8) - they even allow you to make copies and move elements to other pages! The "Hide/Unhide" button (#3) is a quick way to change the "Hide" flag of the element and the garbage can (#4) allows you to delete the element totally (actually it can be restored if you do it by accident).
If you need to edit only the content in the body text area of the content element it's a nice feature to click the "Edit in Rich Text Editor" button (#5). This will bring up a "full-screen" window for editing the text - nice if there is a lot of text! Clicking the icon of the page content elements will as usual bring up a context sensitive menu for the element. Finally you can actually edit not only one page content element at a time but two (or more) by clicking the Column-edit icon (#7).
Move page
Moving a page is also very easy with the wizard available from the Page module. Lets say we want to move the page "Topscorer" from its current position to right after "Sitemap" in the "Home" section:
Then you will see a branch of the page tree and by clicking the top page you go up one level:
And by a single, logical click you have moved the page to the new position:
The page tree is instantly updated:
Using the cut'n'paste feature to move a page
The "Move page" wizard is absolutely the most intutive tool for beginners. However when you want to get the bigger picture of how to move elements - including pages - around in TYPO3 you should use the internal clipboard. It works pretty much like you know it from windows: You right-click a document, select "Cut", then right click the folder where you want to insert it and select "Paste". The same principle is implemented in TYPO3. Lets use that to move the page back again:
"Cut" the page:
"Paste after" the "Report results" page:
Answer "OK":
That's it! The page is back where it belongs:
Background: Watch out - consistent concepts on board!
Notice that the same principles of copy/cut/paste can be used with not only pages but page content elements as well - well, in fact any database element or file that TYPO3 manages is subject to this functionality! This is a great example of how TYPO3 uses the same concepts consistently and throughout the system - so once you have learned a feature, a lot of other features make sense to you as well! If you open your eyes to it you will have many of those "Aha!"-experiences when you see how things are designed to fit together.
Visibility settings - hiding pages, timing appearance etc.
A feature you will find for many elements - in particular pages and page content elements - is the publishing control fields or visibility settings. They look like this for pages:
For content elements they are in the bottom of the form:
Hiding a page
Try to check the "Hide page" flag:
Nice as it is the page icon even becomes dimmed in grayscale and has a little red cross over it - it's now hidden!
This means you cannot see the page in the frontend:
(Very important that you select "Show" for the "Last week" page!) See... no "This week" page there!
However if you actually go directly to the "This week" page you WILL see it anyways:
... because when you are logged in as a backend user hidden pages can be previewed - as indicated with the little box in the bottom of the page:
But! - that is for your eyes only. No one out in the world can see the page before you un-hide it again!
Timing pages and content elements
Hiding pages and content element is probably the most typical kind of visibility setting. It's so common that it actually has its own item in the context menus:
But you can also determine when a page should go online - which date! For instance try to enter the code "d+10" in the "Start time" field:
Automatically the date is set to the current date plus 10 days! If you save the page and hold the mouse over the icon you can also see this setting reflected:
And guess what - this page is currently not visible and will automatically be visible the 11th of April year 2003, 10 days later! That's how easy it is to control publishing of information based on Start times. The same principles work for the "Stop" field of course. And for page content elements, news elements, guest book elements - and you name it. Same principle - many places - easy to understand.
Rich Text Editing: Bold, Italics, Bullet lists, Insert images
When you are working with the body text on your pages you can use the same kind of formatting options as you are used to from your word processor. If you are using TYPO3 with Microsoft Internet Explorer you have access to a Rich Text Editor (RTE) for the body text field. "Rich Text" means that you can apply formatting to the text in addition to just writing it. Try to edit the body text field of the new "Topscorer" page:
Mark the text "my first" and click the "B" (Bold) to make the text bold:
By a using the buttons "B", "I", "U" and "Center Justify" you can easily achieve this look of the paragraph:
Press the "Save document and view page" button - you will see this in the frontend:
Creating a bullet list
You can create a bullet list just as easily. Just click the "Bulleted list" icon and enter a few lines:
Save and view - the frontend will show:
Considerations about "rich content"
As you can see - this gives you two choices:
- Will you create bullet lists "inline" in the body text fields or
- will you create them by separate content elements?
You can mix the two approaches. Personally I find it absolutely most convenient to just create bullet lists inside of body text fields with the RTE - but if someone with Microsoft Internet Explorer is going to edit the list it's usually very hard! And you might have "political reasons" for not inserting bullet lists in body text (keeping the body text "clean").
The RTE in more details
The Rich Text Editor may be very easy to use, but it also poses a lot of technical challenges when you investigate the details. There is extensive documentation available for the RTE. Read more in-depth about the RTE here and how to configure it.
Make links
Hyperlinks are what glues the internet together some say. In TYPO3 you already have links automatically made for you since the sheer creation of pages in the hierarchical structure of the page tree has generated the menu in the left frame automatically.
But you still might want to link from a piece of text to another page, a file, another website or an email address, right? This is very easy if you use the Rich Text Editor:
Simply mark the text and press the "Insert Link" icon:
Then click the title of the guest book page:
... and the text is linked:
In the frontend this will produce a link as you would expect. Click it and you are taken to the page with the guest book!
Behind the scenes
Before I told you that it might be a problem to use the Rich Text Editor if you expect to edit the content in raw form later on. You can simulate that by editing the whole content element and selecting the "Disable Rich Text Editor" option in the bottom of the form (before editing anything):
The "Text" field will now look like any ordinary form field:
First of all you can see that the link to the "Guestbook" page was made by a TYPO3-specific tag, <link>, combined with the page id. This makes it very easy to people without the RTE to create links as well! This is simple enough to write by hand. (Note: The internal "<link>" tag is converted to a proper HTML "<a>" tag when the page is generated).
Apart from that you can see the bullet list has been converted to a series of lines encapsulated in <typolist>-tags - also custom TYPO3 tags. These are also converted to a real bullet list by the template engine when the page is generated later on. The very first line contains regular HTML-markup for the bold, italic and underlining plus center alignment of the whole paragraph.
Other kinds of links?
You can create links to local files and external webpages - even links directly to a specific content element on a page (see the page "Last week" for an example and figure out how by yourself!). Finally links to email addresses can be created as well of course. Very easy.
Now, since we have disabled the Rich Text Editor why not just use the Wizard icon for full-screen editing:
Now write a new bullet list item, mark it and press the "Insert Link" button. Then select "Email" in the link type menu and enter your email address:
The result should be as expected after saving:
- a link which opens the users email client an makes it ready to write a new email:
Content element types
As you already know there are number of page content element types available and combining them is the key to create diverse web pages so not every single page on your site looks the same!
As a general rule of thumb - the longer down in the list an element is, the more advanced or rare is it in use. The absolutely most used element is the Text or Text w/Image element.
Wizards
Notice that some elements carry with it a little wizard. For instance try to edit one of the result-lists from the page "This week":
The "Text" field which normally contains pure body text now contains the table content apparently organized in some systematic way:
The table is constructed by interpreting each line in the "Text" field as a table row. Then the vertical line, | , is used to separate columns from each other. This is the "low level" way it works and it could be maintained by hand. But the "Table wizard" would be right tool to use for most people (see image above, right). This will bring up designated form fields and buttons for adding, deleting and moving table content around.
For instance adding a new row would be this easy:
Then add some content to the row:
Save the content from the Table wizard and back in the Text field the real, underlying content looks like this:
When the web page in the frontend is refreshed we will see this:
If you wonder how the background color could be changed - read on!
Secondary options - "Palettes"
From the dawn of times TYPO3 has held to the concept of primary and secondary form fields. The editing forms in TYPO3 contains a lot of fields and can be extended with even more. But many fields shown at the same time become very hard to overview for the average user. In particular if you are a beginner and have lots of new things to keep inside of your head already.
The concept of primary and secondary fields means that normally you see only the most important and typically used form fields (primary). And more detailed options are hidden in the secondary fields which are shown on request. Consider this form:
Three fields shown - easy to overview. But if you click one of the icons next to the fields you will find secondary options shown in the palette (top frame):
That is very clever - we have many options, lots of details but they are stowed away until we need them so we don't get confused.
The downside is when you need one of these secondary options and can't remember "behind which icon" it is (or if you use the field a lot) - then it might in itself be confusing to find them!
Therefore you can activate the option "Show secondary options" in the bottom of all editing forms:
The result is a big - and possibly confusing - form. But with all options available at once:
Notice how each row of options corresponds exactly to the content of the palette in the top frame if you clicked the "More options" icon like before!
So how do we change the background color of the table? In the secondary options for the "Layout" selector:
(The label "Color 2" refers to the color with that name configured in the website template.)
Frontend editing
The final note on editing pages is the frontend edit facility. I'm sorry that there are so many ways to do the same thing. By time you will appreciate this since you will find out what you like best and you can accomplish more work in less time because TYPO3 offers these features.
But frontend editing is not just a new button - it might actually be a revolution to the way you or your content contributers can work with the system. You have probably noticed the small edit-icons that has appeared on the web page:
Try to click one of them:
Instantly you are taken to a form where only the header field and other relevant information can be edited right away!
Try to change the header text and press "Save document and close" - you are taken back to the webpage and the change is immediately there:
This is what frontend editing is - very intuitive, great for correcting small mistakes, making small adjustments, excellent for poorly skilled content contributers on your team etc. It is the context sensitive editing method - raw power at your fingertips.
So can everyone just edit my pages?
No, of course not - only when you are logged in in the backend. Otherwise the icons are hidden - and if anyone could click it we would be immediately rejected. Try it yourself - log out in the backend:
If you still have a frontend page with icons then try to click one - you will see this screen instead of the edit form:
... and when you refresh the webpage you can see that the icons are gone now:
Now, log in again at http://localhost/quickstart/typo3/ (username = "admin", password = "password")
Password protected pages
Now you know how to create and edit pages! That was not so hard, was it? Quite easy to become a webmaster with TYPO3. Later I'll even show you how you can delegate that work! The point of a CMS is also that you can have many users maintaining content on the same website! With full control over access rights etc. But that is described in the end of this document.
So one thing is to make web pages for all the world to see. What if we would like only a part of the world to see them - our football team mates? Can we add password protection? Actually that is already done for you on the website for "FC Bigfeet":
These pages in the page tree are in fact only accessible from the frontend if you have a username and password!
Log in
If you want to log in, go to the page "Log in":
Then enter the username "john" and password "football" (for your convenience it's the same password for ALL users in the website for now). Make sure to enter it precisely as stated here - upper- and lowercase characters make a difference. "John" will not work - it's "john"...
Click the "Login" button - you are now directed to the "Team pages" (unless you did something wrong...)
Also notice that now the formerly hidden pages in the menu are visible:
Create users/group
Before you can create access restricted pages you must first and foremost have one or more frontend users and groups. These can be created before, during or after creation of your website. The order doesn't matter.
Frontend and backend users
Now, wait a minute! How many kinds of users are there?
Well, there are only two kinds. Remember that we have two areas of TYPO3 - the frontend (website) and the backend (administration).
A frontend user (orange icons) can log in on the website of course. They cannot change content (since they have nothing to do with the backend!) but they merely exist because it allows us restrict access to information on the website!
Frontend users (also called "Website users") are created in the system where we want to create them. In our case we have made a nice sysFolder called "Users" for both users and groups. The only requirement to this storage place for the frontend users is that we tell the template that this is the place to look for the users when a login request is sent - more about that in the section on Templates.
If you want to create web applications with user profiles in TYPO3 you will probably use the frontend users as a basis for an extension which can add additional database fields to the user table - thus you can store and manage custom information about website users!
A backend user (blue icon) works in the backend and is concerned with changing the information behind the scenes. Because backend users are concerned with the administration of a website they have nothing to do with the access restriction on the website itself (which is only partially true of course since backend users can preview hidden frontend pages).
Backend users can be created only one place - in the page tree root (pid = 0) - and only by backend users that are "admin" users (have the admin-flag set, which is indicated by the red colored icon!) since they are the only users with access to records in the page tree root:
The three blue backend users (#1) are configured so they can maintain a little part of the website each - more about that in the users section later on. The backend users groups (#2) would had been blue as well if the "Access lists" flag had not been set - forgive me for that...
Note : If this option is disabled the Access Lists cannot be configured for the group. When Access Lists are disabled the icon for the group is blue while it is red when Access Lists are enabled.
Finally the "admin" user (#3) - the one we are working as - is red because he has total and unrestricted access to any part of the system!
Editing a user or group
As you can see we already have a sysFolder with a user group and two users.
The user group "Team" is really nothing but the title of it. Not settings or anything. The users "john" and "irene" are configured basically the same - just a username, password and membership of a group:
(Ahh, that's right! You haven't used the List module yet - now, how hard can it be? Just click the icon and the good old context menu appears. Back on the home court again. I told you - watch out for consistently applied concepts!) And here is Johns profile:
Creating a user
Lets try to create a user. Since frontend users (like page, page content elements, news articles etc) are just database elements in TYPO3s opinion the same proces of creation can be used for a frontend user as for any other element. So this is even a general introduction to creation of new elements!
Ready? It's simple. First, click the page icon of the page where you want to create a new element:
Then select the "Website user" element:
... and enter the information. In this case username, password and group is required fields:
Save the user. If you click the page title of the "Users" sysFolder you should see this listing (provided the "List" module was the last backend module you used of course):
Go to the login form page again and see if it works:
Create login form
We already have a login form. But what if we want another one on the frontpage? Is that a problem?
No, since TYPO3 constructs page content by a series of page content elements as you have learned we can simply insert a login box as one of the content elements on the frontpage!
The question is rather where among the other elements. Now, do the trivial: Page module -> Click "FC Bigfeet" -> "New content"
"Login form":
Select position:
Name it - save it:
If you enter a page reference in the "Send to page" box the login will be submitted to that page. This is used with the other box so the user is directed to the access restricted section directly. In this case we will just leave it empty which will submit the form to the same page - the front page. On the front end you will see this:
As you can see we are already logged in - as "newuser". You can try to logout and login and logout and ... as you like. It should work.
Create restricted page
Now you have:
- Users and groups in place
- A login form in place
(please see the Template section on constants for important notice on configuring the storage page id for the login form) - You need... to restrict some access!
Lets restrict the whole section called "Youth Section":
Select the access to be only for the members of the "Team" group:
And save it. The page icon changes. Try to hold the mouse over the icon:
See! Access restricted to the "Team" group. Try to log in and log out. Works? Should do so.
Oups!
Try to log out and view one of the sub pages to the "Youth Section" page. You will find that those pages can be seen! So only the "Youth Section" page was protected!? Yes, that's true - because you need to set an additional flag - "Include subpages". Edit the page header and set the flag (bottom of form):
The page icon changes to include a double-forward arrow - this indicates that now all subpages are in fact protected as well!
Tip: "Include subpages" affects not only the Access setting - it also affects if a page is hidden or has a Start or Stop time set. Thus you can also time or hide a whole section by using this setting!
The Access options
Basically access restriction works as simple as this - just select a website user group and that's it. From that point you just handle which users are members of which groups.
Groups... Ahh, yes, we have only one group right now! The "Team" group. If you add more groups then you can create different access rules for different users! For instance "john" can be a member of "Team" and access the "Team" section. "irene" could be a member of a new group used for access restriction of the "Youth section" and she would have access to that! The "newuser" (we created) could be member of both groups - and have access to both sections! Why not try it out! Go and play with it.
Finally the option "Hide at login" means that a page will not be visible when a user logs in! This is useful if you have pages with information only relevant for users not yet logged in. Of course the option "Show at any login" is the opposite - that will enable the page for display for any user who is logged in. No need to be a member of any particular group - if you are logged in you are shown the page.
Special content elements
Previously you have been introduced to page content elements in general. So you know how these work. In this section I would like to show just a few examples of special content elements that are nevertheless quite popular. For instance how can you make an email form? Or a search box to search your site content? What about a guest book?
Well, just read on and you will see.
Email form
We already have an email box on the website. If you go the the page "Contact" you will see such a form:
In the backend the content element that creates this form look like this in the Page module:
By the way, notice the "Thank you" page that is a sub page to the "Contact" page! Now, edit the element. This is the form you see:
The content is apparently even more "code-style" than with the "Table" type content element! But as usual - click the wizard icon and you can edit the content with a tool that makes it all much easier!
As you can see the codes are transformed into this nice form. Here each field in the form is created by visual controls. For a field you need to enter a label of course (#1) and a field type (#2). This is the visible parts. You also have to give the field an internal name (#3) which is the one that will be shown in the email the recipient gets. In the case of "Input field" types you can also enter a default value (#4).
For all email forms there are three common values to be set: The name of the send button (#5), the subject line of the email being sent (#6) and finally the email address of the person that should receive the email (#7). This person is normally you! Or whoever on your team that is supposed to respond to feedback.
Adding a selector box
Now, lets try to add a select box where people can select an item to receive. In "FC Bigfeet" we have year calendars, the club magazine and pencils that we send to people.
Simply select the "Selector box" type:
Then the "Refresh wihtout saving" button (which does not save the content - just posts the content and redraws the form!)
Then enter this information:
The label is obvious (#1). The fieldname "item_to_send" (#2) is not visible on the webpage but as I wrote before - that is the name the email recipient will see to identify this selection! Finally each value you want in the select box is a line in this text field (#3) - as simple as that. Save the content from the wizard and view the page:
That easy!
A few notes
Now, in the backend the new selector box was added in the lines of code in the "Configuration" field:
If you are curious about it try to look at the line and you might actually figure out the syntax of creating form fields without the wizard:
When you loose your patience you can seek help in the TSref documenT where a section tries to describe the details. But be forewarned - this is the low level technical matters that you are not used to yet!
Another important thing is the "Jump to page" - this field simply tells TYPO3 which page to jump to when the form is submitted.
In other words - when the user has filled in the form and pressed the "Send form!" button he will be shown this page which contains... an ordinary page content element with this greeting:
Quite simple right? Very flexible.
Troubleshooting
On windows servers there is a good chance that the mail function will not work. If you send the form and get an error message from PHP then you are most likely without an smtp-server or whatever PHP needs to send mails. On UNIX this is normally working out of the box.
Search box
The next project is to implement a search box. That is even more easy and one has already been created on the page "Search":
The element itself is extremely simple:
Basically its only the content element type set to "Search" - that's all. In this case there is also a "Send to page" field but not used. Does the same as the "Jump to page" field for email forms - it tells the element which page should receive the search request (which must contain another "Search" content element in order to show results!). If not given the current page will. This is quite normal with search boxes.
Conducting a search
When searching for the word "results" two pages come up:
Try to click "Report results" title:
























































































































































