Snippets
[phpBB Debug] PHP Warning : in file [ROOT]/vendor/twig/twig/src/Template.php on line 359 : Array to string conversion
Array
martin
Admin
Status:
Offline
User theme: Dark
Posts: 5123 Joined: Apr 6th, '14, 14:12
Post
by martin » Oct 4th, '19, 18:59
New code
html
Code: Select all
{% if FOO_IS_COLLAPSIBLE %}
<a href="{{ U_FOO_COLLAPSE_URL }}"
class="collapse-btn foo-collapse"
data-hidden="{{ S_FOO_HIDDEN }}"
data-ajax="phpbb_collapse"
data-overlay="true"
data-title-alt="{{ lang('FOO_COLLAPSE_TITLE', ((not S_FOO_HIDDEN) * 1)) }}"
title="{{ lang('FOO_COLLAPSE_TITLE', (S_FOO_HIDDEN * 1)) }}">
<i class="fa {% if S_FOO_HIDDEN %}fa-plus-square{% else %}fa-minus-square{% endif %}"></i>
</a>
{% endif %}
lang
Code: Select all
'FOO_COLLAPSE_TITLE' => [
0 => 'Hide foo',
1 => 'Show foo',
],
Foo being the name of the ext.
[phpBB Debug] PHP Warning : in file [ROOT]/vendor/twig/twig/src/Template.php on line 359 : Array to string conversion
Array
ivailo95
Users
Status:
Offline
User theme: Dark
Posts: 919 Joined: Feb 2nd, '18, 11:04
Post
by ivailo95 » Oct 10th, '19, 08:50
so if i want to collapse copyright i need to use this code?
Feed like a disease
And bring them to their knees
They'll pay for their deceit
[phpBB Debug] PHP Warning : in file [ROOT]/vendor/twig/twig/src/Template.php on line 359 : Array to string conversion
Array
dmzx
Founder
Status:
Offline
User theme: Dark
Posts: 6485 Joined: Jan 13th, '14, 20:45
Post
by dmzx » Oct 10th, '19, 08:59
ivailo95 wrote: Oct 10th, '19, 08:50
so if i want to collapse copyright i need to use this code?
Hmm if also the listener has the correct code.
What you see above is the html and lang edits only....
[phpBB Debug] PHP Warning : in file [ROOT]/vendor/twig/twig/src/Template.php on line 359 : Array to string conversion
Array
martin
Admin
Status:
Offline
User theme: Dark
Posts: 5123 Joined: Apr 6th, '14, 14:12
Post
by martin » Oct 10th, '19, 13:01
I'm using this to allow collapse off the index
Code: Select all
public function collapse($event)
{
if ($this->operator !== null)
{
$fid = 'foo'; // can be any unique string to identify your extension's collapsible element
$this->template->assign_vars(array(
'S_FOO_HIDDEN' => $this->operator->is_collapsed($fid),
'U_FOO_COLLAPSE_URL' => $this->operator->get_collapsible_link($fid),
));
}
}