Summary

Congratulations, we've learned what we need to do to make a better mobile version of our website, but, as importantly, we've learned how to use conditions in TypoScript to optimize our template for the users' needs. We covered the big two issues, browser dependency and mobile websites, but there is obviously a lot more we could do with these conditionals. As we saw in the first section, TypoScript has conditions for everything from the user's operating system to the day of the week on the server. This means that we can go even further with our customizations if we wanted and post special code every Friday, or we could send a different template to users who are coming from an internal IP address. On top of that, we can always use global variables and user functions to add our own special conditions. How do we do use this going forward?

First, we can send browser-specific TypoScript code with just a basic condition statement. We're not relying on CSS hacks, undocumented JavaScript, or "quirks mode" to make sure that our site renders correctly. We only have to send the stylesheets or TypoScript values that we want to send to each browser. If we have a specific stylesheet for Microsoft Internet Explorer, we can send it using a browser check. If our fancy menu breaks in Firefox 2.6, we can send a different menu to that browser. Most importantly, we don't have to know PHP or complex HTTP information to make conditional statements; it's just TypoScript.

Second, we can create a mobile site without building a whole new website. Everything we did to create a mobile site added up to twenty four lines of TypoScript, and half of that was updating the menu and logo objects. Of course, we also saw how we can create custom templates and redirect to mobile websites as well. Many site creators' aren't creating custom mobile versions because it will be too hard. By using TYPO3, that's not a problem for us. We can rely on the hard work already invested by the core developers to make our jobs easier.

Finally, we can think up our own ways to use conditions in our websites. Most of the time, it's too complex to know simple things about the operating environment unless we're used to hand coding PHP. Using conditional statements, we already have a whole toolbox ready to go. If we're building an internal website with logins and user groups, we can swap stylesheets and change the look and feel any time a user in our "Senior Executives" group logs in. Our boss will be impressed enough that we have a mobile website, but he'll/she'll be more than impressed when he/she logs in to the frontend site and sees a template specially tweaked for the executives' needs.

In the next chapter, we're going to learn about the next jump we can make to take our website experience worldwide: internationalization and localization. Those are some of the biggest buzzwords in web development along with "browser-specific" and "mobile", and we'll learn all about them in a minute. Just like the mobile website, we're going to see that TYPO3 has done most of the job for us already. All we have to do is use the tools its already provided. So, go show the mobile website to your boss real quick on his/her iPhone, grab some coffee, and come back ready to take our little example site multilingual.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.188.218.226