Adding a Trailing Slash to CMS Pages in Magento 2

Published by John on October 9, 2019

One of my clients is migrating their Magento 1 website to Magento 2. One feature that is a bit tricky is adding a trailing slash to the end of CMS Pages. For Categories and Products, this is not an issue, but it isn’t as straightforward for CMS Pages.

I wrote an observer that you can plugin to your custom Magento 2 plugin to automatically add the trailing slash to CMS Pages when they are saved, which I think is the simplest and non-obtrusive way of addressing this issue. However, if you know a better/easier way, please feel free to leave a comment.

Read More  |  Add Comment

Magento 2: Targeting a Specific CMS Page using Layout.XML

Published by John on September 1, 2019

With Magento 2, adding a layout update usually starts with creating an XML file, using the layout handle of the item you are trying to target. For example, if you wanted to make a change to all category pages, you could create a file named ‘catalog_category_view.xml’ and then add all your updates to it.

For CMS pages, you can do a general update to ALL cms pages or target a specific page by using the identifier(URL Key) of the CMS page.

Read More  |  Add Comment

Hiding WordPress’s ‘PHP Update Required’ Dashboard Warning

Published by John on August 27, 2019

Wordpress has started reporting that PHP Version 5.6 is not supported and adds a nag to the admin dashboard, saying that PHP needs to be updated and “WordPress has detected that your site is running on an insecure version of PHP.”

While it is better to upgrade PHP to version 7, if for some reason you want to hide this box, you can do so by removing the ‘dashboard_php_nag’ meta box.

Read More  |  Add Comment

HTML 5 Video not Playing on Mobile Safari

Published by John on August 26, 2019

I ran into an issue last week, where an autoplaying HTML5 video was working in all browsers and devices, except for apple devices, including the iPad, iPhone, and also desktop’s running Safari. Chrome, Firefox, Android, and other browsers were not affected. However, even when accessing the video directly, the iPhone would not play it.

After a lot of troubleshooting the encoding method, video tag, and a lot of other debugging, I determined that it wasn’t actually related to the server or video, but was because the site was using cloudflare. A simple htaccess update was able to fix this, although long term using a CDN to serve the video may be a better choice.

Read More  |  Add Comment

Knightdale in Top 10 Most Affordable Places to Live in NC

Published by John on August 22, 2019

Knightdale is a very convenient place to live, as you can get to a lot of places, like Raleigh and Cary, in only a few minutes, as well as having some nice amenities. It is also one of the more affordable places to live in North Carolina, while having a reasonably high median income compared to a lot of other places in the state.

Since at least 2015, Knightdale has been in the top 10 of most affordable places to live and this year, was ranked at #7 in the list. The next closest to the triangle was Nashville, NC, which is at #10.

Read More  |  Add Comment

« Previous PageNext Page »