Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
TYPO3 4.3 Multimedia Cookbook

You're reading from   TYPO3 4.3 Multimedia Cookbook Over 50 great recipes for effectively managing multimedia content to create an organized web site in TYPO3

Arrow left icon
Product type Paperback
Published in Feb 2010
Publisher Packt
ISBN-13 9781847198488
Length 228 pages
Edition 1st Edition
Languages
Tools
Concepts
Arrow right icon
Toc

Table of Contents (13) Chapters Close

TYPO3 4.3 Multimedia Cookbook
Credits
About the Author
About the Reviewers
1. Preface
1. Getting Started 2. Managing Digital Assets FREE CHAPTER 3. Operating with Metadata in Media Files 4. Rendering Images 5. Rendering Video and Audio 6. Connecting to External APIs 7. Creating Services 8. Automating Processes

Rendering images using TypoScript


All the content objects available can be created using TypoScript. We will look at the IMAGE content object. Despite its simplicity, there are various situations, in which it is useful. For example, you might need to render an image on several pages, but don't want to include it in the template because it is dynamic. Using TypoScript, you can use conditionals to control which image is rendered, wrap the image in a link, and more. Here, we will first create a simple image, and then see what other options can be given.

How to do it...

  1. 1. Modify the template on any page.

  2. 2. Add the following code to the setup field, substituting page.12 with the path to the object or marker where you want the image to appear:

    page.12 = IMAGE page.12 { file = fileadmin/image.jpg
    }
    
  3. 3. Save, clear cache (if necessary), and preview the page.

How it works...

Content objects take certain parameters as an input, and provide HTML as output. In this case, the input is just a path to a file...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image