Wiki source code of StoreContentFeatured

Last modified by Alex Cotiugă on 2018/11/12 14:00

Hide last authors
Ecaterina Moraru (Valica) 2.13 1 {{velocity output="false"}}
Vincent Massol 6.1 2 #set($discard=$xwiki.ssx.use("EXOExtension.StoreContentFeatured"))
Ecaterina Moraru (Valica) 1.1 3 #set($docextras=[])
4 {{/velocity}}
Ecaterina Moraru (Valica) 2.14 5 {{velocity output="false"}}
Alex Cotiugă 8.1 6 #macro(displayStoreItem $name $url $summary $icon $category)
Ecaterina Moraru (Valica) 2.1 7 ##set ($itemDoc = $xwiki.getDocument($sitem))
8 ##set ($itemObj = $itemDoc.getObject('ExtensionCode.ExtensionClass'))
9 ##set ($itemURL = $xwiki.getURL($sitem))
Vincent Massol 7.1 10 #set ($itemURL = $url)
Ecaterina Moraru (Valica) 2.1 11 ##set ($itemName = $itemObj.getProperty('name').getValue())
Vincent Massol 7.1 12 #set ($itemName = $name)
Ecaterina Moraru (Valica) 2.1 13 ##set ($itemSummary = $itemObj.getProperty('summary').getValue())
Vincent Massol 7.1 14 #set ($itemSummary = $summary)
Ecaterina Moraru (Valica) 2.1 15 ##set ($itemIcon = $itemObj.getProperty('icon').getValue())
Vincent Massol 7.1 16 #set ($itemIcon = $icon)
Ecaterina Moraru (Valica) 2.1 17 ##set ($itemType = $itemObj.getProperty('type').getValue())
18 #set ($itemType = "Paid")
19 ##set ($itemCategory = $itemObj.getValue('category'))
Alex Cotiugă 8.1 20 #set ($itemCategory = $category)
21
22 {{html clean="false"}}
Alex Cotiugă 12.23 23 <div class="wrap-to-click col-xs-4">
Alex Cotiugă 11.62 24 <div class="top-product $itemType">
25 <a href="$itemURL" title="$itemName" class="hidden">
26 <label class="short-desc">$itemName</label>
27 <span class="product-icon">
28 #if($itemIcon!='')${services.icon.renderHTML($itemIcon)}#else <span class="fa fa-search"></span>#end
29 </span>
30 </a>
31 </div>
32 <div class="bottom-product">
33 <div class="actions hidden">
34 <a href="$itemURL" class="btn btn-primary"><span class="fa fa-shopping-cart"></span></a>
35 #if($itemType=='trial')&nbsp;<a href="$itemURL" class="btn btn-default"><span class="fa fa-cloud-upload"></span></a>#end
36 </div>
37 <a href="$itemURL" title="$itemName">
38 <label class="short-desc">$itemName</label>
39 </a>
40 <div class="product-name">$itemSummary</div>
41 <div class="price-reviews">
42 <div class="row custom-flex">
Alex Cotiugă 12.14 43 <div class="col-sm-6 col-xs-12 category-bottom">
Alex Cotiugă 11.62 44 <span class="category">$itemCategory</span>
Ecaterina Moraru (Valica) 1.1 45 </div>
Alex Cotiugă 12.14 46 <div class="col-sm-6 col-xs-12 price-bottom">
Alex Cotiugă 11.62 47 <div class="price-box">
48 <p class="old-price">
49 <span class="price">$itemType</span>
50 </p>
51 <p class="regular-price hidden">
52 <span class="price">$99.00</span>
53 </p>
54 </div>
55 </div>
56 </div>
57 </div>
58 </div>
59 </div>
Ecaterina Moraru (Valica) 1.1 60 {{/html}}
61 #end
62 {{/velocity}}
63
64 {{html wiki="true" clean="false"}}
65 <div class="homepage-featured">
66 <div class="contain clearfix fill-white keyline-top padding-top4">
Ecaterina Moraru (Valica) 7.3 67 <div class="homepage slide">
Ecaterina Moraru (Valica) 1.1 68 <div class="blocktitle col-xs-12 col-md-12">
Vincent Massol 4.1 69 = Sponsored Extensions =
Vincent Massol 5.1 70 == Extensions featured by [[XWiki SAS>>http://xwiki.com]] (as the [[Top Sponsoring Company>>dev:Community.Governance]]), and available on the [[XWiki SAS Store>>https://store.xwiki.com/xwiki/bin/view/Main/WebHome]] ==
Ecaterina Moraru (Valica) 1.1 71 <div class="clearfix row">
72 <div class="featured list-product">
73 {{/html}}
74
Ecaterina Moraru (Valica) 2.1 75 {{comment}}
Ecaterina Moraru (Valica) 1.1 76 {{velocity}}
77 #set($hql = "select obj.name from BaseObject obj where obj.className='ExtensionCode.ExtensionClass'")
78 #set($results = $xwiki.search($hql, 3, 0))
79 #foreach ($item in $results)
80 #set ($itemDoc = $xwiki.getDocument($item))
81 #if($itemDoc.name != 'ExtensionTemplate')
82 #displayStoreItem($item)
83 #end
84 #end
85 {{/velocity}}
Ecaterina Moraru (Valica) 2.1 86 {{/comment}}
Ecaterina Moraru (Valica) 2.16 87
Ecaterina Moraru (Valica) 2.1 88 {{velocity}}
Alex Cotiugă 10.2 89 #set ($storeFeaturedDoc = $xwiki.getDocument('EXOExtension.StoreContentFeatured'))
Alex Cotiugă 8.1 90 #set ($extensionsAttachment = $storeFeaturedDoc.getAttachment('extensions.json'))
91 #set ($extensionsJSON = $jsontool.parse($extensionsAttachment.contentAsString))
Alex Cotiugă 11.2 92
93 (% id="img-product-view" class="owl-carousel owl-theme" %)
94 (((
95 #foreach ($extension in $extensionsJSON.entrySet())
Alex Cotiugă 11.55 96 #if ($foreach.index % 3 == 0)
97 (% class="item" %)(((
98 (% class="wrap-item-product"%)(((
99 #end
Alex Cotiugă 11.5 100 #set ($value = $extension.value)
101 #displayStoreItem($value[0] $value[1] $value[2] $value[3] $value[4])
Alex Cotiugă 11.55 102 #if ($foreach.index % 3 == 2)
103 )))
104 )))
105 #end
Alex Cotiugă 11.2 106 #end
107 )))
108
Alex Cotiugă 12.30 109 {{OwlCarousel2 id="img-product-view" loop="true" dots="true" autoplay="true" autoplayTimeout="5000" autoplayHoverPause="true" responsive="true" items480="1" items768="1" items992="1" items1200="1" /}}
Ecaterina Moraru (Valica) 2.1 110 {{/velocity}}
Ecaterina Moraru (Valica) 2.16 111
Ecaterina Moraru (Valica) 1.1 112 {{html clean="false"}}
113 </div>
114 </div>
115 </div>
116 </div>
117 </div>
118 </div>
119 {{/html}}

Get Connected