Modifying the submit listing form

Hi!

I’m trying to add some HTML below the form title and the first field. I found the snippet to add the form description, but I get a wall of text and the HTML tags are removed because this field is sanitized.

image

Since this is done in class-form.php, I cannot override it as a template in the child theme, I thnk.
I also need to make further modifications to this file to create subtitles between sections of the form, similar to this website, to separate personal, social media and business blocks within the form (I may insert conditionals, or move the description to above the labels and apply CSS to make them into subtitles).

I’m a web developer, but I’m somewhat rusty on PHP and WordPress and I’m wondering if you can point me in the right direction. Thanks!

1 Like

Hi! I think you cannot use html tags in a php snippet. I’m using a “silly” css to display info on my website add listing page, with this code:

.hp-form--listing-submit:before {content:'Attention! \A \2022  Here is your first list element.\A \2022  This is the second. \A \2022  And the last listing element here'; color: darken; display: block; background-color: whitesmoke; padding: 5px; margin-bottom: 10px; margin-top: 20px; border-left: 4px solid yellowgreen; white-space: pre-wrap;}

Where is: \A a css new line, and \2022 a css bullet point
If you don’t want to display your first novel here, I don’t believe this make an impact on your website’s speed.
Using this css you will get like this:

Adding the texts between blocks, it’s very simple with css, just find the block title or label, and add: :before or :after, example below

.hp-form__field.hp-form__field--attachment-upload:after {content:'Your content here'; display: block; text-align: center; padding: 20px; color: green; font-size: 24px; font-weight: bolder; font-style: italic;}
3 Likes

Thank you so much - that should be enough in the short term, I hope there is also another way of doing this because the client would want columns and images here, but I’ll tell them we’ll figure it out post-launch and do this for now.

Would love to hear if someone has found another way to work with these forms.

Hi,

We plan to allow HTML in form/field descriptions in the next update (planned for this month), so the suggested code snippet should start working.

1 Like

By the way, there’s a no-code solution for this if you override the Add Listing template in HivePress/Templates, then you can add any custom content between the page title and form in the editor.

2 Likes

Hello there - if i am looking to create a template for the submit listing form instead of trying to modify the existing one, how might I do that and point the “Add Listing” button to the new submit listing form?

Hi,

You can change this button through the template part: hivepress/templates/listing/submit/listing-submit-link.php, please check this doc: How to override template parts - HivePress Help Center

But please note that if you try to replace the built-in form, there may be issues with the functionality (for example, Paid Listings, which is built into our multistep form, may not work).

​I hope this is helpful to you.

I need to add a small descriptional text besides the “price” number filed in the listing form? Is it not possible? I also need to do the same for “gallery(optional)”

Hi,

Please check the solutions in these topics:

Hello Andrii, thank you.

If I only want to edit the listing description page (so that they can keep to the same template across all listings submission), how might I do that? Currently it is a blank space with text field but I want to provide some guidance to the vendors so that all vendors will submit listings in the same manner

Hi,

Please check the solution in this topic: Add description to description field - #3

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.