Problems, need help? Have a tip or advice? Post it here.
6 posts Page 1 of 1
Hi! I'm trying to implement dynamic inputs in admin edit view by using <cms:config_form_view> tag.
Strange thing happens when I add lots of custom rendering field directives. Eg:
Code: Select all
<cms:field 'block_faq' class="page-heading page-heading--main" >
    <cms:if block_faq >
      <cms:input name=k_field_name type='bound' trust_mode='1' />
      <cms:else />
        <cms:input name=k_field_name type='bound' trust_mode='1' placeholder="<cms:get_custom_field "block_faq_ru" masterpage='common/services-section-names.php' />" />
    </cms:if>
  </cms:field>


If I put ~20 of them - everything is fine but when I reach certain number of custom code admin view markup gets ruined. Can It be so that there any sort of limit? Maybe those are stored in DB and there is DB field memory limit?

Thank you!
Yes, the config is saved in the database. The MySQL field used for it is of type 'text' and so has a limit of '65535' characters. This should be sufficient for most cases - clearly not for yours though :)

To check if the size is indeed the problem, please try moving all the code enclosed within <cms:config_form_view> tag block into a 'snippet' (e.g. named 'config_form.html'). Next, embed that snippet within <cms:config_form_view> as follows -
Code: Select all
<cms:config_form_view>
    <cms:embed 'config_form.html' />
</cms:config_form_view>

This way we'll be storing the contents in a file instead of the database..

Do let me know if this helps.
Embedding makes no difference. It can't be the code itself as it is a copy-paste thing. If it works with some fields - it should work exactly the same with the others.
Well, if it is not the database issue then it has to be the code.

Please try to troubleshoot the issue by making incremental changes - begin with a few fields, test, add a few more, test. At the point the layout breaks, try to isolate the last added fields. Use them alone and see if that results in the same problem.
It seems to me that embedding file still makes it save it's contents to DB
My bad. Yes, you are right - the eventual config info still gets persisted in the database.

Ok, so could you please PM me your template? Let me take a look at what you are trying to do and, perhaps, we could figure out some simpler alternative to achieve that.

Thanks.
6 posts Page 1 of 1