Hongmu Notes
Home Program Notes Apple cms calls related articles of the current column
Program Notes Apple cms

Apple cms calls related articles of the current column

Apple cms calls related articles of the current column

To display videos within the current category in Apple CMS, you can use the template tag.{maccms:vod}type="current"Parameter Implementation. The following outlines the specific steps and extended configuration instructions:

{maccms:vod num="12" type="current" order="desc" by="hits"}
<li class="clear">
  <a class="thumbnail-link"
      href="{:mac_url_vod_play($vo,1,1)}"
      rel="bookmark">
    <div class="thumbnail-wrap">
      <img src="{$vo.vod_pic}" />
      <div class="video-duration">{$vo.vod_year}</div>
    </div>
  </a>
  <div class="entry-wrap">
    <a href="{:mac_url_vod_play($vo,1,1)}"
        rel="bookmark">{$vo.vod_name}</a>
    <div class="entry-meta">
      <span class="entry-views">
        <i class="fa fa-eye"></i>
        <span class="view-count">{$vo.vod_hits}次观看</span>
      </span>
      <span class="sep"> &middot; </span>
      <span class="entry-date">{$vo.vod_time|mac_day}</span>
    </div>
  </div>
</li>
{/maccms:vod}

I. Basic Call Code

In template files (e.g.vodplay.htmlAdd the following code to the column page template:

{maccms:vod num="10" type="current" order="desc" by="time"}
 
  • Parameter parsing
    • num="10"Call 10 videos (can be customized as needed).
    • type="current"Limited to videos within the current section.
    • order="desc" by="time"Sort by publication date in descending order (latest videos first).

II. Extended Configuration Scenarios

1. Sort by view count (Popular Videos)

{maccms:vod num="10" type="current" order="desc" by="hits"}

 

2. Randomly play videos from this section

{maccms:vod num="10" type="current" order="rand"}

 

3. Only videos with a recommended value ≥ 5 will be displayed.

{maccms:vod num="10" type="current" order="desc" by="hits" level="5"}
 

(Please set the recommendation value in the video editing page in advance.)

4. Exclude the current video itself (to avoid duplicate recommendations)

{maccms:vod num="10" type="current" id="!{$maccms.vod.vod_id}"}
 

III. Front-end Display Example

<div class="current-videos">
  {maccms:vod num="10" type="current" order="desc" by="time"}
  <div class="video-card">
    <a href="{$vo.vod_play_url}">
      <img src="{$vo.vod_pic}" alt="{$vo.vod_name}">
      <h3>{$vo.vod_name}</h3>
      <p>更新至:{$vo.vod_serial}</p>
    </a>
  </div>
  {/maccms:vod}
</div>

<style>
.current-videos { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px; }
.video-card img { width: 100%; height: 280px; object-fit: cover; border-radius: 8px; }
.video-card h3 { font-size: 16px; margin: 8px 0; }
.video-card p { color: #666; font-size: 14px; }
</style>
 

IV. Key Considerations

  1. Column ID matching
    • Ensure that the template file is bound to the target section (for example, the section page template must correspond to the correct category ID).
    • When called on the playback page,type="current"It will automatically inherit the category to which the current video belongs.
  2. performance optimization
    • When the video volume is large, it is recommended to run the process in the background. System → Planned Tasks Enable "Auto Generate Classification Cache".
    • Avoid excessive API calls on high-traffic pages (e.g., the homepage).numThe value should not be too large).
  3. Cache cleanup
    • After modifying the template, please access the Apple CMS backend. Click "Clear Cache" in the top-right corner.Otherwise, the frontend may not be updated.

V. Advanced Application Scenarios

1. Combined Label Filtering

Retrieve videos from the current section that contain a specific tag (e.g., "4K" tag):

{maccms:vod num="10" type="current" tag="4K"}

2. Cross-column invocation (but prioritizes the current column)

If the current section contains fewer than 10 videos, additional data from other sections will be automatically supplemented:

{maccms:vod num="10" type="current,other" order="rand"}
 

3. Play sub-section video

If the current section has child categories, recursively call the videos for all child sections:

{maccms:vod num="10" type="current,child" order="desc" by="time"}
 

With the above configuration, you can flexibly meet diverse video invocation requirements for current sections – making it ideal for scenarios such as associated recommendations on playback pages or content populating on section pages.

Tag Directory

http://Apple Label Reference Table (Official Website Document – Video Sorting Tag Input)

微信赞赏

WeChat

支付宝赞赏

Alipay

✍️ Author: Hong Mu

webmaster · Thanks for reading, stay tuned for more exciting content

Author homepage View home page →

Related articles

Apple cms commonly used processing functions

Apple cms commonly used processing functions Program Notes Apple cms

Multiple functions are allowed, separated by | {:mac_data_count(0,'all','vod')} Get the total number of videos {:mac_data_count(0,'today','vod')} Get the total number of updated videos today {:mac_data_count(0,'all','art')} Get the total number of articles {:ma…
👁 261

Recommended reading

(Adaptive mobile version) Website development service – PBootCMS template for advertising agencies; Download source code for brand strategy and design websites – 0536

(Adaptive mobile version) Website development service – PBootCMS template for advertising agencies; Download source code for brand strategy and design websites – 0536 Practical Collection pbootcms Template

A PbootCMS website template designed for web development and advertising brand strategy and design agencies, compatible with both PC and WAP devices. Featuring a creative marketing design style, this template is ideal for advertising and media firms to showcase their brand strategy and design portfolios. It helps advertising agencies attract brand clients online and demonstrate their comprehensive service capabilities. Template Preview | Installation Instructions | Website Backend: /admin.php | Username: admin | Password: admin | Extraction Password: www.4s...
👁 59
(PC+WAP) Air Conditioning Installation & Maintenance Website Template; Home Appliance Repair Website Source Code Download – 1117

(PC+WAP) Air Conditioning Installation & Maintenance Website Template; Home Appliance Repair Website Source Code Download – 1117 Practical Collection pbootcms Template

A PbootCMS website template for air conditioning installation/repair and household appliance repair services, compatible with both PC and WAP devices. The professional and practical design is ideal for air conditioning installation and repair service providers to showcase their business offerings. It helps appliance service companies present their services online and attract local customers. Template Display | Installation Instructions | Website Backend: /admin.php | Username: admin | Password: admin | Extraction Password: www.4s5.cn | Related Articles...
👁 50
WordPress `wp_cache_set` function

WordPress `wp_cache_set` function Program Notes wordpress

`wp_cache_set()` is an built-in WordPress function used to store data in the cache. Its function prototype is as follows: `wp_cache_set($key, $data, $group = '', $expire = 0)`. Parameter descriptions: - `$key`: The key name for the data to be stored; typically a string. - `$data`: The data to be stored; can be...
👁 174
Responsive fashion women's footwear e-commerce sales website template – 11463 0540

Responsive fashion women's footwear e-commerce sales website template – 11463 0540 Practical Collection Yiyou template

An EyouCMS responsive professional template designed for e-commerce sales of women's footwear. Its stylish and sophisticated design enables effective display of women's shoe products, brand image, promotional campaigns, and online purchasing options. This template helps women's footwear brands establish an online e-commerce platform and attract consumers. Template Display | Installation Instructions | Website Backend: /login.php | Username: admin | Password: admin | Related Articles: Summary of Common Installation Issues for EyouCMS | EyouCMS...
👁 34
Batch rename HTML files to PHP files

Batch rename HTML files to PHP files Language Notes PHP

User-friendly and highly recommended. <?php // Security note: It is advisable to run this script in a test environment first and back up important files. echo '<h3>Batch renaming of HTML files to PHP</h3>'; // Check for the presence of a confirmation parameter if (isset($_GET['confirm']) && $_GET['conf...
👁 116
Responsive government department and public institution website template 1156

Responsive government department and public institution website template 1156 Practical Collection Yiyou template

This EyouCMS responsive template is ideal for local government departments and public institutions. Its professional and dignified design makes it perfect for showcasing government transparency initiatives, organizational functions, policies and regulations, as well as news updates. It helps local government entities establish an official online information publishing platform. Template Display | Installation Instructions | Website Backend: /login.php | Username: admin | Password: admin | Related Articles: Summary of Common Installation Issues for EyouCMS | EyouCMS...
👁 44