自定义模板标签.docVIP

  • 7
  • 0
  • 约4.79千字
  • 约 7页
  • 2016-10-22 发布于河南
  • 举报
自定义模板标签

自定义模板标签 在zcms模板制作当中,通过自定义模板标签可以很方便、容易地获取到我们想要的数据。下面我们就以品牌标签为例来简单介绍一下自定义模板标签的实现。 首先,要建一个扩展行为类BrandTag来注册扩展服务com.zving.contentcore.service.TagService。 扩展行为类代码如下: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 package com.zving.goods.tag; import java.util.ArrayList; import java.util.List; import com.zving.contentcore.bl.ContentBL; import com.zving.contentcore.properties.PropertyUtil; import com.zving.contentcore.util.CatalogUtil; import com.zving.framework.data.DataTypes; import com.zving.framework.orm.DAOSet; import com.zving.framework.template.TagAttr; import com.zving.framework.template.exception.TemplateRuntimeException; import com.zving.framework.utility.NumberUtil; import com.zving.framework.utility.ObjectUtil; import com.zving.framework.utility.StringUtil; import com.zving.goods.GoodsPlugin; import com.zving.goods.bl.BrandBL; import com.zving.goods.service.GoodsCache; import com.zving.goods.service.GoodsType; import com.zving.schema.ZSBrand; import com.zving.staticize.tag.AbstractListTag; public class BrandTag extends AbstractListTag { private String catalogid; private int pageTotal; private boolean isBrandList; public String getName() { return @{Goods.BrandTag.Name}; } @Override public String getDescription() { return @{Goods.BrandTag.Description}; } @Override public String getPluginID() { return GoodsPlugin.ID; } @Override public String getPrefix() { return ebiz; } @Override public String getTagName() { return brand; } @Override public int getPageTotal() { return this.pageTotal; } public ListTagAttr getTa

文档评论(0)

1亿VIP精品文档

相关文档