Confiforms: Modification of link text from links field
Asked by its moi:

I have a form with a link field where URLs will be pasted in. In views I do not want to have the (rather long) URL shown, but either a standard text or icon (e.g. "Weblink") or a text which the registration user has to enter in the form.

Is that possible and if yes, how?   
Currently the link field will just take the original link into views.

Thanks for hints :)


Answers:
author: Alex Medved _ConfiForms_
body: You can have a ConfiForms field macro with field name set to use asLink function.

<https://wiki.vertuna.com/display/CONFIFORMS/Virtual+functions>

Assuming your field is called "mylink" then you will need to put into field name parameter something like

```
mylink.asLink(Weblink)
```

comments: author: its moi
body: perfect (y)


author: Kaushlendra
body: I am trying to use this method but it is is showing 'weblink' even when link is not provided by the user and record is empty.


author: Alex Medved _ConfiForms_
body: Hi

May I see how are you using this?

Alex


author: Kaushlendra
body: I ma using it inside the "Field" macro in TableView macro, here is how Field macro looks like..

![Capture.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/130852iC42889FCEA8002D9/image-dimensions/287x243?v=v2 "Capture.PNG")


author: Alex Medved _ConfiForms_
body: Unless you are using some very old ConfiForms version it should work

Quick test from me: <http://recordit.co/5uHh1WixP0>


author: Alex Medved _ConfiForms_
body: A-ha, you are saying that the "weblink" label is generated EVEN when there is no value in the docLink field. I see now!

We will fix this asap


author: Kaushlendra
body: Exactly, Thank you.


author: Michael Taylor
body: Alex, any update on this?  

"A-ha, you are saying that the "weblink" label is generated EVEN when there is no value in the docLink field. I see now!"


author: Alex Medved _ConfiForms_
body: This has been fixed the same month we had this discussion

Alex


author: Michael Taylor
body: I have my definition as

\<ac:structured-macro ac:macro-id="65caec94-3803-41c3-bcf0-8873cd064e56" ac:name="confiform-field-definition" ac:schema-version="1"\>  
\<ac:parameter ac:name="fieldName"\>Hyper\</ac:parameter\>  
\<ac:parameter ac:name="fieldLabel"\>URL\</ac:parameter\>  
\<ac:parameter ac:name="fieldDescription"\>URL if exists\</ac:parameter\>  
\<ac:parameter ac:name="type"\>link\</ac:parameter\>

and the field set up as

\<ac:structured-macro ac:macro-id="317838c7-caea-4f4a-b1e9-449e2b448e30" ac:name="confiform-field" ac:schema-version="1"\>  
\<ac:parameter ac:name="hideIfEmpty"\>true\</ac:parameter\>  
\<ac:parameter ac:name="messageToShowWhenEmpty"/\>  
\<ac:parameter ac:name="fieldName"\>Hyper.asLink(Link)\</ac:parameter\>

Every record shows Link


author: Michael Taylor
body: Based on your answer timeline it looks like the fix would have been Feb-March. I will check with my admin on the last time it was updated.


author: Alex Medved _ConfiForms_
body: That looks correct (configuration). Please check what ConfiForms version you are using and update if not on latest

Alex


author: Michael Taylor
body: Update did resolve the issue


Tags: confiforms

confluence-server

server