[RFC|Merged] Template tag to include JS files

These requests for comments/change have lead to an implemented feature that has been successfully merged into the 3.1/Ascraeus branch. Everything listed in this forum will be available in phpBB 3.1.
User avatar
hanakin
Front-End Dev Team Lead
Front-End Dev Team Lead
Posts: 911
Joined: Sat Dec 25, 2010 9:02 pm
Contact:

Re: [RFC] Template tag to include JS files

Post by hanakin »

I would think that is kind of a no brainer as HTML loads top down why would it change the order?
Donations welcome via Paypal Image

User avatar
Arty
Former Team Member
Posts: 985
Joined: Wed Mar 06, 2002 2:36 pm
Location: Mars
Contact:

Re: [RFC] Template tag to include JS files

Post by Arty »

Ticket: http://tracker.phpbb.com/browse/PHPBB3-10665
Patch: https://github.com/cyberalien/phpbb3/tree/ticket/10665

Patch is not available as pull request yet because it is based on another pull request.

Also moved to 3.1 forum.

User avatar
naderman
Consultant
Posts: 1727
Joined: Sun Jan 11, 2004 2:11 am
Location: Karlsruhe, Germany
Contact:

Re: [RFC|Merged] Template tag to include JS files

Post by naderman »

When you create wiki articles for transitioning to 3.1 please make sure they are linked to from http://wiki.phpbb.com/phpBB3.1 so they are easy to find.

User avatar
Arty
Former Team Member
Posts: 985
Joined: Wed Mar 06, 2002 2:36 pm
Location: Mars
Contact:

Re: [RFC|Merged] Template tag to include JS files

Post by Arty »

Done. Updated wiki with all major style changes.

igorw
Registered User
Posts: 500
Joined: Thu Jan 04, 2007 11:47 pm

Re: [RFC|Merged] Template tag to include JS files

Post by igorw »

This does not work for assets though, right?

User avatar
brunoais
Registered User
Posts: 964
Joined: Fri Dec 18, 2009 3:55 pm

Re: [RFC|Merged] Template tag to include JS files

Post by brunoais »

igorw wrote:This does not work for assets though, right?
How come?
It makes no real sense if it was made in such way that it doesn't... (I hope I understood it right)

igorw
Registered User
Posts: 500
Joined: Thu Jan 04, 2007 11:47 pm

Re: [RFC|Merged] Template tag to include JS files

Post by igorw »

Not as in not yet.

Oleg
Posts: 1150
Joined: Tue Feb 23, 2010 2:38 am
Contact:

Re: [RFC|Merged] Template tag to include JS files

Post by Oleg »

The test has this code:

Code: Select all

		// Prepare correct result
		$dir = dirname(__FILE__);
		$scripts = array(
			'<script src="' . $dir . '/templates/parent_and_child.html?assets_version=1"></script>',
			'<script src="' . $dir . '/parent_templates/parent_only.html?assets_version=1"></script>',
			'<script src="' . $dir . '/templates/child_only.html?assets_version=1"></script>'
		);

		// Run test
		$cache_file = $this->template->cachepath . 'includejs.html.php';
		$this->run_template('includejs.html', array('PARENT' => 'parent_only.html'), array(), array(), implode('', $scripts), $cache_file);
Why are filesystem paths ending up in script tags?

Also please note the following additional tickets filed:

http://tracker.phpbb.com/browse/PHPBB3-10800
http://tracker.phpbb.com/browse/PHPBB3-10799

User avatar
Arty
Former Team Member
Posts: 985
Joined: Wed Mar 06, 2002 2:36 pm
Location: Mars
Contact:

Re: [RFC|Merged] Template tag to include JS files

Post by Arty »

Oleg wrote:Why are filesystem paths ending up in script tags?
Because of this: https://github.com/phpbb/phpbb3/blob/de ... se.php#L66
and this: https://github.com/phpbb/phpbb3/blob/de ... ee.php#L21

Oleg
Posts: 1150
Joined: Tue Feb 23, 2010 2:38 am
Contact:

Re: [RFC|Merged] Template tag to include JS files

Post by Oleg »

That needs to be changed/fixed then? Is there a ticket filed to fix it? Was this discussed anywhere?

I stopped blaming that code when I got to https://github.com/phpbb/phpbb3/commit/ ... c89a53d0c5.

Post Reply