cyclops12 wrote: ↑Sun Oct 13, 2019 6:42 pm
You cant search for multiple lines using vqmod/ocmod
You would have to search one line then use offset to go either side of searched line.
This may help you work out how to use vqmod
What are you trying to achieve ?
I'm trying to change this code in user_list.twig
Code: Select all
{% for user in users %}
<tr>
<td class="text-center">
{% if user.user_id in selected %}
<input type="checkbox" name="selected[]" value="{{ user.user_id }}" checked="checked" />
{% else %}
<input type="checkbox" name="selected[]" value="{{ user.user_id }}" />
{% endif %}
</td>
<td class="text-left">{{ user.username }}</td>
<td class="text-left">{{ user.status }}</td>
<td class="text-left">{{ user.date_added }}</td>
<td class="text-right"><a href="{{ user.edit }}" data-toggle="tooltip" title="{{ button_edit }}" class="btn btn-primary"><i class="fa fa-pencil"></i></a></td>
</tr>
{% endfor %}
to this
Code: Select all
{% for user in users %}
{% if user.username == "anyone" %} <-- I want to add this
<tr>
<td class="text-center">
{% if user.user_id in selected %}
<input type="checkbox" name="selected[]" value="{{ user.user_id }}" checked="checked" />
{% else %}
<input type="checkbox" name="selected[]" value="{{ user.user_id }}" />
{% endif %}
</td>
<td class="text-left">{{ user.username }}</td>
<td class="text-left">{{ user.status }}</td>
<td class="text-left">{{ user.date_added }}</td>
<td class="text-right"><a href="{{ user.edit }}" data-toggle="tooltip" title="{{ button_edit }}" class="btn btn-primary"><i class="fa fa-pencil"></i></a></td>
</tr>
{% endif %} <-- I want to add this
{% endfor %}
If VQMOD cannot search 2 lines, this mean I cannot find and add after this
Code: Select all
<td class="text-right"><a href="{{ user.edit }}" data-toggle="tooltip" title="{{ button_edit }}" class="btn btn-primary"><i class="fa fa-pencil"></i></a></td>
</tr>
But I can find and replace this
Code: Select all
<td class="text-right"><a href="{{ user.edit }}" data-toggle="tooltip" title="{{ button_edit }}" class="btn btn-primary"><i class="fa fa-pencil"></i></a></td></tr>
Thank you for the support