| Author |
Get the template name form the GUID or URL
|
|
|
| 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
>
| |
|
| 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...
|
|
|
|