Search format
Such blocks contain a form with search string and a button for submitting data to the search result page.
Minimal requirements for this block to be operational:
- Available tag
<form>
, query input string<input>
, data submit button. - Available attribute for selector
<form>
.'attrs' => [ '.landing-block-node-form' => [ 'name' => 'Search result page', 'attribute' => 'action', 'type' => 'url', 'allowedTypes' => [ 'landing', ], 'disableCustomURL' => true, 'disallowType' => true, 'disableBlocks' => true ] ]
- Optionally, subtype and subtype_params can be added to the blocks description. In this case the attribute Search result page (see para. 2) will include the landing page when a block is added (for user convenience):
'block' => [ 'name' => Loc::getMessage('LANDING_BLOCK_59_2-NAME'), 'section' => array('sidebar', 'other'), 'subtype' => 'search', 'subtype_params' => [ 'type' => 'form', 'resultPage' => 'result' ] ],
Where result is ID for search results page template. When such page is found at the site, it is be added automatically.
© «Bitrix24», 2001-2024