Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Answered

Get base URL of the current Portal page using liquid code

Posted on by 459

Hi

I have a portal site. i tried to get the base url i.e: abc-dev.powerappsportals.com/ 

I am on the index page (refer to image 1). I need to get the base URL using liquid code. i tried with {{ page.url}} , and {{ page.url | base}}.  it only returns "/index" for the example (refer to image 1).  Please advise how i can get the base URL. Thank you, Siva

image 1

pastedimage1668463163522v1.png

  • Verified answer
    AndyArndt Profile Picture
    AndyArndt 110 on at
    RE: Get base URL of the current Portal page using liquid code

    I think you might be able to accomplish what you want with the built in Site Marker named Home. The liquid code would look like this:

    {{ sitemarkers[Home].url }}

    Nicholas Hayduk has a video about it on his Engineered Code YouTube channel named "Dynamics 365 Portals Tip #16 - Please Use Site Markers! - Engineered Code"

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!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans