Issue in Dynamic Menus in Tridion 2011 - tridion

We have an application which has menus generated dynamically through the publishing of a dynamic component presentation.A menu.xml is written out by a component template based on the Structure groups and this component template is triggered through event system to be published whenever a structure group is published.
This setup was working fine until the upgrade of Tridion 2011 from Tridion 2009. But ever since the upgrade, the menus are not dynamically published and are requiring a re-publish of the menu component template every time there is a change in the structure group. We checked the event system and everything is fine there. Moreover, this republish of menu component template triggers problems in some other page menus.
On doing some debugging (we made the component template write out the pageURI it is working on at any instant), we find that the page URI that is being written out is wrong.
Below are the steps taken and conclusions arrived:
All erring pages have been checked; the DCP tag has correct attributes set in the JSP code
Additional TRACE statements were added to the Tridion tag library, this confirmed the following:
The XSLT was correctly retrieved from the filesystem
The cached menu was retrieved correctly from the cache
The XSLT was correctly transformed with the variables provided
By writing out the XSLT attributes to the HTML we see that the XSLT processor is being provided wrong parameters.
So can I safely conclude that the issue has been isolated to the following event; the XSL processor is being called with an incorrect page id. Most likely cause is due to concurrency issues in the dynamic component presentation (DCP) java code where the DCP gets swarmed and starts confusing which page is using the current object.
And if this is the case, what can be done to rectify it.
Any information would help. Thanks in Advance!
Regards,
Keirthana T S
Update on 22-Jan-2013:
On more debugging, we find this issue to be recurring on the Presentation side(our presentation server) and the event system has nothing to do with the wrong menus appearing on the page.
That is, when we view a jsp page published from Tridion, we have the correct page URI for the top menu, left menu and breadcrumbs that we have:
<tridion:ComponentPresentation pageURI="tcm:57-186286-64" componentURI="tcm:57-103196" templateURI="tcm:57-23654-32"/><!-- privat-->
<div id="nav"><div class="wrapper">
<tridion:ComponentPresentation pageURI="tcm:57-186286-64" componentURI="tcm:57-23638" templateURI="tcm:57-23656-32" />
</div></div>
<div id="page" class="clear ">
<div id="content" class="clear">
<tridion:ComponentPresentation pageURI="tcm:57-186286-64" componentURI="tcm:57-23639" templateURI="tcm:57-23656-32" />
<div id="middle" class="rightcolumn">
<tridion:ComponentPresentation pageURI="tcm:57-186286-64" componentURI="tcm:57-23636" templateURI="tcm:57-23656-32" />
However, when we view the source of the web page, we find that the page URIs(we wrote out the page URI to html page) are messed up as below:
For
<div id="middle" class="rightcolumn">
which generates the breadcrumb we get a different pageURI instead of the correct one.

Some publish-related legacy (VB) events do not work out of the box with Tridion 2011. There is a legacy event adapter available here: http://sdltridionworld.com/community/2011_extensions/LegacyEventAdapter.aspx.

Related

inject a view in another view that has been already loaded in asp.net mvc 6?

