Umbraco SQl to Find Nodes using a Certain Document Type

SELECT * FROM cmsContent C
INNER JOIN cmsContentType CT ON C.contentType = CT.nodeId
INNER JOIN umbracoNode N ON C.nodeId = N.id
WHERE CT.alias = ‘yourDocumentTypeAliasHere’

–use the node path to locate nodes in Umbraco

Advertisements

Umbraco SQL to find documents using specific dataType


DECLARE @dataTypeSearch NVARCHAR(50)
SET @dataTypeSearch = '%Media Picker Adv%'

-- 1. Find thge data type you're after
SELECT * FROM cmsDataType
INNER JOIN umbracoNode N on N.id = cmsDataType.nodeId
WHERE N.[text] LIKE @dataTypeSearch

--1.b Pick your nodeId from above query
DECLARE @dataTypeId INT
SET @dataTypeId = 6877

-- 2. Find the properties using the dataType:
SELECT * FROM cmsPropertyType WHERE dataTypeId = @dataTypeId -- NodeId from above

--3. Find nodes with a proerty of that type(s):
SELECT DISTINCT N.* FROM UmbracoNode N INNER JOIN
cmsPropertyData PD ON PD.contentNodeId = N.id
WHERE
propertytypeid IN (SELECT DISTINCT id FROM cmsPropertyType WHERE dataTypeId = @dataTypeId) --Id's returned from second query above
AND dataInt IS NOT NULL --NULL CHECK Corresponding dbType from initial query above

--3. To locate in Umbraco select all nodes in the path:
--SELECT * FROm umbracoNode WHERE id in (-1,5205,6454,1086,4573,4454,4455,28104) ORDER BY LEN(path) -- To find a node paste in path

--4. Find Document Types using the propertyType (note the subquery in where clause is copied from item 3 above):
SELECT DISTINCT T.alias FROM cmsContent C
INNER JOIN cmsContentType T ON C.contentType = T.nodeId
WHERE C.nodeId IN (
SELECT DISTINCT N.Id FROM UmbracoNode N INNER JOIN
cmsPropertyData PD ON PD.contentNodeId = N.id
WHERE
propertytypeid IN (SELECT DISTINCT id FROM cmsPropertyType WHERE dataTypeId = @dataTypeId) --Id's returned from second query above
AND dataInt IS NOT NULL --NULL CHECK Corresponding dbType from initial query above
)

Multiple SSL sites using host headers in IIS 6

Use 443 for all, but use host file configured headers to distinguish (your host file lives at c:\windows\system32\drivers\etc\host)

To setup run this from your command prompt (if fails try the Visual Studio command prompt).

cscript.exe adsutil.vbs set /w3svc/1/SecureBindings ":443:siteonedomain.localhost.com"
cscript.exe adsutil.vbs set /w3svc/726940114/SecureBindings ":443:anotherdomain.localhost.com"

In the above the id listed between “w3svc” and “SecureBindings” (i.e. 1 and 726940114) is the ID of the website in IIS. You can see this in the IIS admin console when you view all sites – or you can use the below script to print all in the command prompt:

To list all bindings (save as .vbs file):

strComputer = "."
 
Set objWMIService = GetObject _
    ("winmgmts:{authenticationLevel=pktPrivacy}\\" _
        & strComputer & "\root\microsoftiisv2")
 
Set colItems = objWMIService.ExecQuery _
    ("Select * from IIsWebServerSetting")
 
For Each objItem in colItems
    For i = 0 to Ubound(objItem.SecureBindings)
        Wscript.Echo "Port: " & _
            objItem.SecureBindings(i).Port
    Next
Next

See http://www.sslshopper.com/article-how-to-configure-ssl-host-headers-in-iis-6.html for details and explanation.

Loading Custom youTube player Using jQuery

Did this in ASP.NET – should roll into a user control, and load the jScript using the Client Dependency Framework – but code is as follows (jQuery from here):


	<div id="youtube-player"></div>
	$('#youtube-player').youTubeEmbed({
		video: 'http://www.youtube.com/watch?v=TUoOcDGMgT4'
		, width: 226 		// Height is calculated automatically
		, progressBar: false	// Hide the progress bar
		, autoplay: 1
	});
	

Some useful Umbraco Examine Links

http://our.umbraco.org/forum/developers/extending-umbraco/11667-GatheringNodeData-examine-event?p=1
http://examine.codeplex.com/wikipage?title=UmbracoExamine
http://examine.codeplex.com/wikipage?title=Full%20Configuration%20Markup%20%26%20Options&referringTitle=UmbracoExamine

Use Lucene Luke for Windows to examine what’s actually been indexed: http://www.getopt.org/luke/

Installing 3rd Party Libraries with NuGet

This is a very useful little tool: http://nuget.codeplex.com/

Formatting Code Examples in WordPress

Had a mare getting WordPress to display code samples in a consistent way – the handling seems to vary between different themes as well.
Paying $15 for the custom CSS seems a bit much for something as basic as this
Found the below after some experimentation, seems to work in all themes so far:

    <pre>
        <code> 
            //code here (pasted in tabs are preserved)
            //And the text does not wrap - see:....................................................................................................................................................
        </code>
    </pre>