Skip to content

Instantly share code, notes, and snippets.

View grumpycatsaysno's full-sized avatar
:octocat:
coding in the deep

Veronica Milcheva grumpycatsaysno

:octocat:
coding in the deep
View GitHub Profile
<url>
<loc>https://www.argoventuresdigital.com/blog/post/my-fancy-blog-post</loc>
<priority>0.5</priority>
</url>
private static void Before_Writing(ISitemapGeneratorBeforeWriting evt)
{
// gets the entries that are about to be written in the sitemap
var entries = evt.Entries.ToList();
// gets the full Url
string hostUrl = SystemManager.CurrentHttpContext.Request.Url.ToString();
// get all the blog posts
BlogsManager manager = BlogsManager.GetManager();
void SystemManager_ApplicationStart(object sender, EventArgs e)
{
EventHub.Subscribe<ISitemapGeneratorBeforeWriting>(Before_Writing);
}
protected void Application_Start(object sender, EventArgs e)
{
SystemManager.ApplicationStart += SystemManager_ApplicationStart;
}
protected void SystemManager_ApplicationStart(object sender, EventArgs e)
{
//add your implementation here
}
<script type="text/javascript">
$(document).ready(function () {
$('div.sf_pagerNumeric ul a').each(function () {
$(this).wrap("<li></li>");
});
});
<%@ Control Language="C#" %>
<%@ Register Assembly="Telerik.Sitefinity" Namespace="Telerik.Sitefinity.Web.UI" TagPrefix="sf" %>
<sf:SitefinityHyperLink ID="cmdFirst" runat="server" Text="<%$Resources:Labels, Paging_First %>" />
<sf:SitefinityHyperLink ID="cmdPrev" runat="server" Text="<%$Resources:Labels, Paging_Prev %>" />
<div runat="server" id="numeric1" class="sf_pagerNumeric pagination">
<ul id="numeric" runat="server">
</ul>
</div>
<sf:SitefinityHyperLink ID="cmdNext" runat="server" Text="<%$Resources:Labels, Paging_Next %>" />
<ul class="pagination">
<li><a href="#">1</a></li>
<li><a href="#">2</a></li>
<li><a href="#">3</a></li>
<li><a href="#">4</a></li>
<li><a href="#">5</a></li>
</ul>
<div class="pagination">
<a href="#">1</a>
<a href="#">2</a>
<a href="#">3</a>
<a href="#">4</a>
<a href="#">5</a>
</div>
private string SetDates(string sYear, string sMonth, string sDay, out System.Collections.Generic.List<object> values, string propertyName, int index1, int index2)
{
System.DateTime time;
System.DateTime time2;
int num = int.Parse(sYear);
if (string.IsNullOrEmpty(sMonth))
{
time = new System.DateTime(num, 1, 1, 0, 0, 0);
time2 = new System.DateTime(num, 12, System.DateTime.DaysInMonth(num, 12), 0x17, 0x3b, 0x3b);
}
private IQueryable<BlogPost> FilterByCustomDateTimeCriteria(IQueryable<BlogPost> query, string sYear, string sMonth, ref int? totalCount)
{
var values = new List<object>();
var filterValues = new List<object>();
var years = sYear.Split(',');
var months = sMonth.Split(',');
//if the url does not contain a pair of month and year the query will not be filtered
if (years.Count() != months.Count())