Lava Filters - Url

Category:Other

Description:The Url filter allows you to easily get access to parts of a URL without a ton of string manipulation.
Input:
Lava: {% assign url = 'https://www.rockrms.com/WorkflowEntry/35?PersonId=2' %} Testing URL {{ url }} host - {{ url | Url:'host' }} port - {{ url | Url:'port' }} segments - {{ url | Url:'segments' | ToJSON }} scheme - {{ url | Url:'scheme' }} protocol - {{ url | Url:'protocol' }} localpath - {{ url | Url:'localpath' }} pathandquery - {{ url | Url:'pathandquery' }} queryparameter no key - {{ url | Url:'queryparameter' }} queryparameter with key - {{ url | Url:'queryparameter','PersonId' }} url - {{ url | Url:'url' }} invalid_part - {{ url | Url:'invalid_part' }}
Output: Testing URL https://www.rockrms.com/WorkflowEntry/35?PersonId=2 host - www.rockrms.com port - 443 segments - [ "/", "WorkflowEntry/", "35" ] scheme - https protocol - https localpath - /WorkflowEntry/35 pathandquery - /WorkflowEntry/35?PersonId=2 queryparameter no key - queryparameter with key - 2 url - https://www.rockrms.com/WorkflowEntry/35?PersonId=2 invalid_part -