How to display HTML fields in Edit Entry mode

Home Forums Quform WordPress How to display HTML fields in Edit Entry mode

This topic is: not resolved
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #26634
    katw
    Participant

    I have a number of HTML fields acting as visual dividers between form sections.

    Edit Entry mode does not display them.

    Is there a way to make them visible in Edit mode?

    #26647
    katw
    Participant

    Hi Ally,

    I have found a solution that works. But that involved copying the following code from entries/view.php to entries/edit.php.

    if ($element instanceof Quform_Element_Html) {
        if ($element->config('showInEntry')) {
            echo sprintf('<tr class="qfb-entry-row-html"><td colspan="2">%s</td></tr>', $element->getContent());
        }
    
        continue;
    }

    I inserted it after LINE 30 which is: <?php foreach ($form->getRecursiveIterator() as $element) : ?>

    Not a pretty hack but seemed to solve my immediate needs.

    BTW both the Entry View and Edit View is inserting colspan="2" for Group and HTML elements when your current table layout is only ever one column wide.

    • This reply was modified 5 years, 7 months ago by katw. Reason: fixed codeview
    • This reply was modified 5 years, 7 months ago by katw. Reason: typos
    #26700
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #26707
    katw
    Participant

    Yes I can see a use case for HTML and without HTML fields.

    In my case I was using the HTML fields for delimiters/dividers between form sections therefore it made sense to have them in admin mode.

    I suppose it would be hard to write a hook to allow you to insert html between field elements in admin view/edit mode?

    With say a after element_ID parameter. Much like CSS :Before and :After.

    #26747
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.
Be inspired. © 2024 ThemeCatcher Ltd. 20-22 Wenlock Road, London, England, N1 7GU | Company No. 08120384 | Built with React | Privacy Policy