I properly managed to add the CSV Importer module to regular pages but now I was attempting to do so on cloned pages and fill out repeatable regions with it's help.

The issue I have right now is that it displays on the screen the entire content of the CSV but it only adds the last row as a repeatable region. It feels like capturing the existing data of the repeatable region back in "my_data" before adding a new one is not working but that does not really make sense.

I have simply made the following changes to the original code:

Code: Select all
<tr>
                <td><cms:show k_current_record /></td>
                <cms:csv_columns>
                    <td><cms:show value /></td>
                </cms:csv_columns>
            
            <cms:capture into='my_data' is_json='1'>
               <cms:show_repeatable 'all_items' as_json='1' />
            </cms:capture>
            
            <cms:capture into='my_data.' is_json='1'>
               {
                 "part_number" :<cms:escape_json><cms:show _pn /></cms:escape_json>,
                 "part_title" : <cms:escape_json><cms:show _title /></cms:escape_json>
               }
            </cms:capture>

                <!-- database operation here -->
                    <cms:db_persist
                        invalidate_cache='0'
                  _masterpage=k_template_name
                  _mode='edit'
                  _page_id=k_page_id
                        all_items=my_data
                    >
                        <cms:if k_error>
                            <strong style="color:red;">ERROR:</strong> <cms:show k_error/>
                        </cms:if>
                    </cms:db_persist>
                <!-- end database operation -->
            </tr>