processwire / processwire-issues

ProcessWire issue reports.
45 stars 2 forks source link

InputfieldForm: description is rendered with item_head markup instead of item_description #1957

Open hiboudev opened 3 months ago

hiboudev commented 3 months ago

Short description of the issue

Contrary to other fields, on InputfieldForm description is rendered with item_head markup instead of item_description. So the description is displayed as a big <h2> heading, instead of a paragraph.

Expected behavior

Use item_description.

Actual behavior

Use item_head.

Optional: Suggestion for a possible fix

In InputfieldForm, replace this line: if($description) $description = str_replace('{out}', $this->entityEncode($description), $markup['item_head']); by this one: if($description) $description = str_replace('{out}', $this->entityEncode($description), $markup['item_description']);

Steps to reproduce the issue

$inputfieldForm->description("my description");

Setup/Environment

ryancramerdesign commented 3 months ago

Since a form is the root parent of all the Inputfields within it the description for the form is supposed to be a headline. The same goes for Fieldset Tabs. This is what item_head is for, and I think those are the only two that use item_head. If you wanted to use a paragraph instead, you could set your own markup for item_head by using InputfieldWrapper::setMarkup().