Book Image

Magento 2 Development Cookbook

Book Image

Magento 2 Development Cookbook

Overview of this book

With the challenges of growing an online business, Magento 2 is an open source e-commerce platform with innumerable functionalities that gives you the freedom to make on-the-fly decisions. It allows you to customize multiple levels of security permissions and enhance the look and feel of your website, and thus gives you a personalized experience in promoting your business.
Table of Contents (18 chapters)
Magento 2 Development Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Embedding an HTML object


In a product description, we can add HTML tags so that we can use the <object> tag. With an <object> tag, we can embed widgets, such as a YouTube video, social widgets, and more.

In this recipe, we will focus on how to add a YouTube video in a product description.

Getting ready

Go to http://www.youtube.com, and choose a video that you want to show on the product detail page.

How to do it

The next steps shows you how to embed a YouTube video on a product detail page.

  1. On the YouTube video page, click on the Embed button. When you click this button, the following screen shows up:

  2. Copy the HTML code and paste it in the description of the product.

  3. Save the product.

  4. Go to the product in the frontend. You will see the video on the Product page.

How it works

The ability to use HTML tags in product descriptions gives a lot of flexibility for this field. It is possible to use a WYSIWYG editor for the content because this allows us to use widgets, such as a YouTube video or...