Google logo
4.9 on Google
Get a free Magento audit

Recommendations on page speed, accessibility issues, and real user experience data

Skip to main article

Adding Images to Magento Pages

Adding Images to Magento Pages
10 mins

Develo is a leading Magento agency and eCommerce web development company based in Birmingham, in the UK, serving clients globally since 2010.

I recently answered a question on stack exchange for someone who was looking for different ways to add images to static pages in Magento. With Magento being as flexible as it is you can imagine there is more then one way to achieve this, here I list a few ways you can do this to a single page or multiple.

Using the “Insert Image” button will add the images which are relative to the media wysiwyg directory

<img src="{{media url="wysiwyg/filename.jpg"}}" alt="" >

You could also have images stored as the content of a static block and then call them into the cms page contact using either using

{{block type="cms/block" block_id="staticblock_identifier"}}

Or use the widget interface and select Widget Type “CMS Static Block” which will add blocks by id like

{{widget type="cms/widget_block" template="cms/widget/static_block/default.phtml" block_id="10"}}

If you’d like the image to appear just above or below the main content look at adding it through layout XML and adding a static block either for that page using the CMS page design tab or for every CMS page using the “cms_page” layout handle.

If your image is stored as a static block and you’d like it before the main content add the following XML to your page or cms handle.

staticblock_identifier

If you’d like the block to come after the content enter

after="-"

You can see the answers and responses to this question here, http://magento.stackexchange.com/questions/5043/how-many-different-way-to-insert-image-in-magento-cms-page/5045#5045

If you enjoyed this article, read the other Blogs from our Magento agency or browse the site to see what else we do with Adobe Commerce, Magento Custom Extension Development and more.

Last updated: April 15, 2024

Get in touch for help with your latest Magento or eCommerce project.

Learn with us

Latest learning resources

Practical ideas, helpful platform tips, and smart strategies to help your eCommerce store thrive.