theme.skin / event calendar issue

A place for discussion about skinning and design. Before posting questions here you should review the documentation about creating skins.

This thread is closed to new posts. You must sign in to post in the forums.
9/15/2008 9:03:09 PM
Gravatar
Total Posts 29

theme.skin / event calendar issue

I am attempting to make some modifications to an instance of the standard event calendar. I found the control entry in themes.skin but any change I make there does not implelement. I don't want to do much, just change a few items like "NextMonthText" and ShowGridlines" etc. I am attempting this in the themes.skin file that's in the same folder as my skin.  I even went through and changed all the css names just to see if the changes would persist. What am I missing?

 

Thanks

Greg P

9/16/2008 7:50:59 AM
Gravatar
Total Posts 18439

Re: theme.skin / event calendar issue

Hi Greg,

If you want to style the calendar, you should look at the mpdatacalendar.css file in your skin folder.

I don't use themes because themes produce inline styles which bulks up the markup making page loads take longer. Its much better to do it all in css.

Hope it helps,

Joe

9/16/2008 10:00:07 AM
Gravatar
Total Posts 29

Re: theme.skin / event calendar issue

 

Most all of the design I intend is done in the css. I am having trouble getting lines on the day squares to show up in IE. I looked at 2-3 of the themes on your demo setup and while FF shows the lines, none did in IE. When I saw the parameter in the skin file I thought that would take care of it.

Also, the calendar is getting some inline styles from somewhere. Using Firebug, I see:

NOTE: Inline style here:

element.style {
border-bottom-width:0;
border-left-width-ltr-source:physical;
border-left-width-rtl-source:physical;
border-left-width-value:0;
border-right-width-ltr-source:physical;
border-right-width-rtl-source:physical;
border-right-width-value:0;
border-top-width:0;
width:14%;
}

 

/*mpdatacalendar.css (line 161)  */
.mpcalendartoday {
background-color:#FFFFE0;
border:1px solid black;
color:Black;
font-size:8pt;
text-align:center;
}

...

But since inline styles have the last say-so, I can't seem to override the border parameters.

And beyond that, I was interested in modifying the DayNameFormat, NextMonthText, etc.

Is there a way I can get to the specific instance of the control without using themes.skin?

What do you suggest?

Thanks

Greg P

 

9/16/2008 10:23:25 AM
Gravatar
Total Posts 18439

Re: theme.skin / event calendar issue

If you don't mind the verbose inline styles you may be able to get the gridlines and other settings working as you would like by using theme.skin

I have the theme disabled in Event Calendar but you can enable it by opening the /Modules/EventCalendar.ascx file with a text editor and remove this part: EnableTheming="false"

Then put a setting like this in your user.config:

<add key="EnableThemeInEventCalendar" value="true" />

the above setting has no effect in the current release but I am adding code for it now so by putting it in your user.config file you will be set for the next release (coming later this week). The setting will be false by default, so if you want it true you should make this setting.

Hope it helps,

Joe

 

9/16/2008 1:28:30 PM
Gravatar
Total Posts 29

Re: theme.skin / event calendar issue

Thanks. I'll do it....

 

Greg

9/17/2008 12:19:39 AM
Gravatar
Total Posts 29

Re: theme.skin / event calendar issue

Joe:

I got the latest build and made changes you wrote about. Here's an error I get when I try to bring up the page that the calendar is on.:

Server Error in '/' Application.
The 'EnableTheming' property can only be set in or before the Page_PreInit event for static controls. For dynamic controls, set the property before adding it to the Controls collection.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: The 'EnableTheming' property can only be set in or before the Page_PreInit event for static controls. For dynamic controls, set the property before adding it to the Controls collection.

Source Error:

Line 201: Settings, "CalendarUseFillerOnEmptyDays", true);
Line 202:
Line 203: cal1.EnableTheming = ConfigHelper.GetBoolProperty("EnableThemeInEventCalendar", false);
Line 204:
Line 205: }


Source File: C:\Projects\MojoPortal\Web\Modules\EventCalendar.ascx.cs Line: 203

What do you think?

Thanks

Greg

9/17/2008 6:07:40 AM
Gravatar
Total Posts 18439

Re: theme.skin / event calendar issue

Oops, my bad. If you do svn update and rebuild, this is fixed.

Best,

Joe

9/17/2008 9:52:37 PM
Gravatar
Total Posts 29

Re: theme.skin / event calendar issue

Thanks. I also removed the SkinID parameter from the control and then it worked. You should consider removing the following lines from the control parameters as they appear to override any border settings a user might set in the CSS and they can always add them to the skin file if needed.


NextPrevStyle-BorderStyle="None"
NextPrevStyle-BorderWidth="0px"
DayHeaderStyle-BorderStyle="None"
DayHeaderStyle-BorderWidth="0px"
OtherMonthDayStyle-BorderWidth="0px"
DayStyle-BorderWidth="0px"
SelectorStyle-BorderWidth="0px"
SelectorStyle-BorderStyle="None"
TitleStyle-BorderWidth="0px"
TitleStyle-BorderStyle="None"
BorderStyle="None"
BorderWidth="0px"

Don't mean to be a pain with this. I appreciate your help.

 

Greg

9/18/2008 8:01:07 AM
Gravatar
Total Posts 18439

Re: theme.skin / event calendar issue

I spent several hours this morning trying various things and the only way I could get it to not render those border width settings in line was to set EnableTheming="false"

The config setting doesn't really work there, when I had EnableTheming='<%# ConfigHelper.GetBoolProperty("EnableThemeInEventCalendar", false) %>' it always seemed to be resolving to true because the border width is always there in line style but setting it to false explicity removes it.

What I finally arrived at is this:

<mp:DataCalendar id="cal1" runat="server"
EnableTheming='false'
UseAccessibleHeader="true"
SelectionMode="Day"
DayField="EventDate"
CssClass="mpcalendarmain"
DayHeaderStyle-CssClass="mpcalendardayheader"
DayStyle-CssClass="mpcalendarday"
NextPrevStyle-CssClass="mpcalendarnextprevious"
OtherMonthDayStyle-CssClass="mpcalendarothermonth"
SelectedDayStyle-CssClass="mpcalendarselectedday"
SelectorStyle-CssClass="mpcalendarselector"
TitleStyle-CssClass="mpcalendartitle"
TodayDayStyle-CssClass="mpcalendartoday"
WeekendDayStyle-CssClass="mpcalendarweekendday"
NextPrevStyle-BorderStyle="None"
NextPrevStyle-BorderWidth="0px"
DayHeaderStyle-BorderStyle="None"
DayHeaderStyle-BorderWidth="0px"
ShowGridLines="true"
>

Note that I did remove BorderStyle and BorderWidth but had to leave some of the other settings because otherwise there are unintended cosmetic side effects that can only be fixed by enabling theme again and this would put the inline borders back. So this is the best compromise I could come up with.

Best,

Joe

9/18/2008 7:53:58 PM
Gravatar
Total Posts 29

Re: theme.skin / event calendar issue

I had good luck with enabling themeing and starting with a blank mpcal css file - and then building it up. The only in line style that stayed was "color = black" and it only affected hyperlinks. Go figure. But it's not that big a deal. I didnt mean to take up so much time with this. I can easily modify the source to fit my needs. Thanks for your help.

Also - I dont mean to be a numbnut, but I cant find where you added the excerpt settings for the blog. I see them in the source, but all the admin property pages I look at don't seem to have the settings. Am I overlooking something?

 

Thanks

Greg P

9/19/2008 8:49:36 AM
Gravatar
Total Posts 18439

Re: theme.skin / event calendar issue

If you visit the /Setup/Default.aspx page it will install the new setting into the database based on the feature definition file where I added the new setting:

/Setup/applications/mojoportal-core/FeatureDefinitions/20000_BlogModule.config

Best,

Joe

You must sign in to post in the forums. This thread is closed to new posts.