Headline News Control (Update)

13. April 2009 12:00 PM

After reviewed the comment from Prima, I notice it is a must capabilty to limit a dedicated group of user from accessing the NewsBar's admin console, especially in the multi editors environment.

Hence, I review the Newsbar code and decided to go one step further... instead of hardcoded the role in the code. I created a "Roles" property which allow webmaster to define which roles are allow to access the NewsBar's admin console, like we defined an link in the web.sitemap page as show in code snippet below.

 

ToDo...

   1:  <hz:NewsBar id="newsbar" runat="server" Roles="Administrators, Editors" />

If the Roles is set to "Administrators", then only those login user with the "Administrators" role can access the NewsBar management console, same as apply to "Editors". The default value is "Administrators, Editors", which is enabled for both administrators and editors user group.

To read more about this control, please visit this link...

 

Download Here... 

newsbar-freshcitrus.zip (9.94 kb)
newsbar-inove.zip (11.75 kb)
portraitpress.zip (8.90 kb)

 

BlogEngine.NET

Best way to sort out the old posting

7. April 2009 5:17 PM

I had used some others free blogging platform in the pass, and they always list out all my old posting with the correspond status in the control panel. Which is the most easiest way to find a particular post. 

Unfortunately, the BlogEngine.NET platform I used was not cover this area. Which mean I either have to search by key words or walk through page-by-page. Also, I found it was very difficult for me to visually find out which of my posting are not publish or in scheduling.

Due to I am too lazy searching thorugh page-by-page, so I made a step forward to create my own listing page.

With this listing control, I am easily get to the posting I need by the aids with the following support filters,

  • By Post or Page.
  • By Category or Tags.
  • By Published, Hidden or Scheduled

ToDo

  1. Unzip the Listings.zip
  2. Copy the Listings.ascx/ascx.cs files into your blog /admin/pages directory.
  3. Next you need to add the following line of code into the /admin/pages/web.config (code snippet #1).
  4. Last, you need to include the Listings.ascx into your site map (\web.sitemap) config file (code snippet #2).

Code snippet #1

   1:    <location path="Listings.aspx">
   2:      <system.web>
   3:        <authorization>
   4:          <allow roles="administrators"/>
   5:          <deny users="*" />
   6:        </authorization>
   7:      </system.web>
   8:    </location>
 

Code snippet#2

   1:  <?xml version="1.0" encoding="utf-8" ?>
   2:  <siteMap xmlns="
   3:  http://schemas.microsoft.com/AspNet/SiteMap-File-1.0
   4:  ">
   5:    <siteMapNode url="default.aspx" title="Blog Engine" description="" roles="administrators, editors">
   6:      <siteMapNode url="~/admin/Pages/Listings.aspx" title="Listings" description="" roles="administrators, editors"/>
   7:    </siteMapNode>
   8:  </siteMap>
 

Once you have done the above steps, you will be able to access the Listing page via the admin menu shown below.

Since, I can save my time with this little adds-in control, and I wish it can help you save your time as well. So, do enjoy it! 

Listings.zip (4.94 kb)

 

BlogEngine.NET

Headline News Control

19. March 2009 1:33 PM

Sometimes I wish some of my posting always pinned at the top of my blog which can delivery to each of the new reader without wasting thier time to search through the old posting, like I would like to publish an announcement for a certain of time frame. Unfortunately I can not get a ready to use control for it. Therefore, I come to the mind to create my own headline control that serve my purpose, and after a struggle few days of coding... Finally I get my headline control up and deploy into my blogging site.

Since it is a add on feature for the BlogEngine.NET, and I would like to share with other BlogEngine.NET user as well. For time being, I have customized the NewsBar for freshcitrus and inove theme. I will try to adopt it to more themes in future for those who would like to use this control in thier blog.

To deploy this headline control into your blog site is simple, all you need to do is follow the steps below and you will get it done and running in just few minutes,

How to...

  1. Unzip the downloaded headline control
  2. Copy the following files into the respective theme folder
    1. NewsBar.ascx
    2. NewsBar.ascx.cs
    3. NewsBar.css
    4. site.master 1
  3. Copy the nbmc.png2 into the images folder under the theme folder.
  4. Refresh your blog, and login to start defined the headline news and featured news that you wish to pinned at top of your blog.

 

To do...

1To consume the headline control, all you just need to do is add the following code into the site.master file,

   1:  <%@ Register TagPrefix="hz" TagName="NewsBar" Src="NewsBar.ascx" %>
   2:  <!-- place the following code at the place you want the headline control to be shown -->
   3:  <hz:NewsBar id="newsbar" runat="server" />

2The nbmc.png is the admin control panel background image used headline control (NewsBar.ascx), you may create your own image and overwrite it or even modify the NewsBar.css to fit your selected theme.

Where is...

All the defined headline and features news was save under App_Data\NewsBar.xml with the following format.

   1:  <?xml version="1.0" encoding="utf-8" standalone="yes"?>
   2:  <News>
   3:      <Title>A1 Headline</Title>
   4:      <ShowTitle>0</ShowTitle>
   5:      <PublishLocation>1</PublishLocation>
   6:      <Headline Type="0">539c672f-f9d1-47bf-bb11-c7e698751fb8</Headline>
   7:      <Featured>
   8:          <Post Type="0">0ce20c70-779a-4031-a167-858681447648</Post>
   9:          <Post Type="0">17084e6e-4cb1-4694-8d43-5d58acc08a42</Post>
  10:      </Featured>
  11:  </News>

Where the Type="0" mean the stored GUID is refering to a Post, and Type="1" mean refering to a Page.

Admin Console...

Once you have login, the 'Headline Management Concole' as shown in screen shot below will be available for you.

 Headline Management Console

With the console, you can make the following change,

  1. Change the headline section title.
  2. Decide to show/hide the headline section title.
  3. Define where you want the headline/features news beging display
    1. None
    2. All Location
    3. Post list only
    4. Single post
    5. Single page
    6. Post list and single post
    7. Post list and single page
    8. Post list and page list
  4. Select which page/post to be display as headline news.
  5. Add/remove any page/post from the featured news list.

Update...

  • 24, March 2009 11:52 AM, Included Newsbar for PortraitPress theme.
  • 13, April 2009 12:00 PM, Limit dedicated group of user access the Newsbar's admin console, more...

 

Download Here... 

newsbar-freshcitrus.zip (9.77 kb)
newsbar-inove.zip (11.57 kb)
newsbar-portraitpress.zip (8.72 kb)

BlogEngine.NET