10

i tried to insert image with two different ways like through CMS pages in that select page and in content use below code:

<p><img src="{{skin url='images/media/404_callout1.jpg'}}" alt="" /></p>

and another way is by click on the "insert image" button.

Is there any other way for for insert image in CMS page?

3 Answers 3

10

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.

<reference name="content">
    <block type="cms/block" before="-">
        <action method="setBlockId"><block_id>staticblock_identifier</block_id></action>
    </block> 
</reference>

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

after="-"
1

go to magento admin panel, and go -> cms/pages/home page and select -> content ->in editor select insert/edit image and select browse icon click the create folder link and create the folder and choose the folder name as 777 then you upload your images in to the 777 folder and click on that image and then use the images in home page

0

you can also use this code if you are loading your cms from a phtml file:-

<img src="<?php echo $this->getSkinUrl('images/imagename.jpg') ?>" />

The image should be uploaded in the images folder at location skin/frontend/package_name/theme_name/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.