Mohamed Abbas | Architect Magento | Tech Blogger | Magento Trainer

Mohamed Abbas
Mohamed Abbas
Architect Magento | Tech Blogger | Magento Trainer

How to Create and Customize CMS Pages in Magento 2

 

Introduction: Magento 2’s CMS (Content Management System) pages are a crucial feature for building engaging, content-rich web pages like “About Us,” “Contact,” or landing pages. These pages allow you to add valuable information to your site, helping improve user experience and SEO performance. In this guide, we’ll walk through the steps to create and customize CMS pages in Magento 2, offering tips to make them visually appealing and functional.

Table of Contents:

~ Overview of CMS Pages in Magento 2

~ Steps to Create a New CMS Page

~ Adding Content to CMS Pages

~ Customizing the CMS Page Layout

~ Applying Custom Styles to CMS Pages

~ Using Widgets for Enhanced Functionality

~ Setting SEO Properties for CMS Pages

~ Publishing and Managing CMS Pages

~ Conclusion


1. Overview of CMS Pages in Magento 2

Magento 2 CMS pages are a part of the platform’s content management capabilities, allowing you to add static pages to your store. These pages are versatile and can be used for various purposes, from promoting products to educating customers. CMS pages can be enhanced with custom layouts, images, widgets, and even custom CSS, making them adaptable to your specific branding and messaging needs.

2. Steps to Create a New CMS Page

To create a new CMS page in Magento 2, follow these steps:

  • Navigate to the Admin Panel: Go to Content > Pages.

  • Click “Add New Page”: This opens a new page creation form.

  • Enter the Page Title: This title will appear in the browser tab and in the Magento page list.

  • Set the URL Key: Define a URL key for the page (e.g., “about-us”). Magento will generate the full URL, which typically looks like yourdomain.com/about-us.

  • Enable the Page: In the Page Information section, make sure to set Enable Page to “Yes” to make it live on your site.

These basic steps help you set up the structure and visibility of your new CMS page.

3. Adding Content to CMS Pages

Adding content to your CMS page is essential for delivering valuable information to visitors. Here’s how to add and format content:

  • Open the Content Editor: In the “Content” tab, click on the “Show/Hide Editor” button.

  • Use the WYSIWYG Editor: The WYSIWYG (What You See Is What You Get) editor allows you to format text, add images, and insert links easily.

  • HTML Editor: If you prefer, you can use HTML to structure the content more precisely by switching to HTML view in the editor.

  • Insert Images: Upload images using the “Insert Image” tool in the WYSIWYG editor to add visual appeal.

This allows you to build a CMS page that’s both informative and visually engaging.

4. Customizing the CMS Page Layout

Magento 2 offers flexible layout options for CMS pages. You can choose from different layout templates to create the look and feel you need:

  • Go to the “Design” Tab: Select a layout from options like 1 Column, 2 Columns with Left Sidebar, and 2 Columns with Right Sidebar.

  • Apply Custom Layout XML: For advanced customizations, you can use custom XML code in the “Layout Update XML” box to manipulate page structure (e.g., hiding certain blocks or adding new ones).

  • Customize Block Content: Add dynamic blocks by configuring CMS blocks that you can place in specific layout sections.

By customizing layouts, you can ensure your CMS pages fit the unique style and functionality requirements of your store.

5. Applying Custom Styles to CMS Pages

To enhance your CMS pages’ appearance, you may want to apply custom CSS styles:

  • Add Inline CSS: You can add inline styles directly in the content editor using <style> tags.

  • Use Theme CSS: If your store theme has custom CSS files, you can reference classes and styles directly on your page.

  • Use Custom CSS Files: For extensive customization, consider creating a custom CSS file in your theme’s directory, specifically for CMS pages, to maintain organized styling.

Custom CSS allows you to adjust colors, fonts, margins, and other visual elements to ensure brand consistency.

6. Using Widgets for Enhanced Functionality

Magento 2 offers various widgets that add dynamic content to CMS pages:

  • Add Product Listings: Use product widgets to display best sellers, new products, or category-specific items.

  • Embed Contact Forms: Use the form widget to add contact forms directly to your CMS page.

  • Social Media Links and Feeds: Add widgets that link to or display feeds from your social media accounts.

Widgets can significantly improve the functionality of your CMS pages, turning static pages into interactive, conversion-focused elements.

7. Setting SEO Properties for CMS Pages

Optimizing CMS pages for search engines can drive organic traffic to your site:

  • Set Meta Title and Description: In the “Page in Websites” section, set the Meta Title and Meta Description.

  • Use Descriptive URL Keys: Ensure that your URL key is clear and relevant to the page’s content (e.g., “shipping-policy” for a page on shipping details).

  • Add Keywords in Content: Use keywords naturally within the content to improve search relevance.

Good SEO practices will help improve your page’s visibility on search engines, bringing more traffic to your site.

8. Publishing and Managing CMS Pages

Once you’ve customized your CMS page, you can publish and manage it easily:

  • Save and Preview: Before publishing, use the “Save” and “Preview” options to check your page’s appearance.

  • Set Page Visibility: Under “Page in Websites,” choose which store views should display this page.

  • Manage CMS Pages: After publishing, return to Content > Pages to view and manage your page list, enabling quick edits and status changes as needed.

Managing CMS pages is straightforward, enabling you to update content quickly and adapt to business needs.


Conclusion

Creating and customizing CMS pages in Magento 2 empowers you to build a content-rich website that enhances user experience and supports SEO goals. By following these steps, you can create pages that not only provide essential information but also align visually and functionally with your brand. From adding custom styles and widgets to setting up SEO properties, Magento 2’s CMS tools provide everything you need to build a fully customized and effective content strategy. Embrace the flexibility Magento offers and create CMS pages that engage customers, reinforce brand messaging, and improve your site’s performance.