So we have a bilingual Portal built with Adxstudio version 7.
On the search.aspx page, there is a translation missing, so we tried to insert a content snippet in the code. But when we run the page, the snippet displays twice.
An image is worth a thousand words, so here it is:
Original code:
<h3>No results for query <em class="querytext"><%# AntiXss.HtmlEncode((Eval("[Query]") ?? string.Empty).ToString()) %></em></h3>
Result on the portal:
Modified Code:
<h3><adx:Snippet runat="server" SnippetName="Knowledge Base No Results" DefaultText="No results found for Query "/><em class="querytext"><%# AntiXss.HtmlEncode((Eval("[Query]") ?? string.Empty).ToString()) %></em></h3>
Result on the portal:
For some reason the snippet default text displays twice.
Any idea?
Thanks again Matt! This is just getting weirder!
I added both "Editable" and "EditTpye", so now the code looks like this:
<asp:Panel Visible='<%# ((int)Eval("Count")) == 0 && ((int)Eval("PageNumber")) == 1 %>' runat="server">
<h3><adx:Snippet runat="server" SnippetName="Knowledge Base No Results" Editable="true" EditType="html" /><em class="querytext"><%# AntiXss.HtmlEncode((Eval("[Query]") ?? string.Empty).ToString()) %></em></h3>
</asp:Panel>
I also logged on the portal with an admin account. It still shows twice. But thee weird part is when I try to edit the snippet inline, it's there only once - see:
Here is the code from the HTML inspection. We can see the class being generated twice:
When I inspect the HTML, we can see a few things are duplicate... like xrm-attribute...
h3><div class="xrm-attribute xrm-editable-html xrm-attribute xrm-editable-html" data-encoded="false" data-filebrowser-dialog-url="~/xrm-adx/filebrowser.html" data-filebrowser-url="/_services/portal/66a69c56-546f-4066-b0d8-a14fa99df63b/elFinder/connector" data-cmstemplate-url="/_services/portal/66a69c56-546f-4066-b0d8-a14fa99df63b/adx_contentsnippet/505b1335-ce57-ea11-8159-005056b9257d/__templates/all/L2tub3dsZWRnZS1iYXNlL3NlYXJjaC1yZXN1bHRzLw%3d%3d" data-editable-url="/_services/portal/66a69c56-546f-4066-b0d8-a14fa99df63b/adx_contentsnippet/505b1335-ce57-ea11-8159-005056b9257d/adx_value" data-label="Knowledge Base No Results" data-liquid="true" data-editable-title="Knowledge Base No Results" data-cmstemplate-render-url="/_services/portal/66a69c56-546f-4066-b0d8-a14fa99df63b/adx_contentsnippet/505b1335-ce57-ea11-8159-005056b9257d/__templates/live-preview/L2tub3dsZWRnZS1iYXNlL3NlYXJjaC1yZXN1bHRzLw%3d%3d" data-xrm-base="/xrm-adx/">
<div class="xrm-attribute-value">No Results for Search:</div><div class="xrm-attribute-value">No Results for Search:</div>
</div><em class="querytext">ABCDEF</em></h3>
Hey Yvan,
Thanks for trying out those options - it's super weird that it's still happening!
I can only think of two more items for you to try:
Feel free to send me the HTML markup from #1 as it may also help me track down the potential issue.
Keep me posted on what you find!
Thanks!
Matt Bayes
Hi Matt,
Thanks a lot for providing a few solutions.
1. I tried removing the DefaultText attribute. No luck here. It still displays twice. Then I made sure all Content Snippets were deleted from CRM. Then nothing displays at all. As soon as I added the Snippet again, it shows twice
2. I removed all related Snippets from both French and English Portals. Still diplays twice. Very weird behaviour.
So I am still scratching my head with this!
Hey Yvan,
Being an older version of the portals I am not too familiar with some of the specifics.
Based on the output, the only things I can think would be:
Give that a go and let me know what you find.
Thanks!
Matt Bayes
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156