Skip to main content

Notifications

Customer experience | Sales, Customer Insights,...
Unanswered

Portal - Content Snippet displayed twice

Posted on by 1,545

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:
pastedimage1582031875915v1.png

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:
pastedimage1582032023471v3.png

For some reason the snippet default text displays twice.

Any idea?

  • yleclerc Profile Picture
    yleclerc 1,545 on at
    RE: Portal - Content Snippet displayed twice

    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:

    pastedimage1582810945372v1.png

    pastedimage1582810959862v2.png

    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>

  • - Matt Bayes - Profile Picture
    - Matt Bayes - 890 on at
    RE: Portal - Content Snippet displayed twice

    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:

    1. Inspect the HTML via your browser that's generated with the duplicate text, just to see what tags it's being wrapped in. This may point us in the right direction or at least allow us to rule out potential issues.
    2. Add the "Editable" property to the Content Snippet tag and specify the "EditType" tag for "html" or "text" depending on what you are rendering. Once complete, you should be able to edit the snippet inline on the page if you have the correct permissions, and maybe this will show you some additional information that might not be easily visible from within the CRM environment. The information for this can be found here.

    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

  • yleclerc Profile Picture
    yleclerc 1,545 on at
    RE: Portal - Content Snippet displayed twice

    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!

  • - Matt Bayes - Profile Picture
    - Matt Bayes - 890 on at
    RE: Portal - Content Snippet displayed twice

    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:

    1. The Content Snippet is rendering the DefaultText attribute even though it has information. If possible, maybe remove this from your tag and see if it changes anything.
    2. Due to the nature of your portal having multi-languages setup, it could very well be rendering both the English and French snippets. Take a look at the snippets in your system and see if there are multiple with the same name and value.

    Give that a go and let me know what you find.

    Thanks!

    Matt Bayes

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans