CSS: inline-block for IE7

I was developing a DemoSite and have problem with IE7 (actually we’re only target IE8, but one of our module must run in IE8 emulate IE7 mode so a meta tag <meta http-equiv=”X-UA-Compatible” content=”IE=EmulateIE7″ /> is put in the header). While Firefox is my primary browser and it’s OK with display: inline-block CSS style, BUT IE7 (and IE8EmulateIE7) does not render it.

So this is the hack for IE7 (from http://grasshopperpebbles.com/css/css-inline-block-ie7-hack/):

HTML

<div class="predefinedList">
<div class="predefinedListItem">Cross country skiing</div>
<div class="predefinedListItem">Fine cuisine</div>
<div class="predefinedListItem">Spa</div>
</div>

Put your style settings to the top,
put display: inline-block;zoom:1;*display:inline; to the bottom.

CSS

.predefinedList .predefinedListItem {    padding:0;    /* other the styles should be here */
    display:inline-block;   /* for firefox */
    zoom: 1;    /* for IE7 hack */
    *display:inline;   /* for IE7 hack */
}
Advertisements

Get siteId of EPiServer site in code

From EPiServer 7.1 and below, read at


EPiServer.Framework.Initialization.SiteMappingConfiguration.Instance.SiteId
(this is a string)

reference your project to EPiServer.Framework.dll

From EPiServer 7.5, you should use

EPiServer.Web.SiteDefinition.CurrentOrDefault.Id (Guid type)

reference your project to EPiServer.dll

EPiServer tuyển người – Hà Nội

EPiServer is the world’s fastest growing provider of Web Content Management (WCM) and online social community platforms. Over 3000 customers worldwide use EPiServer CMS to create collaborative, engaging and attractive websites. The platform EPiServer CMS is the foundation of more than 9000 websites and is used on a daily basis by over 130,000 web editors. It enables true web engagement which allows customers to turn passive web visits into dynamic, personalized web experiences that drive new revenues. EPiServer delivers its WCM platform through a network of more than 340 competent partner companies in 25 countries.

Founded in 1994, the company has offices in the USA, Sweden Denmark, Norway, Finland, the Netherlands, Australia, South Africa and the UK.

http://www.episerver.com

Attached to this mail you will find five different profiles,

  • Profile Software Test Automation Engineer
  • Profile Software Tester
  • Profile Web Designer, User Interaction Designer
  • Profile Web User Interface Developer
  • Profile Product Support Developer

As the Development Manager coming to Hanoi on the January the 22 it is important for candidates to apply ASAP.

Send your CV to pelle[dot]niklasson[at]episerver.com

Quick sample: EPiServer Change access level of Page

Introduction

Bitwise operators give you the ability to store multiple settings in a single primitive data type (e.g. an integer). This is useful when a single item has potentially more than one setting of the same type.

EPiServer AccessLevel is enum, and if you want to set or remove a AccessLevel, we need to use bitwise operators:

Defining the Flags

To start of with, declare an enum to list all the possible flags. Two things are important when declaring the enum. The first thing you will probably notice is the [Flags] attribute. This is necessary in order to indicate that the enumeration should be treated as a set of flags. The second important thing is assigning a value to each of the items in the enum. The first value should be 1, then just double the value for each consecutive item. The integer type in .NET can store up to 32 flags.

EPiServer.Security
{
 // Summary:
 //     The access levels (bitmapped) that are used to control the various actions
 //     that a user is allowed to perform.
 //
 // Remarks:
 //     Primarily used to control access to page manipulation functions in EPiServer,
 //     but can be used for general-purpose access restriction functions.
 [Serializable]
 [Flags]
 public enum AccessLevel

Setting flags ON:

To set multiple flags, concatenate the desired flags using the bitwise OR symbol “|”:

pageACL.Access |= AccessLevel.Delete;

Setting flags OFF:

pageACL.Access &= ~AccessLevel.Delete;

Testing to see if a certain flag is set:

if ((pageACL.Access&AccessLevel.Delete)==AccessLevel.Delete)


Some sample code

  • Get a PageData by PageLink
  • get ACL list
  • Loop though ACL
  • Remove Delete access right, so no one can delete this page
PageData data = DataFactory.Instance.GetPage(e.PageLink);

 // this page also cannot delete, ignore processing
 if (data.QueryDistinctAccess(AccessLevel.Delete) == false)
 {
     return;
 }

 // modify this page accessright, do not allow to delete
 AccessControlList list = data.ACL.CreateWritableClone();
 foreach (KeyValuePair<string, AccessControlEntry> pair in data.ACL)
 {
 if ((pair.Value.Access & AccessLevel.FullAccess) == AccessLevel.FullAccess)
 {
 list.Remove(pair.Key);
 list.Add(new AccessControlEntry(pair.Value.Name, pair.Value.Access & ~AccessLevel.FullAccess, pair.Value.EntityType));
 }

 if ((pair.Value.Access & AccessLevel.Delete) == AccessLevel.Delete)
 {
 list.Remove(pair.Key);
 list.Add(new AccessControlEntry(pair.Value.Name, pair.Value.Access & ~AccessLevel.Delete, pair.Value.EntityType));
 }
 }
 list.Save(SecuritySaveType.Modify);