Help with dynamic links within blocks, including URL parameters

I have a grid feature block with 3 items which need to link to (1) another section on the same page, (2) an external page, (3) another page in the application which requires a URL parameter to be passed along with it. Does anyone have any custom code which can grab the URL param from the current page to pass on to the next page in item #3, without messing up the hrefs for items #1 and #2?