This project is read-only.

using a page as a menu item

Topics: Themes
Feb 21, 2011 at 2:43 PM
I think it's fairly common for Blogs to have a few static pages in their main menu. I wanted an 'About' page in my main menu.
In this excerpt from site.master I have added an ‘About’ page. I created a page called about using the Administration pages 
add new page. Then added a link to it in site.master. It displays like the other menu items and works as desired. In this 
context what are Resources.labels? Should I create one for the about page? If so where/how? 
                <li><a class="home" href="<%=Utils.AbsoluteWebRoot %>" rel="home"><%=Resources.labels.home %></a></li>
                <li><a href="<%=Utils.AbsoluteWebRoot %>archive.aspx"><%=Resources.labels.archive %></a></li>
                <li><a href="<%=Utils.AbsoluteWebRoot %>contact.aspx">< %></a></li>
                <li><a href="<%=Utils.AbsoluteWebRoot %>search.aspx">< %></a></li>      
                <li><a href="<%=Utils.AbsoluteWebRoot %>page/About.aspx">About</a></li>      
In the Administration pages add new page dialogue there is an option to ‘select parent’ and a check box ‘is front page’ 
It might make a useful addition to blogengine to also have a check box something like ‘is menu item’ or have menu as a 
parent item in the select parent dialouge. That way there would be a possibility that a page could be a menu item without 
editing site.master in each theme. Allowing the site theme to be changed and keeping the menu intact through theme changes.
Feb 22, 2011 at 5:13 AM
Edited Oct 24, 2011 at 8:21 PM

I made a custom solution to this check this post out:

PageLinkMenu gives the user full control over their pages. It adds 4 new elements to the page xml file. Page Name, Link Name, Link Menu, and Page Sort.


It is also a fork pending being added to BE .


You can view it live here:


All of the pages on there are pages and using the PageLinkMenu.  


No hard coding any links in the master page.


Your question: 

what are Resources.labels? 

The labels are for international support in languages. Easier to just translate the resources than going through each
page and etc.



<%@ Master Language="C#" AutoEventWireup="true" CodeFile="site.master.cs" Inherits="StandardSite" %>
<%@ Import Namespace="BlogEngine.Core" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="" xml:lang="en" lang="en">
<head runat="server" profile="">
<link rel="stylesheet" href="style.css" type="text/css" />
<link rel="shortcut icon" href="~/pics/blogengine.ico" type="image/x-icon"/>

<div id="header">
<p><a href="<%=Utils.AbsoluteWebRoot %>"><%=BlogSettings.Instance.Name %></a></p>
<span><%=BlogSettings.Instance.Description %></span>

<div id="menu">

<div class="login">
<span runat="server" id="aUser"></span><a runat="server" id="aLogin" />

<li><a href="<%=Utils.AbsoluteWebRoot %>" rel="home"><%=Resources.labels.home %></a></li>
<li><a href="<%=Utils.AbsoluteWebRoot %>archive.aspx"><%=Resources.labels.archive %></a></li>
<li><a href="<%=Utils.AbsoluteWebRoot %>contact.aspx">< %></a></li>
<li><blog:LinkMenu ID="LinkMenu1" runat="Server" Filter="Header" /></li>
<li><a href="<%=Utils.FeedUrl %>" class="feed"><img src="<%=Utils.AbsoluteWebRoot %>pics/rssButton.png" alt="Feed" />
Resources.labels.subscribe %></a></li>
<li><a href="javascript:void(BlogEngine.filterByAPML())" class="apmlfilter"><%=Resources.labels.filterByApml %></a></li>

<form runat="Server" class="body">

<div id="content">
<blog:SearchOnSearch runat="server" MaxResults="3" Headline="You searched for"
Text="Here are some results for the search term on this website" />
<asp:ContentPlaceHolder ID="cphBody" runat="server" />

<p id="footer">
Powered by <a href="">BlogEngine.NET</a> <%=BlogSettings.Instance.Version() %><br />
Theme by <a href="">Mads Kristensen</a>

<div id="sidepanel">
<blog:WidgetZone runat="server" ZoneName="be_WIDGET_ZONE" />



Java Blog

Apr 21, 2011 at 4:35 PM
Edited Apr 21, 2011 at 9:39 PM


Just as the person from the original post I would like to add items to the menu.

I just started with BE (have 2.0 installed) after struggling with WP, but I am uncertain as to what to do with the code you show here.
Could you please explain what steps somebody needs to take to make this work the way you show here?

I do have MS Visual Studio 2010 so if I need to do anything with the code you show here any steps to take would be appreciated.

Thanks in advance, looking forward to your answer,

Boudewijn Lutgerink.

Apr 21, 2011 at 11:11 PM

With 2.0, you can add anywhere in your theme:

<blog:PageMenu ID="PageMenu1" runat="Server" />

BE will generate nested unordered list that you can use as a menu. Details are here, but now it is in the core and no need to download anything.

Apr 22, 2011 at 8:16 AM
Edited Apr 22, 2011 at 1:01 PM

Thanks very much for a quick reply. That is much appreciated.
I tested it but this is not quite what I want. I really want a menu to appear as shown by kbdavis07.
Hence my question to him how to implement the code he shows.
I tested this code but I am missing something. The extra options do not appear when I add a new page.

Also I get a web.config error



Apr 22, 2011 at 8:38 PM

When you download from the source you got to rebuild it before you upload to server.


In Visual Web Dev  do Build --> Rebuild Core


That makes a new .dll files for you.


Now upload to server.

Apr 24, 2011 at 5:52 AM
Edited Apr 24, 2011 at 10:09 AM

Opened the project. Trying to rebuild it as you adviced. What I got are 9 errors and 5 warnings.

This not going to be as easy as suggested, I'm afraid.

I saw on StackExchange that you have a web deployable version ready. Could I have that as well please?
FYI, I am not very good in C# or any other .Net language, I want to set up quite a few sites asap and I do not have time or desire to go deep into the technique.

Maybe at a later stage I will, but I now have other priorities. So if you could send me the deployable version I would greatly appreciate that.



Apr 24, 2011 at 6:52 PM


Web source is here:


Just unzip and upload to server thats it!


Tested it again no errors.


If you have any more questions please ask.

Apr 24, 2011 at 10:09 PM

You're my hero. It works like a charm. The only adjustment I needed to make was to use the 4 web.config, but that was a no-brainer.

Thanks VERY much from the Netherlands, happy easter Holidays.



Apr 24, 2011 at 10:30 PM

Glad I could help :)

Apr 24, 2011 at 10:32 PM

What is your website where this is being used?  I will like to look at it if you don't mind :)

Apr 24, 2011 at 11:01 PM

Will send you some links later. I am now gonna hit the sack. (close to mid night in Holland).

FYI, I am gonna use BE for Affiliate marketing sites and I needed a way to handle related keywords and subjects.

Now I can give it a go. Your solution is THE most elegant I came across.

I can use this on many sites. Talk about that later.

With the ease of use of BE, I wonder why so many people still use WordPress.

Again, thank you VERY much for your fast response and co-operation.


From: kbdavis07 [email removed]
Sent: zondag 24 april 2011 23:32
Subject: Re: using a page as a menu item [blogengine:246913]

From: kbdavis07

What is your website where this is being used? I will like to look at it if you don't mind :)