调用首页产品

可选参数如下

New = 1,
Hot = 2,
Best = 3,
Special = 4,
Featured = 5,
Other = 6

#foreach($item in $oct.GetProductstList(${currency},6,$ptype.Best))
                                    <dl class="indexlist">
                                        <dt class="proimg">
                                            <a href="${item.url}" title="">
                                                <img src="${item.images.smallimg}" title="" alt="" />
                                            </a>
                                        </dt>
                                        <dd class="prodName">
                                            <a href="${item.url}" title="">${item.name}</a>
                                        </dd>
                                        <dd class="prodPrice">
                                            <span class="oldPrice">${item.NormalPrice}</span>
                                            <span class="price">${item.SalePrice}</span>
                                            <span class="discount">Save:${item.Saveoff} off</span>
                                        </dd>
                                    </dl>
#end

列表页 调用面包屑导航

            <div id="breadcrumb" class="breadcrumbs">
                        <ul>
                            #foreach($item in $category.Breadcrumb)
                            #beforeall
                            <li class="home"><a title="${Oct_Home}" href="${siteurl}">${Oct_Home}</a><span>/ </span></li>
                            #each
                            <li class="">
                                <a href="${item.url}">${item.name}</a>
                                #if(${category.ClassLayer}!=1)
                                <span>/</span>
                                #end
                            </li>
                            #afterall
                            #if(${category.ClassLayer}!=1)
                            <li class="">${category.name}</li>
                            #end
                            #end
                        </ul>
                    </div>

调用全部分类【支持无限级的调用,根据需要自己编写】 下面展示4级分类的调用

                <div>
                                <dl>
                                    #foreach($item in $categorylist)
                                    <dd>
                                        <a href="${item.url}">${item.name}</a>
                                        #foreach($s in $item.SubClass)
                                        #beforeall
                                        <ul>
                                            #each
                                            <li>
                                                <a href="${s.url}">${s.name}</a>
                                                #foreach($o in $s.SubClass)
                                                #beforeall
                                                <ul>
                                                    #each
                                                    <li>
                                                        <a href="${o.url}">${o.name}</a>
                                                        #foreach($p in $o.SubClass)
                                                        #beforeall
                                                        <ul>
                                                            #each
                                                            <li><a href="${p.url}">${p.name}</a></li>
                                                            #afterall
                                                        </ul>
                                                        #end
                                                    </li>
                                                    #afterall
                                                </ul>
                                                #end
                                            </li>
                                            #afterall
                                        </ul>
                                        #nodata
                                        #end
                                    </dd>
                                    #end
                                </dl>
                            </div>

很长看不懂吗?很简单 自己运行一下

调用产品列表

                   <div id="gridInner">
                                #set($count=0)
                                #foreach($item in $productlist)
                                #set($count=$count+1)
                                <div class="plist">
                                    <div class="proimg">
                                        <a href="${item.url}" title="">
                                            <img class="proimgitem" src="${item.images.smallimg}" title="${item.name}" alt="${item.name}"  />
                                            <span class="span_box"></span>
                                        </a>
                                    </div>
                                    <div class="description">
                                        <a href="${item.url}" title="${item.name}">
                                            ${item.name}
                                        </a>
                                    </div>
                                    <div class="prodesprice">
                                        <span class="retail-price">
                                            <span class="set-currency">${item.NormalPrice}</span>
                                        </span>
                                        <span class="price">${item.SalePrice}</span>
                                        <span class="discount">Save:${item.Saveoff} off</span>
                                    </div>
                                </div>
                                #if($count%3==0)
                                <div class="clear separator"></div>
                                #end
                                #end
                                <div style="clear:both;height:5px"></div>
                                <div class="default">
                                    ${pager}
                                </div>
                            </div>

关于分页的样式,已经内置几种样式可以自己定义

