irbanjit
  •  irbanjit
  • 51.2% (Neutral)
  • YAF Forumling Topic Starter
2012-02-03T00:59:03Z
Hi,

I am new to yaf, what is the best way to create a custom page in yaf?

Thanks!
-Irbanjit
Sponsor
daveburke
2012-02-03T01:40:55Z
Irbanjit,

There are a few tips you need to know. It depends on what type of page and where you want to add it, but YAF .ASCX pages inherit from ForumPage or ForumPageRegistered (the latter for pages within a user profile typically.)

So when creating a page, inherit from one of those. Example:


namespace YAF.Pages
{
    // YAF.Pages
    #region Using

    using...
	
    #endregion

    /// <summary>
    /// Summary description for customPage.
    /// </summary>
    public partial class customPage : ForumPage
    {
      ...
    }


Second, add the page to YAF.Types.Constants.ForumPages, like so


namespace YAF.Types.Constants
{
  /// <summary>
  /// List of all pages available in the YAF forum
  /// </summary>
  public enum ForumPages
  {
    forum,
    ...
    customPage
}


Then you can link to the page like this:


string.Format("<a href={0}>{1}</a>", YafBuildLink.GetLink(ForumPages.customPage), "My Custom Page");


or

http://yoursite.com/forum/yaf_customPage.aspx


OR.....

There could be a far simpler way that one of the YAF Gurus knows that I don't. :)

Hope that helps,
-Dave
irbanjit
  •  irbanjit
  • 51.2% (Neutral)
  • YAF Forumling Topic Starter
2012-02-04T00:16:07Z
Dave, Thanks a million, that was great help. I am little surprise that their isn't much documentation on the topic.

-Irbanjit
rocky
  •  rocky
  • 55.4% (Neutral)
  • YAF Forumling
2013-10-14T12:17:42Z
Thanks,i solved that issue .
your comments are very useful.
Thanks alot Smile
s3b4k
  •  s3b4k
  • 59.6% (Neutral)
  • YAF Camper
2013-11-14T20:43:15Z
thanks works perfectly
the signature

About Us

The YAF.NET is an open source .NET forum project. YAF.NET is supported by an team of international developers who are build community by building community software.

Powered by Resharper Donate with PayPal button

Project Twitter Updates

Copyright © YetAnotherForum.NET & Ingo Herbote. All rights reserved