IWS include path

Posted on
Wed Jan 01, 2014 10:58 pm
huey offline
Posts: 20
Joined: Jun 22, 2013

IWS include path

So I'm building out an IWS plugin and I've built a few different templates with the same navigation in them so I wanted to see if I could pull the code out of the file and use an include.

So I took the code and put it into a file named "_navigation.html" but I can't figure out the path to use for the #include in my "index.html" template. I've tried the following but they all cause "internal server error":

#include "_navigation.html"
#include "templates/_navigation.html"
#include "<plugin_dir>/templates/_navigation.html"
#include "/<plugin_dir>/templates/_navigation.html"
#include "../<plugin_dir>/templates/_navigation.html"
and a bunch of other silly ones that I was pretty sure wouldn't work

I took a look at the "basicpage.html" template and it's using the exact functionality I want to setup but I can't get it to work.

Any thoughts on what the proper include path might be? I'm stumped and I hate having to jump around to multiple templates to make a simple navigation change.

Huey

Posted on
Thu Jan 02, 2014 4:33 pm
matt (support) offline
Site Admin
User avatar
Posts: 21418
Joined: Jan 27, 2003
Location: Texas

Re: IWS include path

Hi Huey,

So your _navigation.html file is in the same folder as your index.html template file? I would have expected your first #include example to work in that case.

Inside the IWS folder is a devhelpers folder. From the Terminal execute the indigowebstart script to have the Web server started from the command line. Next, try to access the URL that causes the Internal Server Error message and then check the Terminal for any error messages. Anything useful?

Image

Posted on
Thu Jan 02, 2014 6:04 pm
huey offline
Posts: 20
Joined: Jun 22, 2013

Re: IWS include path

Ah, yes sir!

Very helpful! Apparently I didn't go far enough, I was one directory off! It was looking for the template from the IndigoWebServer directory, so the following works:

Code: Select all
#include "plugins/<plugin_dir>/templates/_navigation.html"


Thanks again for the help!

Huey

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 6 guests