How to print the current page full url?


(Gustavofiuza) #1

Hello,


does anyone know how to display the full url of the current page the user is seeing?



I tried doing this using using an asset_lineage and printing the asset_link, and it did work, but it shows the whole lineage full urls. This is the result I’m getting:



http://www.mysite.com > http://www.mysite.com > http://www.mysite.com



What I’m trying to do is to display only the last link (which is the full URL of the current page the user is seeing). This is the code I’m using:


    
              
         
              
         
         
              
                 
              
    


I changed the "prefix_with_home_link" to "false", and then got rid of the first level URL (http://www.mysite.com), so it's working if the user is seeing a first level or a second level page. But when it's a third level page, it prints the second level and the third level URL's.

Any ideas? :unsure:


Regards

(Avi Miller) #2
    

:)

(Gustavofiuza) #3

Hi Avi,


it didn't work at first, I input your code but all that would display is the full URL without the assets. Then I saw that you wrote the var as "site_link", and it should be "asset_link" to make it work the way I was talking about.



Anyway, I think that's what you meant. Thanks a lot! :slight_smile:



Fixed code: