Template/FeaturedContent:修订间差异

来自Age Of History 2 Chinese Wiki
跳转至:导航、​搜索
无编辑摘要
标签已被回退
无编辑摘要
标签已被回退
第1行: 第1行:
<div class="featured-content-container">
<div class="featured-content-container">
   <div class="feature-item person">
   <div class="feature-item person">
     <div class="section-title">精选人物</div>
     <div class="section-title">精选人物</div>
     <div class="feature-content">
     <div class="feature-content">
       <dpl>
       <dpl>
  category = 精选人物
        # DPL Parameters Start -----
addauthor=true
        category = 精选人物
addeditdate=true
        randomcount = 1
include={Page}:1
 
  count = # 显示最多3个,方便查看
        # --- Metadata Inclusion ---
format = <div>, <div>Item: [[%PAGE%]] - Author_placeholder - Date_placeholder - Image_placeholder - Excerpt_placeholder</div>, </div>
        # !! 关键:确保此行存在且正确,以使 %AUTHOR% 工作 !!
</dpl>
        addauthor = true
        # !! 关键:确保此行存在且正确,以使 %DATE% 工作 !!
        addeditdate = true
        # 可选:自定义日期格式,例如 'Y年m月d日 H:i'
        # userdateformat =
 
        # --- Content Inclusion ---
        # 包含页面的第一段内容作为节选
        # 如果页面结构不同,可尝试 include = {模板名} 或 include = #段落标题
        include = {Page}:1
 
        # --- Caching ---
        # 测试时可临时设为 false: allowcachedresults = false
        allowcachedresults = true
        dplcache = featuredperson_dpl3_v2
        dplcacheperiod = 86400 # 缓存一天 (单位:秒)
 
        # --- Ordering & Selection ---
        ordermethod = firstedit # 按首次编辑排序(对 randomcount=1 影响不大)
 
        # --- Output Formatting ---
        # 如果没有找到页面时的提示信息
        noresultsheader = <p style="text-align: center; color: #777;">目前没有精选人物。</p>
        # 使用 format 定义输出结构 (三部分:列表开始, 单项格式, 列表结束)
        # 假设你已将 CSS 类添加到 MediaWiki:Common.css
        format = <div class="dpl-results-list">, <div class="dpl-item">
                  <div class="dpl-image">
                    [[File:%IMAGE%|120x120px|link=%PAGE%]]
                  </div>
                  <div class="dpl-content">
                    <div class="dpl-title">[[%PAGE%]]</div>
                    <div class="dpl-meta">作者: %AUTHOR% | 日期: %DATE%</div>
                    <div class="dpl-excerpt">%SECTION%</div>
                  </div>
                </div>,
                </div>
 
        # --- Other Parameters ---
        escapelinks = false # 通常设为 false 以正确显示链接
 
        # DPL Parameters End -----
      </dpl>
     </div>
     </div>
     <div class="see-more">
     <div class="see-more">
第20行: 第62行:
     <div class="section-title">精选团体</div>
     <div class="section-title">精选团体</div>
     <div class="feature-content">
     <div class="feature-content">
      <dpl>
      <dpl>
        # DPL Parameters Start -----
         category = 精选团体
         category = 精选团体
         randomcount = 1
         randomcount = 1
        # --- Metadata Inclusion ---
        addauthor = true # !! 必须确保存在 !!
        addeditdate = true
        # userdateformat =
        # --- Content Inclusion ---
        include = {Page}:1
        # --- Caching ---
         allowcachedresults = true
         allowcachedresults = true
         dplcache = featuredgroup_formatted # 更改缓存名称
         dplcache = featuredgroup_dpl3_v2
         dplcacheperiod = 86400
         dplcacheperiod = 86400
        addauthor = true
         # --- Ordering & Selection ---
        addeditdate = true
         # userdateformat = Y-m-d H:i
         ordermethod = firstedit
         ordermethod = firstedit
         include = {Page}:1
         # --- Output Formatting ---
        noresultsheader = <p style="text-align: center; color: #777;">目前没有精选团体。</p>
         format = <div class="dpl-results-list">,
         format = <div class="dpl-results-list">,
                 <div class="dpl-item" style="border: 1px solid #ccc; padding: 10px; margin-bottom: 10px; overflow: hidden;">
                 <div class="dpl-item">
                   <div class="dpl-image" style="float: left; margin-right: 10px; width: 120px; height: 120px; overflow: hidden; display: flex; align-items: center; justify-content: center;">
                   <div class="dpl-image">
                     [[File:%IMAGE%|120x120px|link=%PAGE%]]
                     [[File:%IMAGE%|120x120px|link=%PAGE%]]
                   </div>
                   </div>
                   <div class="dpl-content">
                   <div class="dpl-content">
                     <div class="dpl-title" style="font-weight: bold; font-size: 1.1em;">[[%PAGE%]]</div>
                     <div class="dpl-title">[[%PAGE%]]</div>
                     <div class="dpl-meta" style="font-size: 0.9em; color: #555;">作者: %AUTHOR% | 创建/编辑日期: %DATE%</div>
                     <div class="dpl-meta">作者: %AUTHOR% | 日期: %DATE%</div>
                     <div class="dpl-excerpt" style="font-size: 0.9em; margin-top: 5px; max-height: 80px; overflow: hidden;">%SECTION%</div>
                     <div class="dpl-excerpt">%SECTION%</div>
                   </div>
                   </div>
                 </div>,
                 </div>,
                 </div>
                 </div>
         # noresultsheader = 未找到符合条件的精选团体。
         # --- Other Parameters ---
         escapelinks = false
         escapelinks = false
        # DPL Parameters End -----
       </dpl>
       </dpl>
     </div>
     </div>
第51行: 第101行:
     </div>
     </div>
   </div>
   </div>
</div>
</div>

2025年5月2日 (五) 21:00的版本