Problems, need help? Have a tip or advice? Post it here.
3 posts Page 1 of 1
Hello, boys and girls!

I'm using
Code: Select all
<cms:pages masterpage='members/folders.php' custom_field="idyear=id(<cms:show k_page_id />)" show_future_entries='1'>
to display aprox. 160-200 pages (with 4 fields: k_page_date, 3 custom fields and option for view, edit and delete page), and I'm experiencing slow page load (18-20 seconds).

Testing my code for searching which the problem could be, I have found out that the issue is the delete option I have, using:

Code: Select all
<div id="delete-modal-<cms:show k_page_id />" class="mfp-hide white-popup-block"><!-- Start delete-modal -->
                     <cms:form
                            masterpage=k_template_name
                            mode='edit'
                            page_id=k_page_id
                            method='post'
                            anchor='0'
                         >

                         <cms:if k_success>
                           <cms:db_delete_form />
                     <cms:redirect url="<cms:show k_site_link/>members/years.php?p=<cms:gpc method='get' var='p' />" />
                              </cms:if>
                         .........
                                                  .........
                             
                  </cms:form>
               </div><!-- End delete-modal -->

My question is why is this happening? Is something wrong with my implementation? Is there any other way of deleting pages from front-end?
Hello.. So, the form is being repeated hundred(s) times - that slows down the page considerably. See how it's done in backend - a button that triggers a JS script. Refactoring your code in a similar fashion is the only correct option.

your best friends: github, StackOverflow, telegram
trendoman wrote: Hello.. So, the form is being repeated hundred(s) times - that slows down the page considerably. See how it's done in backend - a button that triggers a JS script. Refactoring your code in a similar fashion is the only correct option.

Thank you @trendoman for your respons. It's good to know there is a solution for this. Unfortunately, I have almost 0 knowledge of JS, so some concrete help is needed over here :D If anyone interested, just drop me a line.
Thank you!
3 posts Page 1 of 1