I got this code from an SDL Tridion site related to render ASP.Net user controls on the page.
What I understand is the body tag menu, content, search results are .ascx file. But I don't understand the other controls they have used. Can anyone please explain this code snippet?
<%@ Page Language="C#" %>
<html>
<head>
<title>
<tridion:content ExpectXmlContent="true" XPath="//tcm:Content/tridion:Content/tridion:title" runat="server"/>
</title>
<tridion:content templateuri="tcm:47-3016-32" runat="server"/>
<tridion:track runat="server" xpath="//tcm:Metadata/tridion:Metadata/tridion:category" pageuri="tcm:47-2966-64" />
<tridion:secure issecured="false" redirecturl="~/login/login.aspx" runat='server'/>
</head>
<body>
<tridion:menu menutype="topnav" runat="server"/>
<tridion:content templateuri="tcm:47-3052-32" runat="server"/>
<tridion:searchresults Category="Categories" templateuri="tcm:47-3058-32" runat="server"/>
</body>
</html>
These are indeed ASP.NET User Controls as you already concluded. But as far as I know these controls are not part of a standard Tridion installation. So that means they were probably created specifically for your web site by the original implementer. I suggest reaching out to that implementer for documentation and the source code.
That said, from simply glancing over the fragment it looks like:
tridion:content
looks up the Page title from the Page XMLtridion:content
renders all Component Presentations on the Page that use the specified Component Templatetridion:track
calls Tridion's personalization-and-profiling module to track a visit to this Pagetridion:secure
uses Tridion Professional Service's Secure Content Delivery module to ensure only properly authorized users have access to this Pagetridion:menu
renders a menu, seemingly unrelated to any item in Tridiontridion:content
control renders more Component Presentations, this time the ones with another Component Templatetridion:searchresults
does a query to the Tridion Broker to show a list of related Component PresentationsCheck the projects web.config file, there should be a <controls>
tag where there'll be a reference to an assembly that's using the "tridion" tag prefix.
You can then use something like ILSpy to decompile the assembly and get a clearer idea of what's going on.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With