web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)
Suggested Answer

Getting retrieved Page URL in Liquid

(0) ShareShare
ReportReport
Posted on by 215

Hey all, I know there is an attribute on the Page property to get the current Page's URL, or when getting Page objects through the navigation, breadcrumbs, etc, but I'm trying to figure out a way to get a page's URL if I retrieve a Web Page as an entity (through fetch, or get by id). Seems if I just try dot url, I get nothing back but haven't been able to figure it out. I'd rather not have to define a site marker for each page like this where I'd essentially like to output a link.

Any thoughts?

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Mahendar Pal Profile Picture
    45,095 on at

    Hi,

    One possible workaround could be to get the partial url and the parent page (partial url), which can help you to form your page url.

  • JasonMcneil Profile Picture
    215 on at

    Yep, that's an option, would rather avoid having to go back recursively to the root in order to assemble the full path though

  • Suggested answer
    oliver.rodrigues Profile Picture
    4,052 on at

    hi Jason

    have you tried page.title or page.url ?

    community.adxstudio.com/.../page

  • Suggested answer
    Dmytro Rutkovskyi Profile Picture
    1,835 on at

    you can do it even with some type of fetchxml, like below (this example output very simple sitemap with correct relative links to it for items up to 3 level deep in the hierarchy)

    <br/>full URL: 
    {{request.url}}
    
    
    {% fetchxml sitepages %}
    <fetch top="200" >
      <entity name="adx_webpage" >
        <attribute name="adx_partialurl" />
        <attribute name="adx_name" />
        <filter type="and" >
          <condition attribute="adx_isroot" operator="eq" value="1" />
          <condition attribute="adx_websiteid" operator="eq" value="{{website.id}}" />
        </filter>
         <link-entity name="adx_webpage" from="adx_webpageid" to="adx_parentpageid" link-type="outer" alias="parent1" >
          <attribute name="adx_partialurl" alias="parent1url" />
          <filter>
            <condition attribute="adx_isroot" operator="eq" value="1" />
            <condition attribute="adx_partialurl" operator="neq" value="/" />
          </filter>
          <link-entity name="adx_webpage" from="adx_webpageid" to="adx_parentpageid" link-type="outer" alias="parent2" >
            <attribute name="adx_partialurl" alias="parent2url" />
            <filter>
              <condition attribute="adx_isroot" operator="eq" value="1" />
              <condition attribute="adx_partialurl" operator="neq" value="/" />
            </filter>
          </link-entity>
        </link-entity>
      </entity>
    </fetch>
    {%endfetchxml %}
    
    <ul>
    {%for page1 in sitepages.results.entities %}
    <li> {{page1.adx_name}} - <b>{{page1.parent2url}}/{{page1.parent1url}}/{{page1.adx_partialurl}}</b> </li>
    {%endfor%}
    </ul>
    


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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans