Problem Customizing a theme...

Topics: Themes
Jun 15, 2008 at 7:16 PM
Hi all,
I am trying to customizing a theme and followed the screencasts given in the site of BE.net.

After i have completed everything that the screencast suggested, i am facing with a problem...

All the content is getting reflected in the page except for the post content.... that which should be populated by cphBody
I donno what the problem is....can anyone bail me out?

regards,
indey
Jun 15, 2008 at 9:26 PM
make sure your theme has the PostView.ascx control...

Does it?
Jun 16, 2008 at 10:39 AM
Hey Thanx Dan for your reply...

I have created the PostView.ascx contraol as well as the Commenview.ascx control....

When i click the title of the post(though it has no content in it....only the title) the post view is opening, but not displaying any of the content...
Jun 16, 2008 at 12:02 PM
Edited Jun 17, 2008 at 2:34 AM
Look at your PostView.ascx for:
<DIV class=text><asp:PlaceHolder id=BodyContent runat="server"></asp:PlaceHolder></DIV>

change it to:
<DIV class=text><%=Body %></DIV>

I know the latter has been deprecated but it is the only way I have found to get my custom theme to work.

EDIT to avoid confusion: The pertinent parts are within the div tags, your div tags may (and probably will) be different.
Jun 16, 2008 at 2:00 PM
Try:
  <div class="text"><asp:PlaceHolder ID="BodyContent" runat="server" /></div>

which is slightly different than the posted markup: quotations around "BodyContent" and a self-closing aspPlaceHolder ID...
I don't know if those little things will make the difference for you, or not, but it's worth noting.

Cheers!
Jun 16, 2008 at 8:15 PM
Thanx Taylex and Dan for your suggestions...

I replaced the <DIV class=text><asp:PlaceHolder id=BodyContent runat="server"></asp:PlaceHolder></DIV>

with <DIV class=text><%=Body %></DIV>

its working fine.. :)

Jun 17, 2008 at 2:35 AM
Edited Jun 17, 2008 at 2:36 AM
Glad you got it working. I haven't looked into this further to see what the issue is but it only happens to me when using code behind. Are you also using a code behind on your PostView.ascx file?
Jun 17, 2008 at 4:28 AM
Edited Jun 17, 2008 at 4:28 AM
I don't mean to presume anything, but I wonder what would happen if you used the semantically correct markup:
<div class="text"><asp:PlaceHolder ID="BodyContent" runat="server" /></div>
(lifted straight from the "default" theme)

The only reason I bring this up agian is that I am putting the finishing touches on my own ported theme, and that markup works like a charm for me.
Jun 17, 2008 at 12:05 PM
I've tried that Dan and it doesn't work for me. Are you using code behind or just a single PostView.ascx?
Jun 17, 2008 at 1:00 PM
Nope- no code behind in my PostView. I readily admit that I am not clever enough to put anything in there...


Jun 17, 2008 at 8:21 PM
Yup Taylex, im using a code behind for PostView.acsx

I'll try to remove that and try with the default one...

@Dan - i have tried using the code u have given...but it isn't working for me...
Jun 18, 2008 at 12:08 AM
Edited Jun 18, 2008 at 12:16 AM
I found the problem area.
When using Code Behind the error is:
 'themes_..._PostView.Page_Load(object, System.EventArgs)' hides inherited member 'BlogEngine.Core.Web.Controls.PostViewBase.Page_Load(object, System.EventArgs)'. Use the new keyword if hiding was intended. C:\Users\...\testblog\themes\...\PostView.ascx.cs 14 20 C:\...\testblog\

By simply removing:

protected

 

void Page_Load(object sender, EventArgs e) 
{

 

 )

 

the error is gone and the page loads as expected but I do not know if that is the preferred or correct method to address the issue.
Sorry for the poor formatting, I haven't been able to grasp this forum yet, and why the heck are the email notifications so spotty?!

Jun 18, 2008 at 8:27 PM
No help Taylex....I removed the Protected keyword from in the PostView.ascx.cs but the problem persists....

yup...even I have no clue about the email notifications...
Coordinator
Jun 18, 2008 at 9:17 PM
Take a look at this post, it shows porting theme from scratch.