Forum

Thread tagged as: Problem

How do you add enable to add hyper link to a file in a reoccurring table

Hello

I am not sure how to go about this. I need to enable a pdf title to be linked to a pdf and the authors need to be on the same row. see page https://www.qcproject.co.uk/marvellous/research.html

I thought about a repeating table but It seems that you cant add a hyperlink to the entry using a template but you cant add a hyper link in the template field. The template is:

perch:repeater id="reasearch" label="Reasearch papers pdf" max="15"> 
 <table width="800" border="0" cellspacing="4" cellpadding="4" align="center">
        <perch:before><tr></perch:before>
                <td width="189"><span class="C-13"><strong><perch:content type="text" id="pdf_title" label="PDF Title" /></strong></span></td>
                <td width="584"><span class="C-13"><perch:content type="text" id="authors" label="Authors Names" /></span></td>
          <perch:after></tr></perch:after>
        </table>
</perch:repeater> 

Is there another way of achieving this?

Paul Quillin-Creamer

Paul Quillin-Creamer 0 points

  • 6 years ago
Rachel Andrew

Rachel Andrew 394 points
Perch Support

I'm not sure I understand the problem or maybe what you are trying to do.

If the admin is uploading the file through Perch just add it as a file field and make the link as normal. If you want them to enter a link then just use a text field. Both work so if you believe it doesn't work then I'll need more details as to what is happening.

Hello

I see now. I tried the table below but it only showed the authors section and not the file upload in the admin area can you see were I'm going wrong?


<perch:repeater id="reasearch" label="Reasearch papers pdf" max="15"> <table width="800" border="0" cellspacing="4" cellpadding="4" align="center"> <perch:before><tr></perch:before> <td width="189"><span class="C-13"><strong><perch:input type="file" id="research" accept="pdf doc" /></strong></span></td> <td width="584"><span class="C-13"><perch:content type="text" id="authors" label="Authors Names" /></span></td> <perch:after></tr></perch:after> </table> </perch:repeater>
Michael Wilkinson

Michael Wilkinson 6 points
Registered Developer

Hi Paul

Try replacing:

<perch:input type="file" id="research" accept="pdf doc" />

with this:

<a href="<perch:content id="research" type="file" accept="pdf doc" label="Research Document" />" target="_blank">
<perch:content type="text" id="desc" label="Link Text" order="1" required="true" title="true" />
</a>

Cheers.

Hello

I tried it an it works many thanks.

hope you have a good day.

Paul

Michael Wilkinson

Michael Wilkinson 6 points
Registered Developer

Great stuff Paul. Don't forget to mark it as solved so it's removed from the 'Open' filter.

I cant see the solved button. On my first post is says Mark Unsolved

Drew McLellan

Drew McLellan 2638 points
Perch Support

I marked it as solved on your behalf.