3.2.x 3.2.x SnippetsChanges to add collapse into your exts if author has not updated them

Snippets
Previous topicNext topic
User avatar

Topic Author
martin
Admin
Admin
Magic user status: Offline
Posts: 4783
Joined: Apr 6th, '14, 14:12
    Linux Chrome

Changes to add collapse into your exts if author has not updated them

Post by martin »

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.
Use this to install an ext on your board no more ftp or path making.
Path too install this ext is ext/boardtools/upload
Download is here Make it easy for us to solve your issues
User avatar

ivailo95
Users
Users
Magic user status: Offline
Posts: 783
Joined: Feb 2nd, '18, 11:04
    Windows 7 Opera

Re: Changes to add collapse into your exts if author has not updated them

Post by ivailo95 »

so if i want to collapse copyright i need to use this code? :question:
User avatar

dmzx
Founder
Founder
Magic user status: Offline
Posts: 5974
Joined: Jan 13th, '14, 20:45
    Windows 10 Chrome

Re: Changes to add collapse into your exts if author has not updated them

Post by dmzx »

ivailo95 wrote: Oct 10th, '19, 08:50 so if i want to collapse copyright i need to use this code? :question:
Hmm if also the listener has the correct code.

What you see above is the html and lang edits only....
binance.com ;) try it!
User avatar

Topic Author
martin
Admin
Admin
Magic user status: Offline
Posts: 4783
Joined: Apr 6th, '14, 14:12
    Linux Chrome

Re: Changes to add collapse into your exts if author has not updated them

Post by martin »

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),
			));
		}
	}
Previous topicNext topic