Question: I am new to communities in lightning and I am trying to figure out a way to directly fetch the URL parameters into the lightning component attributes using the 
{! urlParamName} expressions.

for example : 

```
https://www.someurl.com/page?name=somename&surname=somesurname

```

My lightning component will be : 

```
<aura:component>

    <!-- Parameters Available in URL-->
    <aura:attribute name="name" type="String">
    <aura:attribute name="surname" type="String">

    <!--It will get name parameter from URL directly-->
    Name is : {!v.name} 

    <!--It will get surname parameter from URL directly-->
    SurName is : {!v.surname}

</aura:component>

```

I am trying to figure out a way which cannot includes JS.
Currently I am using Lightning JS to get these parameters.

Answer: 
After [Summer 18 release](https://releasenotes.docs.salesforce.com/en-us/summer18/release-notes/rn_lc_components_navigation.htm) (API version 43 and up) we can do this.

Implement `lightning:isUrlAddressable` interface and use `pageReference` attribute.

Example. - Component
Assume url is *<https://<instance>.lightning.force.com/lightning/cmp/<namespace>__componentName?testAttribute=abc>*

```
<aura:component implements="lightning:isUrlAddressable">
   <aura:handler name="init" value="{!this}" action="{!c.doInit}" description="Handler for valueInit event fired when the component has been initialised"/>
        {!v.pageReference.state.testAttribute}
</aura:component>

```

Component Controller

```
({
    doInit : function(component, event, helper) {
        console.log(component.get("v.pageReference").state.testAttribute);
    }
})

```

Console output will look like: "abc"
It is actually much easier to pass URL parameters to Lighning components in a community page. The "trick" is to expose your attributes at design time to the page, so they show up in the Lightning page designer as component properties. You do that in the design definition (the .design file):

```
<design:component label="Sample">
   <design:attribute name="someParam" label="Make Parameters great again" />
</design:component>

```

this presumes that you component has a parameter `someParam` in its attribute definition (in the .cmp file):

```
<aura:component implements="forceCommunity:availableForAllPageTypes" access="global" controller="someController">
    <aura:attribute name="someParam" type="String" />
    .... stuff here ...
</aura:component>

```

Let's presume your url looks like `....?color=blue` then you add into the property value of your component, after you dragged it onto the lightning page in community builder:

```
 {!color}

```

This will pull the value of the color URL parameter and hand it to the someParam attribute of your component. No JS required.

Hope that helps

Update:
=======

Passing URL parameters using component properties is **not** officially supported and only works on a full page load (which is slow).