- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDefault.vbhtml
More file actions
Latest commit
118 lines (113 loc) · 6.11 KB
/
Copy pathDefault.vbhtml
File metadata and controls
118 lines (113 loc) · 6.11 KB
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
111
112
113
114
115
116
117
118
@Code
' Handle user request to swap theme
IfNotRequest.QueryString("Theme")IsNothingThen
DimswapToAsString=Request.QueryString("Theme")
InitializeApplication.SwapTheme(swapTo)
EndIf
' set page theme and title properties
Layout=Helpers.SetTheme().ToString
PageData("Title")=HttpContext.Current.Application("DefaultTitle")
' Configure datasource connection
DimuserDatabaseAsString=InitializeApplication.DataConn()
' Dimension variables for recordset paging
DimpageSizeAsInteger=HttpContext.Current.Application("FeaturedNumRows")*HttpContext.Current.Application("FeaturedNumCols")
DimtotalRowsAsInteger=RecordSetPaging.GetRowCount(userDatabase,"Item_ID","webpages_Portfolio_Items","Item_Active = 'Y' And Item_Featured > 0")
IfpageSize<1ThenpageSize=totalRows
DimpageNumAsString=Request.QueryString("Page")
IfConvert.ToInt32(pageNum)<=0ThenpageNum=1
DimoffsetAsInteger=(pageNum-1)*pageSize
' Get bootstrap column span from user column number setting
DimcolumnSpanAsInteger=RecordSetPaging.GetColSpan(HttpContext.Current.Application("FeaturedNumCols"))
' Retrieve the dataset rows for this page
DimdatasourceAsDatabase=Database.Open(userDatabase)
DimsqlQueryAsString="Select Item_ID, Item_Title, Item_Slug, Item_Tagline, Item_FeaturedImage, Item_FeaturedImageCaption, Item_Body, Item_Created FROM webpages_Portfolio_Items WHERE Item_Active = 'Y' And Item_Featured > 0 Order by Item_Featured Asc OFFSET @0 ROWS FETCH NEXT @1 ROWS ONLY"
Dimrs_portfolio=datasource.Query(sqlQuery,offset,pageSize)
DimnumItemsAsInteger=rs_portfolio.Count()
EndCode
@SectionMeta
<metaname="Keywords"content="@HttpContext.Current.Application("DefaultKeywords")"/>
<metaname="Description"content="@HttpContext.Current.Application("DefaultDescription")"/>
EndSection
@Sectionfeatured
<sectionclass="featured">
<divclass="content-wrapper">
@Helpers.SetTheme().ToString
@IfNotHttpContext.Current.Request.Cookies("ThemeCookie")IsNothingThen
DimthecookieAsString=HttpContext.Current.Request.Cookies("ThemeCookie").Value.ToString
DimsessionAsString=HttpContext.Current.Session("SessionTheme")
@<p>thecookieexists: @thecookie</p>
@<p>thesessionis: @session</p>
@<p>@ApplicationSecurity.Encode("22")</p>
@<p>@ApplicationSecurity.Decode("MjIg")</p>Else
@<p>thecookiedoesnotexist</p>
EndIf
Modifythistemplatetojump-startyourASP.NETWebPagesapplication.
<p>current: @pageNumtotalrecords: @totalRowspagesize: @pageSize</p>
</div>
</section>
EndSection
<divclass="app-content">
@Ifrs_portfolio.Any()Then
DimiAsInteger=1
@<divClass="row">
<divClass="row-homefeatured">
<divClass="center-wrapper">
<divClass="col-md-12">
<hgroupclass="title">
<h1>@PageData("Title")</h1>
</hgroup>
<divClass="content-count">
@RecordSetPaging.RecordSetStats(offset,pageNum,pageSize,totalRows)
</div>
</div>
</div>
</div>
</div>
@<divClass="row">
<divClass="row-homefeatured">
<divClass="center-wrapper">
@ForEachitemInrs_portfolio
@<text>
<divclass="col-md-@columnSpan equal_height">
<divclass="@IIf((i Mod 2), "alt_home-featuredequal_height", "home-featuredequal_height")">
<h2>@i.ToString. @item("Item_Title")</h2>
@Ifitem("Item_Tagline")<>""Then
@<h3>@item("Item_Tagline")</h3>
EndIf
<divclass="item-date">@Strings.Format(item("Item_Created"),HttpContext.Current.Application("DateFormat"))</div>
@Ifitem("Item_FeaturedImage")<>""Then
@<divClass="thmb-featured">
<imgsrc="~/Portfolio_Images/@item("Item_FeaturedImage")"alt="@item("Item_Title")"title="@item("Item_Title")"/>
<divclass="item-featured-caption">@item("Item_FeaturedImageCaption")</div>
</div>
EndIf
@Html.Raw(StringExtensions.TrimTextProperly(item("Item_Body"),HttpContext.Current.Application("FeaturedTextTrim"),-1,-1,". . .",URL.Rewrite("PortfolioDetails?ItemID="&ApplicationSecurity.Encode(item("Item_ID"))&"&Title="&item("Item_Slug")),"Continue Reading »"))
</div>
</div>
</text>
i+=1
Next
</div>
</div>
</div>
@IfpageSize<totalRowsThen
@<divClass="row">
<divClass="row-homefeatured">
<divClass="center-wrapper">
<divClass="col-md-12">
@Html.Raw(RecordSetPaging.RecordsetNavBar(offset,pageSize,totalRows,"","Page",HttpContext.Current.Application("RSNavStyle"),"rs-nav-wrapper"))
</div>
</div>
</div>
</div>
EndIf
Else
@<divClass="row">
<divClass="row-homefeatured">
<divClass="center-wrapper">
<divClass="col-md-12"><h1>ThereAreNoRecords.</h1></div>
</div>
</div>
</div>
EndIf
</div>