I briefly summarized the ecshop advertisement calling method, which was previously published on my blog. Here I will summarize it with you.
Method 1: The official default method. Add the ad space first, then add the ad space area of the template, and then match the two.
1. Click "add ad space" in "Advertisement Management" in the background.
Add ad location:
2. Add advertisement content
Then go to the "ad list" and click the "add ad" button. Note that you need to select the ad space added in step 1 from the ad location drop-down list.
Note: Make sure to select the name you just added for the ad location: the ad on the homepage bar (960 × 60); otherwise, it cannot be displayed.
3. Modify the homepage Template
Open the index. DWT file and add:
<!-- TemplateBeginEditable name="a1" --> <!-- TemplateEndEditable -->
Note that the A1 name cannot contain special characters, so I have included an asterisk before. It takes a long time to find the cause. Remember
4. Modify background template management and select homepage template.
Find the "ad space" at the bottom and click "+" to expand,
In the first drop-down box, select "ad space (width: 960 × 100) in the homepage header bar )"
In the second drop-down box, select "ad space in the homepage header bar [960 × 100]"
Click OK to save the changes.
Method 2:
Step 1: First add an advertisement location from the background, and then select this advertisement location to add an image.
Step 2. If you need to adjust the advertisement, add the following code to the PHP file to obtain the advertisement to be displayed.
// The first advertising space in the center $ ads = array ('num' => '1 ', // number of advertisements 'id' => '1' // ID of the advertisement location ID. You can click the List of background advertisement locations and place the cursor on each item to see the corresponding content. ); $ Banner = insert_ads ($ ads); $ smarty-> assign ("banner", $ banner); // set the ad space content and call it in the template
Step 3: Open the template file. If there is only one advertisement, {$ banner} OK. If there are multiple templates, loop through the Array {$ banner} to display the advertisement content.
Welcome to repost. This article is provided by programmer life network, www.wfuyu.com
Ecshop ad call method summary