调用详情页面包屑【和分页的有点细微差别】

                      <div id="breadcrumb" class="breadcrumbs">
                                        <ul>
                                            #foreach($item in ${product.category.breadcrumb})
                                            #beforeall
                                            <li class="home"><a title="${Oct_Home}" href="${siteurl}">${Oct_Home}</a><span>/</span></li>
                                            #each
                                            <li class="">
                                                <a href="${item.url}">${item.name}</a>
                                                #if(${product.category.classlayer}!=1)
                                                <span>/</span>
                                                #end
                                            </li>
                                            #afterall
                                            #if(${product.category.classlayer}!=1)
                                            <li class=""><a href="${item.url}">${product.category.name}</a></li>
                                            #end
                                            #end
                                        </ul>
                                    </div>

【通过产品的category对象来调用】

调用产品的多选属性

                              <div class="box">
                                                    #foreach($item in $product.Attributes)

                                                    #if($item.type=="attr_radio")
                                                    <div class="$item.type">
                                                        <input type="hidden" name="attr_${item.name}" value="" />
                                                        <b>$item.Name</b>
                                                        <div style="clear:both"></div>
                                                        #foreach($a in $item.values)
                                                        <span class="unchecked" title="$a.value" data-val="$a.value">
                                                            $a.value&nbsp;$oct.CheckValue($a.Pricefix)&nbsp;$a.DVPrice
                                                        </span>
                                                        #end
                                                        <div style="clear:both"></div>
                                                    </div>
                                                    #end

                                                    #if($item.type=="attr_dropdown")
                                                    <div class="$item.type">
                                                        <b>$item.Name</b>
                                                        <select name="attr_$item.Name" onchange="CheckInput(this);">
                                                            <option value="" selected="selected">${Oct_Please_Select}</option>
                                                            #foreach($a in $item.values)
                                                            <option value="$a.value">$a.value $oct.CheckValue($a.Pricefix) $a.DVPrice</option>
                                                            #end
                                                        </select>
                                                        <div style="clear:both"></div>
                                                    </div>
                                                    #end

                                                    #if($item.type=="attr_color_radio")
                                                    <div class="$item.type">
                                                        <input type="hidden" name="attr_${item.name}" value="" />
                                                        <b>$item.Name</b>
                                                        <div style="clear:both"></div>
                                                        #foreach($a in $item.values)
                                                        <span class="unchecked" data-val="$a.value">
                                                            <img src="${themeurl}images/color/$a.Icon"
                                                                 title="$a.value $oct.CheckValue($a.Pricefix) $a.DVPrice"
                                                                 width="32" />
                                                        </span>
                                                        #end
                                                        <div style="clear:both"></div>
                                                    </div>
                                                    #end

                                                    #if($item.type=="attr_text")
                                                    <div class="$item.type">
                                                        #foreach($a in $item.values)
                                                        <b>$item.Name:</b>
                                                        <input type="text" name="attr_${item.name}" value="" onchange="CheckInput(this)" />
                                                        <br />
                                                        #end
                                                        <div style="clear:both"></div>
                                                    </div>
                                                    #end

                                                    #end
                                                </div>

这个大家还是自己看吧 【懒得口舌了,想要之后可以私下联系我,如果更新了 我会在上面更新的】

其实之所以这样贴出来是为了大家方便,其实Octopus完全支持自定义的模板开发的 不过你要完全熟悉我的对象实体 才行

调用关联产品

                            <div class="box">
                                                    #foreach($rp in $product.Related)
                                                    <a href="$rp.url" title="$rp.name">
                                                        <img src="$rp.images.smallimg" width="85" style="border:1px solid #EEEEEE" />
                                                    </a>
                                                    #end
                                                </div>

调用上一个产品下一个产品

                         <div class="box" style="font-weight: bold; font-size: 14px; color: #990000;">
                                                <a class="cor990000" href="$product.PreviousUrl">&lt;&lt;&nbsp;${Oct_Prev}</a>&nbsp;&nbsp;
                                                <a class="cor990000" href="$product.category.URL">${Oct_Listing}</a>&nbsp;&nbsp;
                                                <a class="cor990000" href="$product.NextUrl">${Oct_Next}&nbsp;&gt;&gt;</a>&nbsp;&nbsp;
                                            </div>

