This project is read-only.

SimpleBlog remove sidebar code needs help

Jan 4, 2014 at 9:01 PM
I am trying to remove the sidebar on several pages using this code that has worked for the 2.8 standard theme. Thank you.
<script runat="server">
protected override void OnLoad(EventArgs e)
        string styleInfo = "<style type=\"text/css\"> .Content {width:auto; float:none;} .Sidebar {display:none;}</style>";
        var newStyles = new LiteralControl() {Text = styleInfo };
Jan 6, 2014 at 2:20 AM
Can anyone have a look at this and offer a fix?
Thank you.
Jan 6, 2014 at 3:08 PM
I think you should be insert you script after Footer.
Jan 6, 2014 at 5:51 PM
Thanks, it still does not remove the sidebar, any other suggestions would be appreciated, I would like to use SimpleBlog.
Jan 6, 2014 at 6:23 PM
This code is trying to set element with class="Content" to full width and hide element with class="Sidebar". The SimpleBlog most likely uses different layout, so it won't work. You need to look up what used in SimpleBlog for content area and sidebar and modify code to use SimpleBlog classes or IDs.
Jan 6, 2014 at 6:51 PM
Thank you, I have tried changing with no luck, I think I will just stick with what works, the Standard theme. I referenced this without success.
 <section class="container main-section clearfix">
                <section class="content float-left">
                    <blog:SearchOnSearch ID="SearchOnSearch1" 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" />
                <aside class="sidebar float-right">
                    <blog:WidgetZone ID="WidgetZone1" runat="server" ZoneName="be_WIDGET_ZONE" />
Jan 6, 2014 at 7:25 PM
Simply changing to this works fine. Am I missing something and you trying to do something different?
string styleInfo = "<style type=\"text/css\"> .content {width:100%; float:none;} .sidebar {display:none;}</style>";
Jan 7, 2014 at 1:03 PM
Thank you that does work fine, I'm sorry I don't understand how all this works, where do I look to find out how to make it work with the new standard theme?
Jan 7, 2014 at 3:16 PM
You only need to change class name that standard uses for content and sidebar, it all works exactly same way:
.content-wrapper {width:100%;} .sidebar-wrapper {display:none;}
Jan 7, 2014 at 4:29 PM
Thank you again for your generous help.

If you get some time in the near future could you look into this?

I am trying to upgrade my SQL_CE database from 2.8 to use in 2.9.
CREATE TABLE [be_CustomFields](
[CustomType] [nvarchar](100) NOT NULL,
[ObjectId] [nvarchar](250) NOT NULL,
[BlogId] [uniqueidentifier] NOT NULL,
[Key] [nvarchar](250) NOT NULL,
[Value] ntext NOT NULL,
[Attribute] [nvarchar](250) NULL
CREATE NONCLUSTERED INDEX [idx_be_CustomType_ObjectId_BlogId_Key] ON [be_CustomFields] 
[CustomType] ASC,
[ObjectId] ASC,
[BlogId] ASC,
[Key] ASC
returns this error:
There was an error parsing the query. [ Token line number = 9,Token line offset = 1,Token in error = GO ]
Jan 7, 2014 at 6:57 PM
Did you try to execute statements one by one? Without "GO" and ";"? Sometimes older databases picky to the syntax used.
Jan 8, 2014 at 1:05 PM
Thank you, that did work great.
Jan 9, 2014 at 4:18 AM
There's actually a fix for this already committed to the source tree on Monday (V Change the create table definition in the SQL file to this:
CREATE TABLE [dbo].[be_CustomFields](
   [CustomType] [nvarchar](100) NOT NULL,
   [ObjectId] [nvarchar](250) NOT NULL,
   [CustomType] [nvarchar](25) NOT NULL,
   [ObjectId] [nvarchar](100) NOT NULL,
   [BlogId] [uniqueidentifier] NOT NULL,
   [Key] [nvarchar](250) NOT NULL,
   [Key] [nvarchar](150) NOT NULL,
   [Value] [nvarchar](max) NOT NULL,
   [Attribute] [nvarchar](250) NULL
Then run the SQL update script again.