Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use advertisement template in jspXCMS

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article is about how to use advertising templates in jspXCMS. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

Advertising has two management modules, one is advertising board, the other is advertising management. A billboard is an area on a page that displays advertisements, and an advertising area may have multiple ads, such as multiple ad switches or multiple ads displayed side by side. Of course, there can be only one ad in an advertising area.

Controller:com.jspxcms.ext.web.fore.AdController .

Access address: / dd_number/ {number}. The number parameter is required, corresponding to the coding in the billboard location management. For example, http://localhost:8080/dd_number/homepage. (addresses in version 7. 0 and older need to be suffixed with .jspx, such as http://localhost:8080/dd_number/homepage.jspx)

Template rules: in advertising location management, advertising location needs to choose the corresponding template. For example, / template/1/default/dd_homepage.html.

Default object:

Slot: advertising location object. Type: com.jspxcms.ext.domain.AdSlot.

Because advertisements are generally dynamic, they may be out of date or replaced. In order to avoid that the content of the advertisement will not change dynamically when the static page is generated, the script is usually used to introduce the advertisement dynamically. If you need to display the advertisement, add the following code:

This script will get the template content corresponding to the ad location. The template content may be:

[# assign script] [# list slot.ads as ad]

${ad.text}

[/ # list] [/ # assign] [xss_clean] ("${script?js_string}")

Note: the list of advertisements obtained by slot.ads also contains expired ads. If you do not want to display expired ads, you should add a corresponding judgment, such as:

[# assign script] [# list slot.ads as ad] [# if! ad.endDate?? | | ad.endDate > .now]

${ad.text}

[/ # if] [/ # list] [/ # assign] [xss_clean] ("${script?js_string}"); thank you for reading! This is the end of the article on "how to use Advertising templates in jspXCMS". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report