调用收藏夹

                               #if(${islogin})
                                                    #if(${iswishlist})
                                                    <a name="btnAddToWishList" class="litb-btn-small" id="favorite" href="javascript:void(0)"
                                                       data-pid="${product.productid}"
                                                       data-login="${islogin}"
                                                       data-iswishlist="${iswishlist}"
                                                       onclick="AddToWish(this)">
                                                        <i class="litb-icon-prod-heart litb-icon-prod-heart-active"></i>
                                                        ${Oct_Favorite}
                                                    </a>
                                                    #else
                                                    <a name="btnAddToWishList" class="litb-btn-small" id="favorite" href="javascript:void(0)"
                                                       data-pid="${product.productid}"
                                                       data-login="${islogin}"
                                                       data-iswishlist="${iswishlist}"
                                                       onclick="AddToWish(this)">
                                                        <i class="litb-icon-prod-heart"></i>
                                                        ${Oct_Favorite}
                                                    </a>
                                                    #end
                                                    #else
                                                    <a name="btnAddToWishList" class="litb-btn-small" id="favorite" href="javascript:void(0)"
                                                       data-login="${islogin}" onclick="AddToWish(this)">
                                                        <i class="litb-icon-prod-heart"></i>Favorite
                                                    </a>
                                                    #end

调用产品放大镜

                          <div class="zoom-section">
                                                <div class="zoom-small-image">
                                                    <a id="zoom1" class="cloud-zoom" href="${product.images.bigimg}"
                                                       rel="position:'inside',showTitle: false,adjustX:0,adjustY:0">
                                                        <img src="${product.images.middleimg}" />
                                                    </a>
                                                </div>
                                            </div>
                                            <div class="zoom-desc">
                                                #foreach($img in $product.images.imagelist)
                                                <a class="cloud-zoom-gallery" title="" href="$img.bigimg" rel="useZoom: 'zoom1', smallImage: '$img.middleimg' ">
                                                    <img class="zoom-tiny-image" alt="Thumbnail 0" src="$img.smallimg" />
                                                </a>
                                                #end
                                            </div>

调用随机产品

                               #foreach($item in $oct.GetRandomProductList(${currency},3))
                                                    <dl>
                                                        <dt>
                                                            <a href="$item.url" title="$item.name">
                                                                <img src="$item.images.smallimg" title="$item.name" alt="$item.name" width="189" />
                                                            </a>
                                                        </dt>
                                                        <dd class="prodName">
                                                            <a href="$item.url" title="$item.name">$item.name</a>
                                                        </dd>
                                                        <dd class="prodPrice">
                                                            <span class="oldPrice">${item.NormalPrice}</span>
                                                            <span class="price">${item.SalePrice}</span>
                                                            <span class="discount">Save:${item.Saveoff} off</span>
                                                        </dd>
                                                    </dl>
                                                    #end

调用函数

字符截取

$oct.CutString("${item.ProductID}+${item.name}",45)

$oct.CutUrl(${siteurl})

