The problem I have is the following. I have a component template with "Allow on Page using Dynamic Assembly" enabled. The component that is going to be rendered by this CT has a component link.
So when I publish the page, the dynamic component template, and the components the result that I get is that the component link is not resolved so I don't get link.
This is the code I'm trying with the web user control:
private void CreateResults(int index)
{
ComponentPresentationAssembler cpa = new ComponentPresentationAssembler();
litResult.Text = string.Empty;
for (int i = 0; i < Results.Count; i++)
{
string content = cpa.GetContent(Results[i], TemplateUri);
if (content != null
&& (System.Text.RegularExpressions.Regex.IsMatch(content, ".*CountryCode:" + CountryCode + ".*",
System.Text.RegularExpressions.RegexOptions.IgnoreCase)
|| System.Text.RegularExpressions.Regex.IsMatch(content, ".*CountryCode: .*")))
{
litResult.Text += content;
break;
}
}
}
And this is the code inside the CT:
<div class="ContactPerson">
<!-- CountryCode:@@Component.Country@@ -->
<h3 class="Title_Widget">Contact Person</h3>
<div class="info_Block">
<img class="Author_Image" src="@@Component.Picture@@"/>
<div class="contact_Block">
<p class="Author_Name">@@Component.Name@@</p>
<!-- TemplateBeginIf cond=" StringLength(Fields.LinkLinkedinProfile) > 0 " -->
<p class="Author_Linkedink"><a href="@@Component.LinkLinkedinProfile@@" taget="_blank"><span class="linkedinImage"></span></a></p>
<!-- TemplateEndIf -->
</div>
</div>
<!-- TemplateBeginIf cond=" StringLength(Fields.PhoneNumber) > 0 " -->
<p class="Author_Phone">T @@Component.PhoneNumber@@</p>
<!-- TemplateEndIf -->
<p class="Author_Email">M <a tridion:href="@@Component.ContactForm@@">@@Component.EmailAddress@@</a></p>
</div>
Could someone help me?
Thanks in advance.