Developer forum

Forum » Development » Remove Custom field entirely

Remove Custom field entirely


Reply
Hi

I have a couple of custom fields that are specified as type: "file" in the eCom productcatalogue module.

Because the output from the DW template tag is a partial systempath to the file i wrapped it in an HMTL-anchor to generate a valid link. This method generates an anchor tag wheter or not the customer points to a file.

My question is then - how do i contruct the tag so that the link to the file is only present when the client point to at file when creating the record in the backend.

My DW template tag
<a href="Files/<!--@Ecom:Product:Field.DWVideo.Value-->">Testlink</a>

Template tag alone
<!--@Ecom:Product:Field.DWVideo.Value-->
Output example: /Filer/2-flojet-a4-avenue-korrektur.pdf

Link to page: http://scantruck.net.dynamicweb.dk/Default.aspx?ID=22

Thanks in advance

Jeppe

Replies

 
Reply
Hi Jeppe

As I understand your question, you want to only display the <a>-tag when a value is present in your tag, right?

You can do that with the If-tag described in this document:
http://template.dynamicweb.dk/TemplateTags/Dynamicweb-template-tags/General-tags/If/else-tags.aspx

The If-tag outputs the inner html if the tag value is set and has a length of more than zero.

 - Lasse

 

You must be logged in to post in the forum