|
|
|
Forum Newbie
      
Group: Forum Members
Last Login: 02/01/2007 12:46:48
Posts: 12,
Visits: 74
|
|
| Warning: Do not attempt this if you don't know what it is doing! If you are willing to do a hack which isn't very pretty, and totally at your own risk... (But you can do it with the End Users version). It will give your start page a bit of a weird description, but should give you a semi decent description for the rest of your pages assuming you have decent topic titles and topic descriptions. Change the bits in red to the name of your forum or it won't make much sense... To summarise what will happen: In a Forum/Category: - With description Meta Description becomes:
Discuss Forum Name in Your Forum's Name: Forum Description - Without description Meta Description becomes:
Discuss Forum Name in Your Forum's Name
In a Topic/Other Page: - With description Meta Description becomes:
Discuss Page Title in Your Forum's Name: Topic Description - Without description Meta Description becomes:
Discuss Page Title in Your Forum's Name
It works well appart from the first page gets called: Discuss Your Forum's Name in Your Forum's Name
Though use at your own risk. I have not tested it fully nor am I aware of potential side effects this may cause. Pop in and edit this file: \InstantASP.InstantForum\InstantASP.InstantForum.UI\MasterPages\MasterTemplate.vb Change the Page_Load in the #region Page Events to: Public Sub Page_Load(ByVal sender As Object , ByVal e As System.EventArgs) Dim aString As String = InstantASP.InstantForum.Formatters.Control.FormatPageHeader(InstantForumHeader, CurrentContext) Dim header As New System.Text.StringBuilder(aString) Dim indexStart As Integer = aString.IndexOf("<title>") + 7 Dim indexEnd As Integer = aString.IndexOf("</title>", indexStart) aString = aString.Substring(indexStart, indexEnd - indexStart) If Not CurrentContext.CurrentTopic Is Nothing AndAlso currentContext.CurrentTopic.TopicID > 0 Then If CurrentContext.CurrentTopic.Description.Length > 0 Then header.AppendFormat("<meta name=""description"" content=""{0} in Your Forum's Name: {1}"" >", aString, CurrentContext.CurrentTopic.Description)
Else header.AppendFormat("<meta name=""description"" content=""Discuss {0} in Your Forum's Name"" >", aString)
End If
ElseIf Not CurrentContext.CurrentForum Is Nothing AndAlso CurrentContext.CurrentForum.ForumID > 0 AndAlso CurrentContext.CurrentForum.Description.Length > 0 Then header.AppendFormat("<meta name=""description"" content=""Discuss {0} in Your Forum's Name: {1}"" >", aString, CurrentContext.CurrentForum.Description)
Else header.AppendFormat("<meta name=""description"" content=""Discuss {0} in Your Forum's Name"" >", aString)
End If InstantForumHeader.InnerHtml = header.ToString
End Sub Cheers Jeremy
Jeremy Hopkin The Wine Community Forums for Champagne Reviews
|
|
|
|