Octopus系列之各个页面调用示例的更多相关文章

  1. Octopus系列之各个页面调用示例2

    判断登陆的调用 #if(${islogin}) <span> ${Oct_Welcome} or <a href="${siteurl}customer/logout/&q ...

  2. 利用JavaScriptSOAPClient直接调用webService --完整的前后台配置与调用示例

    JavaScriptSoapClient下载地址:https://archive.codeplex.com/?p=javascriptsoapclient JavaScriptSoapClient的D ...

  3. ADO.NET系列之事务和调用存储过程

    ADO.NET系列之Connection对象 ADO.NET系列之Command对象 ADO.NET系列之DataAdapter对象 ADO.NET系列之事务和调用存储过程 前几篇我们介绍了Conne ...

  4. 股票数据调用示例代码php

    <!--?php // +---------------------------------------------------------------------- // | JuhePHP ...

  5. iframe父子页面调用小结

     子页面调用父页面 $('#Id', window.parent.document); //调用父页面元素 window.parent.func1(); //调用父页面方法  (子页面同理,需将js方 ...

  6. WebService核心文件【server-config.wsdd】详解及调用示例

    WebService核心文件[server-config.wsdd]详解及调用示例 作者:Vashon 一.准备工作 导入需要的jar包: 二.配置web.xml 在web工程的web.xml中添加如 ...

  7. iframe页面调用父窗口JS函数

    A页面iframe 页面B, 此时 如果要在B页面调用父页面A的函数 B页面写法 parent.functionName(); 错误1: 解决办法 var js_domain_async = 'bai ...

  8. JS 的子父级页面调用

    window.frames["iframevehquery"].add(); // 父页面调用嵌套子页面的js函数, iframevehquery 为 iframe 的name值, ...

  9. Octopus系列之如何让前台的js脚本变得灵活重用

    Octopus系列如何让前台的js脚本变得灵活,重用 方式1:ajax方式 方式2:form表单方式 面向对象的脚本封装 jQuery的封装 做Web开发的少不了前台Ajax的使用, 返回true:f ...

随机推荐

  1. 6.能够使HTML和PHP分离开使用的模板

    Smarty,Dwoo,TinyButStrong,Template Lite,Savant,phemplate,XTemplate

  2. ligerui_ligerTree_006_ligerui事件支持

    ligerui:ligerTree事件支持: 源码地址:http://download.csdn.net/detail/poiuy1991719/8571255 效果图: 代码:json.txt [ ...

  3. Excel应该这么玩——3、命名表格:彻底改造公式

    上一篇介绍了通过命名列将公式中的地址引用去掉,让公式更容易理解.但是之前的命名列只是针对单个表格的,如何引用其他表格的列是本篇的主要内容. 1.创建命名表格 命名表格的前提的创建表格,这个操作上一篇已 ...

  4. 引用参数,值参数,ref,out

    1,一个参数只有在引用的时候才能改变其值,这是一种情况 2,一个参数在引用后要永久的改变其值(可以用返回参数的形式) 3,多个参数在引用后要永久的改变其值或者多个参数中的部分(返回参数就适合了,因为只 ...

  5. 【转】mysql安装图解

    转载地址:http://www.jb51.net/article/23876.htm 很多朋友刚开始接触mysql数据库服务器,下面是网友整理的一篇mysql的安装教程,步骤明细也有详细的说明.   ...

  6. SUDTOJ 3323园艺问题 (线段树)

    园艺问题 Time Limit: 1000ms Memory limit: 65536K 有疑问?点这里^_^ 题目描述 本巨养了一盆双色茉莉.这种花有一种特点:第i朵花在第Di天盛开,刚开时是紫色的 ...

  7. Swashbuckle for asp.net core 配置说明

    0x00 安装 Swashbuckle 6.0 打开程序包管理器控制台,输入: Install-Package Swashbuckle -Pre 0x01 配置 Startup.cs public v ...

  8. IntelliJ IDEA使用(3)——IDEA连接Git

    摘要: Intellij IDEA作为最强大智能的IDE,内部已经集成了Git的功能,所以不用安装插件,连接Git@OSC也非常容易 首先安装git for windows 推荐使用这个:http:/ ...

  9. mysql之常用操作

    1. 数据库介绍 什么是数据库? 数据库(Database)是按照数据结构来组织.存储和管理数据的仓库,每个数据库都有一个或多个不同的API用于创建,访问,管理,搜索和复制所保存的数据.我们也可以将数 ...

  10. WP8没有开发者账号升级GDR3预览版的方法

    很多希望尝鲜WP8 GDR3的朋友一样希望提前体验GDR3的效果,但苦于没有开发者账号而不得其门!今天为大家带来普通账号升级GDR3的方法! 工具/原料 WP8智能手机 可用wifi热点 方法/步骤 ...