Microsoft Content Management Server - Get the template name form the GUID or URL

This is Interesting: Free IT Magazines  
Home > Archive > Microsoft Content Management Server > January 2007 > Get the template name form the GUID or URL





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Get the template name form the GUID or URL
lucky

2007-01-16, 7:19 am

Hi Guys

I have a GUID and I need to find out what is the name of the template
used for the page corresponding to this GUID.

I tried variations around this but without any success:

Set thisURLObj = thisSearches.GetByGUID(myRs.Fields.Item("GUID"))
response.write thisURLObj.Template.Name


I work with CMS 2001

Any idea?

Thanks

Luc

Stefan Goßner [MSFT]

2007-01-16, 7:19 am

Hi Luc,

what is the result you get with the code below?

Cheers,
Stefan


"lucky" <lfelix@nordnet.fr> wrote in message
news:1168943406.190540.203240@q2g2000cwa.googlegroups.com...
> Hi Guys
>
> I have a GUID and I need to find out what is the name of the template
> used for the page corresponding to this GUID.
>
> I tried variations around this but without any success:
>
> Set thisURLObj = thisSearches.GetByGUID(myRs.Fields.Item("GUID"))
> response.write thisURLObj.Template.Name
>
>
> I work with CMS 2001
>
> Any idea?
>
> Thanks
>
> Luc
>



lucky

2007-01-17, 7:18 am

I get the following error message:


Microsoft VBScript runtime (0x800A01B6)
Object doesn't support this property or method: 'Template'

cheers

Luc

Stefan Goßner [MSFT]

2007-01-17, 7:18 am

Hi Lucky,

sounds as if the GUID does not identify a Posting object.
Please use the code below to verify this:

<%
Dim pSearches, pResult, strGUID
' initialize the Searches object
Set pSearches = Autosession.Searches

strGUID = myRs.Fields.Item("GUID")
Set pResult = pSearches.GetByGUID(strGUID)
If pResult Is Nothing Then
' Object does not exist or user does not have rights.
%>
<P>Object not found!</P>
<%
Else
' an object is returned, OK to use it
%>
<P>Found the <%=pResult.Name%> <%=pResult.Type%></P>
<% End If %>
Cheers,
Stefan

"lucky" <lfelix@nordnet.fr> wrote in message
news:1169022344.901925.285410@m58g2000cwm.googlegroups.com...
>I get the following error message:
>
>
> Microsoft VBScript runtime (0x800A01B6)
> Object doesn't support this property or method: 'Template'
>
> cheers
>
> Luc
>



google@australix.net

2007-01-18, 1:26 am

Fixed!

Actually some of my items were not postings but channels.
Thanks a lot for your help Stefan

cheers


Stefan Go=DFner [MSFT] wrote:[vbcol=seagreen]
> Hi Lucky,
>
> sounds as if the GUID does not identify a Posting object.
> Please use the code below to verify this:
>
> <%
> Dim pSearches, pResult, strGUID
> ' initialize the Searches object
> Set pSearches =3D Autosession.Searches
>
> strGUID =3D myRs.Fields.Item("GUID")
> Set pResult =3D pSearches.GetByGUID(strGUID)
> If pResult Is Nothing Then
> ' Object does not exist or user does not have rights.
> %>
> <P>Object not found!</P>
> <%
> Else
> ' an object is returned, OK to use it
> %>
> <P>Found the <%=3DpResult.Name%> <%=3DpResult.Type%></P>
> <% End If %>
> Cheers,
> Stefan
>
> "lucky" <lfelix@nordnet.fr> wrote in message
> news:1169022344.901925.285410@m58g2000cwm.googlegroups.com...

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com