Hello,
I am trying to make an attachment system for the bottom of pages.
My first approach is attempting to use repeatable fields. It's not going to well. I have created a repeatable called 'attachments', and an editable field called 'attachment file'.
In the Couch Admin panel, it works as it is expected to work, and the repeatable fields come up, able to edit them and upload files, etc.
Using databound forms however, I have come to a standstill.
I have tried two things
First :
This results in the input field just like the Admin CP has being rendered. However, if I upload a file and save the document/edit, it does not get stored. I am sure this has to do with the input being bound to a repeatable which has no relation in the database for that function.
This results in a singular basic upload input, which does not work, either.
I have read through some other threads, and from some posts I've gathered that trying to use repeatable fields in a databound form does not work.
So, first question, Is there any way to make it work? This is my preferred approach.
Second :
I have read up a little but on relational fields : http://www.couchcms.com/docs/concepts/r ... ships.html
I am to the assumption that these relations are only bound to a cms page, or a root of a section.
What I'm thinking what might work is if I can bind a relationship of an attachment stored in an attachment page to a page_id. Is that possible? This way I can just list attachments where attachment k_page_id = document k_page_id. Is this possible?
Thanks for anyone with any comments or answers!
I am trying to make an attachment system for the bottom of pages.
My first approach is attempting to use repeatable fields. It's not going to well. I have created a repeatable called 'attachments', and an editable field called 'attachment file'.
- Code: Select all
<cms:repeatable name="attachments">
<cms:editable type='file' name="attachment_file" allowed_ext='pdf, doc, docx, xls, xlsx' max_size='1024' />
</cms:repeatable>
<cms:show_repeatable "attachments" >
In the Couch Admin panel, it works as it is expected to work, and the repeatable fields come up, able to edit them and upload files, etc.
Using databound forms however, I have come to a standstill.
I have tried two things
First :
- Code: Select all
<cms:input type='bound' name='attachments' trust_mode='1'/>
This results in the input field just like the Admin CP has being rendered. However, if I upload a file and save the document/edit, it does not get stored. I am sure this has to do with the input being bound to a repeatable which has no relation in the database for that function.
- Code: Select all
<cms:input type='bound' name='attachment_file' trust_mode='1'/>
This results in a singular basic upload input, which does not work, either.
I have read through some other threads, and from some posts I've gathered that trying to use repeatable fields in a databound form does not work.
So, first question, Is there any way to make it work? This is my preferred approach.
Second :
I have read up a little but on relational fields : http://www.couchcms.com/docs/concepts/r ... ships.html
I am to the assumption that these relations are only bound to a cms page, or a root of a section.
What I'm thinking what might work is if I can bind a relationship of an attachment stored in an attachment page to a page_id. Is that possible? This way I can just list attachments where attachment k_page_id = document k_page_id. Is this possible?
Thanks for anyone with any comments or answers!