blog feature enhancements

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
4/14/2012 12:59:12 AM
Gravatar
Total Posts 192

blog feature enhancements

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);

}
}

You must sign in to post in the forums. This thread is closed to new posts.