Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What do these ASP.Net user controls (.ascx) in a Tridion Page do?

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>
like image 435
AmateurCoder Avatar asked Dec 05 '22 16:12

AmateurCoder


2 Answers

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:

  • the first tridion:content looks up the Page title from the Page XML
  • the second tridion:content renders all Component Presentations on the Page that use the specified Component Template
  • the tridion:track calls Tridion's personalization-and-profiling module to track a visit to this Page
  • the tridion:secure uses Tridion Professional Service's Secure Content Delivery module to ensure only properly authorized users have access to this Page
  • then tridion:menu renders a menu, seemingly unrelated to any item in Tridion
  • then another tridion:content control renders more Component Presentations, this time the ones with another Component Template
  • lastly the tridion:searchresults does a query to the Tridion Broker to show a list of related Component Presentations
like image 161
Frank van Puffelen Avatar answered Mar 15 '23 12:03

Frank van Puffelen


Check 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.

like image 43
Neil Avatar answered Mar 15 '23 11:03

Neil