someone need help here :( !!
I have a bloc of authantification html code and a btn for login and another for register. These two buttons are in all pages but I don't want my authantification code to be loaded in every pages (Render***() in _Layout.cshtml). I want to inject this bloc code in the page on login or register btn clicked.
exp: client want to register after visited pageTwo (the authantification html code is not loaded yet), and then he press the register btn => at this time the authantification html code is loaded (injected) without loading the entire pageTwo.
My authantification html is a modal, just to give you an idea:
<div class="modal" style="z-index:10000"> ... </div>
My queation: how can I inject a view(html) in the view that has been already loaded by pressing on a button ?
Thanks for helping if it's not clear let me know, and sorry for the bad english :(
UPDATE
Is it possible without server side manipulation ?
If you don't want server-side code, you need client-side code.
When button is clicked, use javascript to load html (with markup of login form only) from server, insert it into your current page (into model dialog for example) and then show that form/dialog.
jQuery will help you with html manipulation and when communicating with server, later you can switch to vanilla.js for less javascript libs in dependencies.

Angular is not recognized inside my user control

I am using Angular inside my .NET app in VS2015. Everything works fine when inside my main page, I am also using various panels to display my data. So lets say that I have a controller named MainCtrl and is declared as such inside my Homepage.aspx
<div class="panel panel-default" data-ng-app="APP">
<div class="panel-body" data-ng-controller="MainController">
<asp:Panel ID="PanelTest" runat="server"></asp:Panel>
</div>
</div>
this controller has a variable named testmessage="Hello" and if I have {{testmessage}} inside my panels code then it displays, as it should, Hello. If I dont declare my controller in Homepage.aspx though, and instead declare it inside my user control just above the place where {{testmessage}} is located then it's as if angular is not recognized anymore and what I see in my rendered page is {{testmessage}} and not Hello.
Why is this, should I follow some other steps for declaring my various angular controllers inside a user control .ascx and ascx.cs?
After investigating a little bit it became clear that this is because all Javascript files that I include in my controller are loaded just above that controller, but angular and my APP declaration is done at the bottom of my body element.
Is there anything else I could do except from moving all my JavaScript declarations to my header?

Tridion ASCX DCP does not render child control

When publishing dynamic component presentations using SDL Tridion 2011 SP1, I mostly use REL as the output format, however I now want to publish a DCP that contains an ASP.NET control tag. I therefore changed the output format of the template to ASCX, and configured the storage for ASCX component presentations to go to the file system within my web application. I can see the ascx files on disk, and as expected, I can see the control tag inside.
If I create an aspx page that contains the same control tag, the output is as I expect, however, when the ASCX component presentation is executed by the component presentation assembler, instead of rendering the output from the control tag, it comes up blank. Plain text within the DCP does show up.
The functionality I need is very similar to a Tridion Dynamic Component link control, and I had already tried one of these with this architecture, and succeeded. I've even gone as far as putting both my tag and the tridion one, one after the other, in the template. In this case I see the output from the tridion tag, but not from my own, even though the references are wired up in the same web.config.
So I can see that it is possible to have Tridion's component presentation assembler execute an ASCX DCP and successfully render its child controls. Are there perhaps requirements when authoring such a control to ensure that it can be rendered in this way?
UPDATE:
The DCP is published to an ascx file within my site. For test purposes, I am now publishing the tridion control in the same DCP, so the output on disk looks like this:
<tridion:DynamicComponentLink PageURI="tcm:34-667-64" ComponentURI="tcm:34-876"
TemplateURI="tcm:34-864-32" LinkText="Some page" runat="server" />
<xxx:ComponentLinkQS runat="server" ComponentUri="tcm:34-945"
QueryString="item=876" Text="Some page" />
When the DCP is published like this, and executed by the ComponentPresentationAssembler the first control produces the expected output, and the second one doesn't. If I place a <xxx:ComponentLinkQS/> tag directly on an ASPX page, it renders fine.
I think that I've seen this before (full credit for the solution goes to Neil Gibbons and Hoang Chu).
The problem is caused by the ComponentPresentation server control inside the Tridion.ContentDelivery DLL and in particular the way this control loads in the DCP user control during it's Render method:
protected override void Render(HtmlTextWriter writer)
{
if (HttpContext.Current != null && HttpContext.Current.Application != null)
{
ComponentPresentationAssembler componentPresentationAssembler = new ComponentPresentationAssembler(this.pageUri, base.Page);
writer.Write(componentPresentationAssembler.GetContent(this.componentUri, this.templateUri));
base.RenderChildren(writer);
}
}
The Render method is too late in the control life-cycle for any other controls to have their events wired up - hence my user controls Page_load is never triggered.
There is a solution proposed for this on the Tridion forums on the link below which involves overriding the standard Content Delivery user controls to execute your embedded controls earlier in the life cycle: https://forum.tridion.com/topic.asp?TOPIC_ID=5709&whichpage=3&SearchTerms=Page_Load
(I am not sure about the legalities of copying code from the forums and adding it here. If someone from Tridion gives me the nod then I can add it in.)

How to access transformed html page in Custom Page Deployer?

Let's say we have to access the content of our published page in a Custom Deployer.
This part of the code is inside the processPage method that is in our CustomModule that extends PageDeploy class.
This way I will get the page that is being published, but content of that page will not be transformed (components that are in that page are not rendered).
public void processPage(Page page, File pageFile) throws ProcessingException {
File file = new File(pageFile.toString());
}
If I know that I can disable cleanup of the TransportPackages in cd_deployer.conf.xml, by changing the Cleanup to false: <WorkFolder Location="C:\tridion\work" Cleanup="false"/>,
I see that Tridion generates two versions of my page:
root\page.html (that has unrendered content, with path pageFile.ToString())
root\transformed\page.html (that has complete content - content that I want)
Why then when I create new File with the transformed page file path and read it, I get html code with even less content then the original html? Is this because in this phase of the deployment page is still not rendered and complete or...?
Thanks!
Is your page using Dynamic Component Presentations? If so, the Page-level HTML that is published and deployed will only contain an "include instruction" for the Component Presentation
<tcdl:ComponentPresentation ... />
The only thing that happens during deployment is that the "technology agnostic" language used during publishing/transport is translated into either a JSP tag or a ASP.NET server control include, in both cases it typically translated into something starting with tridion:ComponentPresentation.
The HTML fragment of the Dynamic Component Presentation itself will be published separately and stored as a separate item in the configured storage.
The complete HTML will only be composed when the page is requested (for serving to a visitor). At that stage the JSP tag library or ASP.NET server control will be invoked, read the HTML fragment for the Component Presentation from the storage and inject it into the HTML "wireframe" of the page.
With that knowledge, it indeed explains why you can't find the HTML fragment for the Dynamic Component Presentations in your Deployer extension: the merging of the DCP fragments into the Page shell only happens when the page is requested, not when it's deployed.

Telerik RadEditor image manager issues

We are using Telerik RadEditor control in our project and having some problems with its integration with our user documents storage engine. We've implemented custom content provider for Telerik image manager and it shows correct documents in dialog. But in doesn't switch between images while selection. You can see this on this picture. We've tested this behaviour on the blank ASP.NET page without any additional CSS or JS. Rad editor tag could be found below. Please help! Why do this could happen?
<telerik:RadEditor ID="radEditor" runat="server"
ToolbarMode="ShowOnFocus"
ToolsWidth="402"
EditModes="Design"
ToolsFile="~/RadEditor.xml"
Skin="Default">
<ImageManager ViewPaths="IMAGES" EnableImageEditor="False" ContentProviderTypeName="FileStorageContentProvider, App_CODE" />
</telerik:RadEditor>
Does it work as intended without your ContentProvider? I'm wondering if the logic in your contentprovider is causing the issue. I don't see anything out of the oridinary from your control properties.
Thanks to FiveTools! The issue was in content provider. Full path to item (including item name) should be passed to the 'location' parameter of the FileItem constructor. Otherwise selection would be broken.

Resources