• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 2.0 How can we call js just one page?

Ovunc Dinc

Active member
I would like to ask How can I use <xf:if is="$template != 'page_view'">code in pages?

Do we normally use the following code to call a js on the page?
<xf:if is="$template != 'page_view'">
When I add this code to global js it looks in forum_view templates.
But I just want to see in the which page has the code, is there an error or the code is wrong?

For example

<xf:if is="$template != 'page_view'">
<script src="{{ js_url('homepage/bootstrap.min.js') }}"></script>
It could be works just in home page.

I've been trying but maybe someone knows how to do already add this it would be super awesome.

@Chris D
Last edited: