[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
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 »

callumacrae wrote:EDIT: Ignore that, you're using INCLDEJS. Why are you using INCLUDEJS? XD
To enable template inheritance for it. Until RFC for T_STYLE_PATH (inheritance for all components) will be implemented, INCLUDEJS is the only way to allow inheritance for javascript files.

User avatar
callumacrae
Former Team Member
Posts: 1046
Joined: Tue Apr 27, 2010 9:37 am
Location: England
Contact:

Re: [RFC] Template tag to include JS files

Post by callumacrae »

Aha, I see. Fair enough.
Made by developers, for developers!
My blog

User avatar
Dragosvr92
Registered User
Posts: 624
Joined: Tue May 31, 2011 12:08 pm
Location: Romania
Contact:

Re: [RFC] Template tag to include JS files

Post by Dragosvr92 »

Will phpbb variables be parsed if in javascript files?

Like, will {T_STYLE_PATH} be parsed in a js file same as it gets parsed into a html file?
I needed to do this on the Lightbox MOD and it didnt work.
Previous user: TheKiller
Avatar on Memberlist 1.0.3

User avatar
callumacrae
Former Team Member
Posts: 1046
Joined: Tue Apr 27, 2010 9:37 am
Location: England
Contact:

Re: [RFC] Template tag to include JS files

Post by callumacrae »

TheKiller wrote:Will phpbb variables be parsed if in javascript files?

Like, will {T_STYLE_PATH} be parsed in a js file same as it gets parsed into a html file?
I needed to do this on the Lightbox MOD and it didnt work.
No.
Made by developers, for developers!
My blog

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 »

Wiki article that includes this change: http://wiki.phpbb.com/New_Template_Commands_in_3.1

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

Re: [RFC] Template tag to include JS files

Post by brunoais »

Arty wrote:Wiki article that includes this change: http://wiki.phpbb.com/New_Template_Commands_in_3.1
Please confirm:
Does it keep the order of the INCLUDEJS tags? If it does that's something important to specify in the wiki.

An example would also be nice. Because I still don't know >90% how it works, it's better for you to write that example.
Anyway:
Great feature, dude!

User avatar
callumacrae
Former Team Member
Posts: 1046
Joined: Tue Apr 27, 2010 9:37 am
Location: England
Contact:

Re: [RFC] Template tag to include JS files

Post by callumacrae »

brunoais wrote:
Arty wrote:Wiki article that includes this change: http://wiki.phpbb.com/New_Template_Commands_in_3.1
Please confirm:
Does it keep the order of the INCLUDEJS tags? If it does that's something important to specify in the wiki.

An example would also be nice. Because I still don't know >90% how it works, it's better for you to write that example.
Anyway:
Great feature, dude!
Yes, it will keep the order.

What don't you get about the example on the wiki article? You call the INCLUDEJS function, it inserts the script after the jQuery tag…
Made by developers, for developers!
My blog

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 »

I've added example to wiki to make things clearer.

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

Re: [RFC] Template tag to include JS files

Post by brunoais »

Your changes do not answer my question.
You state that all script tags are placed after jQuery's script tag. That's ok and was already there.
Another thing you do not tell in the wiki:
Do tag order maintains?
In the code:

Code: Select all

<!-- overall_header.html -->
	header stuff here
<!-- end of overall_header.html -->
<!-- custom template -->
	<!-- INCLUDEJS template/custom1.js -->
	Some content
	<!-- INCLUDEJS template/custom2.js -->
<!-- end of custom template -->
<!-- overall_footer.html -->
	<!-- INCLUDEJS template/custom3.js -->
	footer code here
	jQuery is included here
	</body>
</html>
<!-- end of overall_footer.html -->
Can it become?

Code: Select all

header stuff here
some content
footer code here
jQuery is included here
<script src="./styles/prosilver/template/custom3.js"></script>
<script src="./styles/prosilver/template/custom1.js"></script>
<script src="./styles/prosilver/template/custom2.js"></script>
</body>
</html>
Does the tag order in the files persist? You do not specify that anywhere in that wiki article.

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 »

Yes, that's exactly what it will become

Post Reply