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

  • Suggested answer
    Dmytro Rutkovskyi Profile Picture
    1,835 on at
    RE: Getting retrieved Page URL in Liquid

    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>
    


  • Suggested answer
    oliver.rodrigues Profile Picture
    4,052 on at
    RE: Getting retrieved Page URL in Liquid

    hi Jason

    have you tried page.title or page.url ?

    community.adxstudio.com/.../page

  • JasonMcneil Profile Picture
    215 on at
    RE: Getting retrieved Page URL in Liquid

    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
    Mahendar Pal Profile Picture
    45,095 on at
    RE: Getting retrieved Page URL in Liquid

    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.

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Microsoft Dynamics CRM (Archived)

#1
Mohamed Amine Mahmoudi Profile Picture

Mohamed Amine Mahmoudi 83 Super User 2025 Season 1

#2
Community Member Profile Picture

Community Member 52

#3
Victor Onyebuchi Profile Picture

Victor Onyebuchi 6

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans