Hi,
you can use following code with macro:
{(1)%username|(equals)public|(truevalue)<div class="notLoggedList"><br /><p>To download these attachments, please <a href="~/Login.aspx?a={(2)%nodealiaspath%(2)}">login</a> or <a href="~/Login.aspx?a={(2)%nodealiaspath%(2)}">register</a></div>|(falsevalue)%(1)}
In the logonform webpart on Login.aspx page set
Default target URL: http://localhost/{%a|(default)/home.aspx%}.aspx
You can modify the default path according to your needs. If the "a" query parameter is not specified /home.aspx will be used.
This way query parameter will be resolved and the user will be redirected back to the requested document after login.
Best regards,
Ivana Tomanickova