hi.
I have done some enhancements to the blog feature based on my needs. but didn't have the time to share it with you.
I'll try to post them here over time, so someone might see them useful and use them, or even maybe joe will add them to the main code.
enhancement number 1:
when the blog feature is paged, and the user clicks on one of the page numbers, he will be redirected to Blog/ViewList.aspx page.
because of the customizations I had on one site (and others may face this too), this page was not being shown with it's modules correctly as I wanted it. I didn't manage to clone it for my feature. instead I thought of this.
the user can be redirected to the same page, but that blogfeature will know which page to show, done using parameters.
also I implemented an script so that the same blog feature will have focus and the user won't have to scroll back down.
here are the codes:
instead of
//string pageUrl = SiteRoot + "/Blog/ViewList.aspx"
// + "?pageid=" + pageId.ToInvariantString()
// + "&mid=" + moduleId.ToInvariantString()
// + "&pagenumber={0}";
we can use:
string pageUrl = SiteUtils.GetCurrentPageUrl() + "?pagenumber" + ModuleId.ToInvariantString() + "={0}";
and in load params this can be used:
pageNumber = WebUtils.ParseInt32FromQueryString("pagenumber" + ModuleId.ToInvariantString(), pageNumber);
also for the focus enhancement, this code can be used.
PutFocusOnThisControlIfItsPageIsBeingViewed();
can be added at the end of load settings. and this is it's internal codes:
private void PutFocusOnThisControlIfItsPageIsBeingViewed()
{
//put focus on the usercontrol if user has clicked on one of the page numbers (if the related pagenumber is not null)
if (Request["pagenumber" + ModuleId.ToInvariantString()] != null)
{
//Find the control here and use the method.
string script = @" $(document).ready(function(){
document.getElementById('" + divblog.ClientID + "').scrollIntoView(); });";
Page.ClientScript.RegisterStartupScript(this.GetType(), "MaintainView", script, true);
}
}