Answer the question
In order to leave comments, you need to log in
How to add select field to "Text block" module in opencart 2?
In the "Text block - HTML" module, you need to add the ability to select the title tag. The only thing that I have managed to display this field in the admin panel so far:
I did this by adding the following code to the module template file in the admin panel:
<div class="form-group">
<label class="col-sm-2 control-label" for="input-tag">Уровень заголовка</label>
<div class="col-sm-10">
<select name="tag" id="input-tag" class="form-control">
<option value="1" selected="selected">H1</option>
<option value="2">H2</option>
<option value="3">H3</option>
<option value="4">H4</option>
<option value="5">H5</option>
<option value="6">H6</option>
</select>
</div>
</div>
Answer the question
In order to leave comments, you need to log in
Try this code example:
if (isset($this->request->post['module_description'])) {
$data['module_description'] = $this->request->post['module_description'];
} elseif (!empty($module_info)) {
$data['module_description'] = $module_info['module_description'];
} else {
$data['module_description'] = '';
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question