Today I attended #SPSChicagoBurbs and the session by Wes Preston (@idubbs) on Client Side Rendering. A question was asked by someone in the audience if Quick Edit (new Data Sheet) would support CSR rendering. The consensus was probably not because of the advanced rendering, event handlers, and cell editing.
I gave it a quick test and surprisingly it worked!
When I renamed a file to become “test.txt” it turns the background green, text white, and even shows a custom icon <IMG> tag. This could be leveraged to give end users real-time feedback on the values entered. Unlike a JQuery page load event which only triggers once, this triggers per row as values are changed.
Video
Screenshot
Code
//override
(function () {
var overrideCtx = {};
overrideCtx.Templates = {};
overrideCtx.Templates.Fields = {
'LinkFilename': { 'View': ConditionalStatus }
};
SPClientTemplates.TemplateManager.RegisterTemplateOverrides(overrideCtx);
})();
function ConditionalStatus(ctx) {
var ret;
console.log(ctx.CurrentItem.FileLeafRef);
if (ctx.CurrentItem.FileLeafRef== "test.txt") {
ret = "
Want to use Design View on a 2013 site? Well, now you can.
With a Fiddler HTTP function we can adjust the server response to say “14” instead of “15” and open any SharePoint 2013 site with SharePoint Designer 2010 to have access to classic Design View. Obviously there are downsides to this approach (not formally supported), but it also can be useful in many scenarios. Check it out and please leave a comment if you find this helpful.
Copy the below code and add to your local CustomRules.JS file in the function OnBeforeResponse(oSession: Session).
// START BLOG POST from @spjeff
// https://www.spjeff.com/2014/05/08/get-design-view-back-on-sharepoint-2013-woohoo
//INF
if (oSession.oRequest["User-Agent"] == "Mozilla/4.0 (compatible; MS FrontPage 14.0)" &&
oSession.PathAndQuery == "/_vti_inf.html") {
// Remove any compression or chunking
oSession.utilDecodeResponse();
if (oSession.responseBodyBytes) {
var oBody = System.Text.Encoding.UTF8.GetString(oSession.responseBodyBytes);
// Replace strings
oBody = oBody.replace("FPVersion=\"15.00.0.000\"", "FPVersion=\"14.00.0.000\"");
oSession.utilSetResponseBody(oBody);
}
}
//RPC
if (oSession.oRequest["User-Agent"] == "MSFrontPage/14.0" &&
oSession.PathAndQuery == "/_vti_bin/shtml.dll/_vti_rpc") {
// Remove any compression or chunking
oSession.utilDecodeResponse();
if (oSession.responseBodyBytes) {
var oBody = System.Text.Encoding.UTF8.GetString(oSession.responseBodyBytes);
// Replace strings
oBody = oBody.replace("major ver=15", "major ver=14");
oSession.utilSetResponseBody(oBody);
}
}
//AUTHOR
var suffix = "/_vti_bin/_vti_aut/author.dll";
if (oSession.oRequest["User-Agent"] == "MSFrontPage/14.0" &&
oSession.PathAndQuery.indexOf(suffix, oSession.PathAndQuery.length - suffix.length) !== -1) {
if (oSession.responseBodyBytes) {
// Remove any compression or chunking
oSession.utilDecodeResponse();
var oBody = System.Text.Encoding.UTF8.GetString(oSession.responseBodyBytes);
// Replace strings
oBody = oBody.replace("
SR|15.0", "
SR|14.0");
oSession.utilSetResponseBody(oBody);
}
}
// END BLOG POST
Use Cases
Support upgraded 2010 sites. If you developed with SP Designer 2010, you might need Design View to support sites after upgrade to 2013.
New HTML and CSS creation. WYSIWYG can be great for making simple files to support new JavaScript development.
DataFormWebPart . Create blank ASPX page, add the DataFormWebPart and Conditional Formatting with WYSIWYG, then copy finished <DataFormWebPart> code tag into a 2013 native ASPX page.
Notes
Non intrusive approach. Fiddler runs local on the developer’s machine. No server changes or changes for end users.
This doesn’t give you Design View of any native 2013 ASPX page. Those are fundamentally different with new Minimal Download Strategy async load, new master page, and other stuff so it just shows a gray background.
Yesterday I published a new CodePlex project to automate PowerShell remoting. Basically I got tired of RDP-ing to 10 machines to type the same command 10 times. Why not use a local PowerShell window to read CSV with server names and execute remotely in bulk? Well, now you can.
Give it a try for an hour to download, setup, and run. You can save that much time in just a day by using this in instead of juggling RDP and typing multiple PowerShell commands. Please leave a comment or CodePlex review to let me know what you think.
Today I found http://hackertarget.com/wordpress-security-scan/ and ran a scan of this website. Nothing major was discovered, but a few improvements to harden and make the system more secure. If you have WordPress you might want to run this also. Great way to get simple suggestions for tighter security: