Common magento calls

Source: Internet
Author: User
1. CMS calls the website URL <a href = "{store direct_url =" about-us "}"> about us </a>

{Store direct_url = "}" refers to the base URL in the current magento background.

You can also call the {store url = ''} parameter.

2. CMS calls the image path

{Skin url = ''} calls the image path in the default topic package.

Reprinted fromMagento architect's notes| Call images and URLs in magento CMS

Call the image in the Code: <span> getskinurl ('images/f310g.jpg ');?> "> </Span>

3. In magento, we sometimes need to call images. We can call them in several ways, which can be divided into several situations:
1. In the phtml page, that is, in the template file,

Call in phtml
Yes <? PHP echo $ this-> getskinurl ('images/image')?>

Or in XML,
<Reference name = "right">
<Block type = "catalog/product_compare_sidebar" before = "cart_sidebar" name = "catalog. Compare. Sidebar" template = "catalog/product/compare/sidebar. phtml"/>
<Block type = "Core/template" name = "right. Permanent. callout" template = "callouts/right_col.phtml">
<Action method = "setimgsrc"> <SRC> images/image name </src> </Action>
<Action method = "setimgalt" translate = "Alt" module = "catalog"> <alt> keep your eyes open for our special back to school items and save a lot! </ALT> </Action>
</Block>
</Reference>

Here we have set the corresponding template file, the location where the template file appears, and the image path. You can use
<? PHP echo $ this-> getskinurl ($ this-> getimgsrc ()?> To obtain the image path. Of course, this setting is very troublesome. Generally, if you call an image directly, we can simply use the previous method, which is clear, but sometimes we need to place it on the left and right sides, in this way, we usually create a new template file first, and then catalog. declare the block in the XML file (slightly modify the content above), and then you can call it to change the image.

2. Call the image in the CMS block set in the background. We can use the following code to call

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.