Making the Layouts section of the "Create Page" page easier to read
Its always frustrated me that the list box on the "Create Page" page always shows the content type first with brackets around it. I am always looking for the layout title, but when you have a number of available layouts based on a single content type it can be tricky to find the one you are after...
I thought it would be nice to have the layout title first and the content type second....
I wrote a piece of javascript which swaps the position of the content type and makes it easier (IMHO) to find the layout you are after...
<script>
var oSelection = document.getElementById("ctl00_PlaceHolderMain_layoutPickerSection_ctl01_pageTemplatePicker_ctl00_dropdownList");
if (oSelection != null)
{
for (var c=0; c<oSelection.children.length; c++)
{
var oChild = oSelection.children[c];
var sContentType = oChild.innerText.substring(0, oChild.innerText.indexOf(")")+1)
oChild.innerText = oChild.innerText.substring(oChild.innerText.indexOf(")")+2) + " " + sContentType;
}
}
</script>
To use the code you will need to paste it into CreatePage.aspx, which is found in the LAYOUTS folder. The code should be pasted just before the </asp:Content> at the bottom of the file.
I did add some code to sort the entries, but this messes it all up a bit and didn't work. I'm sure this will annoy me eventually and I'll add that, but for now this is better than it was.
This posting is provided "AS IS" with no warranties, and confers no rights.
浙公网安备 33010602011771号