YAFLogo

nj609eagle
  • nj609eagle
  • 55.4% (Neutral)
  • YAF Forumling Topic Starter
16 years ago
I currently have YAF 1.9.3 running in a sub-folder called forums.

The main site is running BLogEngine.NET 1.4.5

This merger was easy. Hoever I want to use the YAF Header and Menu on all pages even thouse outside of the forums folder.

It appears that I have to initalize a YAFContext for the wite so the themes are grabbed properly, but it's not working.

Any help will be appreciated!

Sponsor
test2005
16 years ago
Jaben would be your man for a deffinate answer...but try this..

Dump this into a page and see it it works


<%@ Register TagPrefix="YAF" TagName="ForumWelcome" Src="../controls/ForumWelcome.ascx" %>

<YAF:ForumWelcome runat="server" ID="Welcome" />

Obviously, the register tag is at the top, the control tag in the main page.

HTH

:)


.....the man in black fled across the desert..........and the gunslinger followed.....

nj609eagle
  • nj609eagle
  • 55.4% (Neutral)
  • YAF Forumling Topic Starter
16 years ago
Ok, that seems to make a little more sense, however, it's still not working.

Backinng up a step, i'm placing this in my site mater page. It's pathing out to the control without issue.

the error is:


Line 40: 		void ForumWelcome_PreRender( object sender, EventArgs e )
Line 41: 		{
Line 42: 			TimeNow.Text = String.Format( PageContext.Localization.GetText( "Current_Time" ), YafDateTime.FormatTime( DateTime.Now ) );
Line 43: 			TimeLastVisit.Text = String.Format( PageContext.Localization.GetText( "last_visit" ), YafDateTime.FormatDateTime( Mession.LastVisit ) );
Line 44: 
 

Source File: d:\WebSites\BlogEngine\Forums\controls\ForumWelcome.ascx.cs    Line: 42 

It seems like teh PageContext itsn't being set yet.

Is there some way to initalize the YAFContext.Current?

Global.asax file?

test2005
16 years ago
Well, providing you have all the DLL's in the site BIN directory, the control should load!!! So I'm as confused as you are! Outside my knowledge for YAF I'm afraid. Hopefully one of the developers will pop in and point you in the right direction.
.....the man in black fled across the desert..........and the gunslinger followed.....

nj609eagle
  • nj609eagle
  • 55.4% (Neutral)
  • YAF Forumling Topic Starter
16 years ago
I'm using dynamic classes. I copied all of te YAF code into the APP_Code directory under a YAF folder
test2005
16 years ago

I'm using dynamic classes. I copied all of te YAF code into the APP_Code directory under a YAF folder

nj609eagle wrote:

Make sure you have all of the references to ALL your dynamic classes in the web.config file.

IE:



<system.web>
    <pages>
        <controls>
            <add tagPrefix="YAF" namespace="YAF.Classes.UI" />
            <add tagPrefix="YAF" namespace="YAF.Classes.Utils" />
            <add tagPrefix="YAF" namespace="YAF.Classes.Data" />
            <add tagPrefix="YAF" namespace="YAF.Controls" />
            <add tagPrefix="YAF" namespace="YAF.Controls.Statistics" />
            <add tagPrefix="YAF" namespace="YAF.Classes"/>
            <add tagPrefix="YAF" namespace="YAF"/>
            <add tagPrefix="editor" namespace="YAF.Editor"/>
        </controls>
    </pages>
</system.web>


.....the man in black fled across the desert..........and the gunslinger followed.....

nj609eagle
  • nj609eagle
  • 55.4% (Neutral)
  • YAF Forumling Topic Starter
16 years ago
Problem resolved...but a little ugly.

In my site.master page, i added


<YAF:Forum runat="server" ID="masterforum" Visible="false" />
<YAF:Header runat="server" ID="forumheader" />
This did all of the initilizations i needed.

Now I'll create my own header so it will render appropiately and for my BE.NET theme