Custom Pages

Oct 17, 2010 at 3:52 PM

Hi there:

I have a client that does not want some of the controls on the sidebar of the page. They want a seperate page built for categories. I have created a page for categories, is there anyway I can get the category list into the page? Maybe there is another way to do this. I am stumped. I tried adding the code from the master file, but it just disappeared. Any help would be great.

Coordinator
Oct 17, 2010 at 8:18 PM

The Category List widget is a wrapper around the Category List control.  If you created your own ASPX page (which it sounds like), you can have the Category List control displayed on that page by adding the following to the ASPX page:

<blog:CategoryList runat="server" />

Oct 17, 2010 at 9:07 PM

Hi Ben:

Thanks for your response. I tried to add this to the aspx page through the administration panel. I opened up the HTML panel and added it, but it disappeared (I take it because its not HTML). How do I add this to the new page? I dont see the page anywhere in the server files. Thanks.

Coordinator
Oct 17, 2010 at 10:13 PM

Is this a BE Page you created thru the BE control panel?

If so, you're sort of in luck because BE has the capability to dynamically inject controls into a Page.  However, it looks like as it is, the control you inject needs to be a physical ASCX file, whereas the Category List control is a compiled control.  But this is simple to workaround.  If you create a new file in the BE root called "category_list.ascx", and put the following 2 lines into that new file:

 

<%@ Control Language="C#" AutoEventWireup="true" EnableViewState="false" %>
<blog:CategoryList runat="server" />

Then, in your BE page, you can use this special markup to inject the user control:

[usercontrol: ~/category_list.ascx]

 

Type or copy that into the WYSIWYG editor for the BE page.  When the BE page displays, you should see the Category List in the page.

Oct 17, 2010 at 10:59 PM

Hi Ben:

That worked! Thank you. I have a couple other questions you may be able to help with as well (hopefully). The client wants two more pages that basically just re-arrange the order of the postings. One for most comments, and one for most viewed. Basically it would just look like the main list of articles, but sorted by either of these attributes. Not sure if this can even be done.

Also, is there a way to include the authors photo in each post? I know there is a place to upload the picture in the admin/users section.

Last question. Is there a way to move the related posts below the comments sections. I cannot find the actual file to do this.

Thanks in advance for all your help.

 

Coordinator
Oct 19, 2010 at 2:45 AM

Glad to hear that worked.

I would suggest searching past Discussions here to find how to accomplish those things -- as most of those things have been discussed here at one time or another.  You could also post new discussion threads here for those items if you get stuck.