稿件内容页生成静态后上一篇、下一篇不更新的问题处理

作者:动易软件 来源:本站原创 点击数: 发布时间:2018年03月22日

问题分析:

当稿件内容页生成静态后上一篇、下一篇的内容,不会随栏目新录入稿件内容而更新

处理方法:

按照以下方法修改文章内容页模板即可:

      上一篇、下一篇这两个标签要设置允许AJAX访问,使用ajax方式加载就可静态页上面正常显示,无需重新生成静态页
  1. <div class="others"> 
  2.                 <div class="prev"> div> 
  3.                 <div class="next"> div> 
  4.   div> 
  5.  
  1. "hidden" id="inputNodeId" value="@ RequestInt_id" /> 
  2. "hidden"  id="inputnodeArrayId" value='{PE.Field id="cone" fieldname="node" /}' /> 
  3. "text/javascript"
  4.  
  5.     jQuery(document).ready(function($){ 
  6.  
  7.                                     var node = $("#inputNodeId").val(); 
  8.                                     var nodeArrayId= $("#inputnodeArrayId").val(); 
  9.  
  10.                                     $.pe.ajax('accessLabel',{labelName:'上一篇',params:{itemId:node,displayTips:'true',displayTips:'true',linkOpenType:2,nodeArray:nodeArrayId},success:function(response){ 
  11.                                          
  12.                                             $(".others").find(".prev").html( 
  13.                                                 $(response).find('body').text() 
  14.                                             ); 
  15.  
  16.                                         } 
  17.                                     }) 
  18.  
  19.                                     $.pe.ajax('accessLabel',{labelName:'下一篇',params:{itemId:node,displayTips:'true',displayTips:'true',linkOpenType:2,nodeArray:nodeArrayId},success:function(response){ 
  20.                                          
  21.                                             $(".others").find(".next").html( 
  22.                                                 $(response).find('body').text() 
  23.                                             ); 
  24.  
  25.                                         } 
  26.                                     })//ajax end 
  27.                                                                     
  28.  
  29.                             }) 
  30.  
  31.                              
  32.