Skip to content

Instantly share code, notes, and snippets.

@aackose
aackose / wffmwizard.js
Last active March 25, 2018 22:12
Converts a WFFM Form Sections to a Wizard Form
// Insert an HTML based "Previous" and "Next" button right next to the "Submit" button
// Hide the "Previous" button on the initial load
// Add "submit" class to the existing "Submit" button for ease of targeting
$("<input type='submit' value='Previous' class='prev' onclick='return false;' style='display:none'/><input type='submit' value='Next' class='next' onclick='return false;'/>").insertBefore($(".scfForm input[type='submit']").addClass('submit').hide());
// Capture all the <fieldsets> a.k.a Sections in the WFFM Form
// Note that the Form has a class "scfForm", which is the OOTB class name
// If you have multiple WFFM Forms on the page, you will have to scope this to the current Form
var fieldSets = $(".scfForm fieldset");
var current = 0;
@aackose
aackose / SelectCheckboxes.js
Created February 11, 2018 16:27
Select fixed number of checkboxes in the TranslatePlus Admin page
var fileref = document.createElement('script');
var filepath = "//code.jquery.com/jquery-3.2.1.min.js";
// Checking the top 25 checkboxes
fileref.onload = function(){jQuery(".QueueTable.sortable tr td input[type='checkbox']:lt(25)").attr("checked","checked")};
fileref.setAttribute("type","text/javascript");
fileref.setAttribute("src", filepath);
// Insert the above script in the <head> tag
document.getElementsByTagName("head")[0].appendChild(fileref);
@aackose
aackose / BulkUpdateAsyncTranslation.ps1
Created February 11, 2018 16:23
Bulk Update Async Translation Field through Sitecore PowerShell
New-UsingBlock (New-Object Sitecore.Data.BulkUpdateContext) {
foreach($item in Get-ChildItem -Path master:"\system\Modules\TranslatePlus\Queues\Translation Queue") {
$item.Editing.BeginEdit()
$item["Async translation"] = "0"
$item.Editing.EndEdit() | Out-Null
}
}
@aackose
aackose / BulkUpdate.ps1
Created February 11, 2018 16:16
Update items in Bulk through PowerShell
New-UsingBlock (New-Object Sitecore.Data.BulkUpdateContext) {
foreach($item in Get-ChildItem -Path master:\content\MyWebsite\Folder01 -Recurse) {
$item.Editing.BeginEdit()
$item.Roles = "{C731475E-D7BF-4BE1-A323-9C059ED2DE49}|{CC6FEF3F-8C13-4EC7-8E5A-9F0E56769FED}"
$item["__Workflow state"] = "{4785314C-2C4A-4784-955B-D638CB42E994}"
$item.Editing.EndEdit() | Out-Null
}
}