Jump to content

How to create template file for Small Project walkthrough


AnshulK
 Share

Recommended Posts

I am currently working through the "Small Project Walkthrough (Planets)" Tutorial.

I installed ProcessWire through BitNami and have got the base site up and running.

However, I am unable to create a new template file. I don't know where to create it and where the file should be placed through BitNami.

I would appreciate assistance on this topic!

https://processwire.com/docs/tutorials/hello-worlds/

Link to comment
Share on other sites

In that tutorial - look at step 8.

The Template File
Step 8 – Outputting dynamic data in your template file
While still in the page editor from step 7, click the "View" link to see your page. Note that it still says "Happy planet" for type (rather than "Terrestrial planet") and "Millions of years" rather than "4.54 billion years". That's because the page is still being rendered with just the static data in it. We need to update the template file so that it recognizes the fields we added and outputs the values of those fields.

Edit /site/templates/planet.php and replace the static text in there with tags like this, replacing field_name with the name of the field:

 

Link to comment
Share on other sites

4 minutes ago, wbmnfktr said:

In that tutorial - look at step 8.


The Template File
Step 8 – Outputting dynamic data in your template file
While still in the page editor from step 7, click the "View" link to see your page. Note that it still says "Happy planet" for type (rather than "Terrestrial planet") and "Millions of years" rather than "4.54 billion years". That's because the page is still being rendered with just the static data in it. We need to update the template file so that it recognizes the fields we added and outputs the values of those fields.

Edit /site/templates/planet.php and replace the static text in there with tags like this, replacing field_name with the name of the field:

 

I am stuck on Step 1 because I don't know where and how to do this step:

"Create a new file called: /site/templates/planet.php, and copy+paste the following HTML into that file:"

Link to comment
Share on other sites

Ok... well... that's kind of easy as well - or it should be at least for you.

As you used Bitnami there should be a dedicated Bitname folder somewhere now.

C:\Bitnami
User>Bitnami

Something like that I guess - I'm not sure as I don't use Bitnami. But... within that default Bitnami project (ProcessWire) folder you will find a folder called site and within that a folder called templates.

So... it might be
C:\Bitnami\Processwire\site\templates

 

  • Like 2
Link to comment
Share on other sites

  • 1 year later...

wbmnfktr is right that there is a Bitnami folder. By default on macOS, you’ll find it hidden at ~/.bitnami — though I can’t tell you about other systems. However, you won’t find your standard ProcessWire folder there. Instead, you’ll need to do the following:

1. In the Bitnami ProcessWire app, go to the Volumes tab and tell “/opt/bitnami/” volume to mount (see attached screenshot).

2. You should now find an NFS volume mounted in your OS (by default named with your Bitnami ProcessWire’s server address). There’s useful information in the /bitnami/README.txt file on that volume.

3. You’ll then want to head on that volume to /bitnami/apps/processwire/htdocs/site/ — this is where you’ll find folders for your site’s assets, modules, and templates. Despite the reference to “exported” in the Bitnami window, it’s “live”: creating a new template file in the templates folder will make it available to your running ProcessWire server.

Screen Shot 2021-03-27 at 14.45.03.png

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...