Wednesday, June 24, 2009
Custom Document Library Item check-in throws error
I got the miserable "Value does not fall within the expected range" error after checking in an item in my newly created custom document library with a custom content type.
Since the cause of the error "Didn't fall within my knowledge range" I had to google ... and *bing!* found what I was looking for.
Lesson learned: Do not set the "required" attribute to true in your content type definition.
Geplaatst door
komakino
op
12:52 PM
0
reacties
Wednesday, May 27, 2009
Accessibility: Empty text alternatives for ASP.NET image control
While building an accessible website you need to take into account that the following elements must have an ALT attribute:
- img
- area
- input with type="image"
The ALT attribute is designed to be an alternative text description for images.
What are the benefits?
- Enhance the browsing experience of visitors with disabilities.
- If somehow the image is not able to load, then a visitor will see the description of ALT attribute. This will also help when someone is using text based browsers like Lynx.
- By having ALT attribute you are increasing the keyword density which is very good in terms of
Search Engine Optimalisation (SEO).
The alt attribute for decorative images should be empty [alt=""] to meet the accessibility and XHML standards. If you include an empty alt attribute, screen readers will skip over the image. If you don't... the screenreader will read the entire URL of the image, which is quite annoying for the visitor.
What about the ASP.NET image control?
By default, when the AlternateText property is not set, the Image control does not include the alt attribute to specify the alternate text in the control rendering. If you set this attribute to be empty [AlternateText=""] you will notice that the control ignores it too.
Fortunately, since .NET 2.0, the image control contains a GenerateEmptyAlternateText property. It specifies whether or not the control creates an empty string as an alternate text. Set the GenerateEmptyAlternateText property to true to always include the alternate text attribute in rendered output for the Image control.
Geplaatst door
komakino
op
9:08 AM
1 reacties
Thursday, May 7, 2009
Off-topic: Have you ever been to New York?
Take a look at that wonderful Aerial Virtual tour.
- Turn on your speakers
- Left below you'll find more views
- Don't forget to enter the fullscreen
Geplaatst door
komakino
op
12:42 PM
0
reacties
Wednesday, April 22, 2009
HtmlDecode RSS Feed
I had to HTMLDecode the output of the ListFeed.aspx (OOTB RSS viewer within SharePoint). After digging into the SharePoint DLL's with Reflector I overwrote the render function. To make sure this change wasn't effective for the whole environment, I made a copy of ListFeed.aspx and made a custom action (as a replacement of the OOTB 'View RSS' action) to refer to the copied file.
Geplaatst door
komakino
op
10:34 AM
0
reacties
Tuesday, April 7, 2009
Whitespace character in XSL
I noticed that wasn't working in my XSL file, used   instead and it worked like a charm.
Geplaatst door
komakino
op
3:02 AM
0
reacties
Tuesday, March 31, 2009
How To: Change Styles Within RadEditor Field Control
I'm currently using the free RadEditor Lite. It's a cross-browser alternative to the default rich-text editor in MOSS and WSS v3. For those who don't know this HTML editor, take a look at Telerik. It's a well made alternative with some pros and cons. In this post I'll highlight one of it's cons: Styling within the RadEditor can be hard. I'm not talking about styling the skin - but especially about the font, background, etc.
I thought this was an easy task by just changing some CSS classes et voila...Not! My aim was to change the styling from within my own stylesheets. The difficulty was due to fact that the RadEditor is rendered in an IFrame.
- My first attempt: override styles - with no result.
- My second attempt: access the IFrame and add a class on it with DOM manipulation - with no result
- Last but no least, my third attempt: access the IFrame, add a class on it and add an extra CSS Link reference in the head tag - with result.
- Modify the ConfigFile.xml
- Write some javascript to access and manipulate the IFrame
- Create a CSS Class / File
Add an extra line: [property name="OnClientLoad"]OnClientLoad[/property]
This will tell the RadEditor to execute the OnClientLoad javascript function while loading the control.
2. Place the javascript function somewhere in a file - masterpage for instance:
(I referenced my stylesheet with document.styleSheet[x].href and added a CSS reference in my masterpage with $SPUrl: ~SiteCollection to get a relative path to the CSS file.)3. Create a new CSS Class, named 'redEditBody', in your referenced CSS file. Now you're able to modify his styling.
Geplaatst door
komakino
op
1:23 PM
0
reacties