Hi Community,
I hope you re doing all well.
We are facing a problem with the breadcrumb of our Power Portal.
To sum up our current configuration, we have an entity list from a custom entity (called : portal account visibility).
This entity list based on a view with related Accounts (relationship N-N)
(see screenshot 1)
When we open one of elements from the list, we call a new web page with an entity form (Portal account visibility)
This form contains a grid of accounts (child and great child accounts).
(see screenshot 2)
Finally when we click on a record from this entity form, we call again another web page with an entity form (Account), which displays information regarding the selected account.
Now, if we want to come back to the entity form Portal Account visibility (with the list of Addresses screenshot 2) by clicking on the breadcrumb element from the Account entity form, we get an error. Actually the breadcrumb doesn't send back the ID of the correct portal account visibility record but the selected Account.
(See screenshot 3)
We used some liquid tag to provide this ID of Portal account visibility to the web page URL, but we aren't able to load the page without any error.
Does anyone know if it is possible to pass an id that does not come from a current entity form in liquid or JS?
If you need extra information, do not hesitate to ask me in this post.
Thanks a lot !
AD.
Solved! Go to Solution.
Hi Oliver,
Thank you for your help !
We have already tried to implement JS but We couldn't retrieve the record ID from entity list.
We finally found a acceptable solution in our case.
We use a combination between HTML and liquid tags and thanks to a fetch xml.
This is our solution :
{% assign title = title | default: page.title %}
{% if page.adx_partialurl == 'address' %}
{% assign addrId = params.id %}
{% assign acc = entities.account[params.id] %}
{% if acc and acc.parentaccountid %}
{% assign acctId = {{acc.parentaccountid.id}} %}
{% else %}
{% assign acctId = {{acc.id}} %}
{% endif %}
{% fetchxml myquery %}
<fetch version='1.0' mapping='logical'>
<entity name='customentityid'>
<attribute name='customentityid' />
<attribute name="accountid" />
<attribute name="name" />
<filter type="and">
<condition attribute="accountid" operator="eq" value="{{acctId}}" />
</filter>
</entity>
</fetch>
{% endfetchxml %}
{% for result in myquery.results.entities %}
{% assign potaccvisId = {{result.customentityid}} %}
{% endfor %}
{% endif %}
<ul class="breadcrumb">
{% for crumb in page.breadcrumbs %}
{% assign bUrl = crumb.url %}
{% if bUrl contains '/addresses/' %}
{% assign bUrl = bUrl | add_query: 'id', {{potaccvisId}} %}
<li><a href="{{ crumb.url | add_query: 'id', {{potaccvisId}}" title="{{ crumb.title | escape }}">{{ crumb.title | escape }}</a></li>
{% else %}
<li><a href="{{ crumb.url | escape }}">{{ crumb.title | escape }}</a></li>
{% endif %}
{% endfor %}
<li class="active">{% block activebreadcrumb %}{{ title | h }}{% endblock %}</li>
</ul>
In this way, we could access to the ID from custom entity and put it in our navigation bar from the current record Account.
Thanks again.
AD.
After going from Entity List to Web Page, we usually then use Entity Form (rather than another Web Page) as it pops up over the Web Page and doesn't stuff up the navigation.
You can probably do what you want by creating your own template and customising your own breadcrumb see the following link for an example https://docs.microsoft.com/en-us/powerapps/maker/portals/liquid/create-custom-template
Hi @Anonymous
you can achieve this by adding a JavaScript at the 3rd (last) page doing the following:
$(".breadcrumb").find("a[href='/<your url>/']").attr("href", "<new url>")
Power Pages Super User | MVP
Hi Oliver,
Thank you for your help !
We have already tried to implement JS but We couldn't retrieve the record ID from entity list.
We finally found a acceptable solution in our case.
We use a combination between HTML and liquid tags and thanks to a fetch xml.
This is our solution :
{% assign title = title | default: page.title %}
{% if page.adx_partialurl == 'address' %}
{% assign addrId = params.id %}
{% assign acc = entities.account[params.id] %}
{% if acc and acc.parentaccountid %}
{% assign acctId = {{acc.parentaccountid.id}} %}
{% else %}
{% assign acctId = {{acc.id}} %}
{% endif %}
{% fetchxml myquery %}
<fetch version='1.0' mapping='logical'>
<entity name='customentityid'>
<attribute name='customentityid' />
<attribute name="accountid" />
<attribute name="name" />
<filter type="and">
<condition attribute="accountid" operator="eq" value="{{acctId}}" />
</filter>
</entity>
</fetch>
{% endfetchxml %}
{% for result in myquery.results.entities %}
{% assign potaccvisId = {{result.customentityid}} %}
{% endfor %}
{% endif %}
<ul class="breadcrumb">
{% for crumb in page.breadcrumbs %}
{% assign bUrl = crumb.url %}
{% if bUrl contains '/addresses/' %}
{% assign bUrl = bUrl | add_query: 'id', {{potaccvisId}} %}
<li><a href="{{ crumb.url | add_query: 'id', {{potaccvisId}}" title="{{ crumb.title | escape }}">{{ crumb.title | escape }}</a></li>
{% else %}
<li><a href="{{ crumb.url | escape }}">{{ crumb.title | escape }}</a></li>
{% endif %}
{% endfor %}
<li class="active">{% block activebreadcrumb %}{{ title | h }}{% endblock %}</li>
</ul>
In this way, we could access to the ID from custom entity and put it in our navigation bar from the current record Account.
Thanks again.
AD.