Jump to content

Hello Worlds Tutorial not working


boltwood
 Share

Recommended Posts

I'm trying to work out how to use ProcessWire, but seem to have stumbled at the first. I am copying the steps in the 'Hello Worlds' tutorial here: https://processwire.com/docs/tutorials/hello-worlds/

Having done step 3, when I click view, I don't see the html from the template, I just see the same template as the home page with 'Default content'.

Link to comment
Share on other sites

Hello,
And Happy New Year!

The tutorial is probably using the direct output strategy.
Here are 3 different output strategies among other possible output strategies: https://processwire.com/docs/front-end/output/.

The Default profile (beginner edition) and the Classic site profile, for instance, are using the direct output strategy.
The official profiles can now be found here: https://processwire.com/download/site-profiles/.
You can see Working with site profiles at the end of the page.

The Blank site profile is now the only profile already bundled with all current versions of ProcessWire.
It uses the Markup regions output strategy.
And it has the following parameters in site/config.php:

/** @var Config $config */

/*** SITE CONFIG *************************************************************************/

// Let core API vars also be functions? So you can use $page or page(), for example.
$config->useFunctionsAPI = true;

// Use custom Page classes in /site/classes/ ? (i.e. template "home" => HomePage.php)
$config->usePageClasses = true;

// Use Markup Regions? (https://processwire.com/docs/front-end/output/markup-regions/)
$config->useMarkupRegions = true;

// Prepend this file in /site/templates/ to any rendered template files
$config->prependTemplateFile = '_init.php';

// Append this file in /site/templates/ to any rendered template files
$config->appendTemplateFile = '_main.php';

// Allow template files to be compiled for backwards compatibility?
$config->templateCompile = false;
Edited by Christophe
  • Like 1
Link to comment
Share on other sites

Hello @boltwood, and welcome to the ProcessWire forum!

About your question: it seems like the issue might be related to assigning the correct template to your page. Double-check that under Settings > Template in the page editor, the custom template you’ve created is properly assigned. This ensures that when you click “View,” ProcessWire will render your custom template instead of the default one with “Default content.”

Also, I highly recommend visiting PWTuts, a great resource with detailed tutorials about ProcessWire. It’s a fantastic place to find step-by-step guides that will help you better understand the CMS and unlock its full potential.

If you have any more questions, feel free to ask here. The community is always happy to help. Good luck, and enjoy your ProcessWire journey!

Link to comment
Share on other sites

Okay, so it's non-trivial to change the site profile and it looks like changing it to direct is not what I want anyway. In that case, can someone please point me to a tutorial that will walk me through the basics of setting up a site, like that 'hello worlds' tutorial, but using the default site profile?

I am an experienced WordPress developer looking for alternatives. This looks far superior, but seems impenetrable to learn how it works.

Link to comment
Share on other sites

Hi,

I first went to the tutorials section, where I first read the different output strategies. After reading the three different main strategies, I decided to go with my first steps using the Delayed Output strategy.

Then I started to add some pages and started to add simple things in the template files using the great Processwire API and some plain PHP. After I created my first prototype and got the go from my customer, I reimplemented the site with some more structure using PageClasses and Latte template engine for the views, while sticking to the delayed output strategy. Some times later I added Markup regions to my sites frontend login template to alter the header and footer region for guest users. 

My advice is to start simple using the Default profile (standard/intermediate edition) and work on some tutorials and try to alter or add functionality in small steps. 

Cheers

 

 

Edited by cwsoft
  • Like 1
Link to comment
Share on other sites

Hey @boltwood welcome to the forum!

Don't let that put you off! ProcessWire is a very powerful system and leaves it totally open what we as developers do with our data. Basically it has been a headless CMS since its beginning < 2010 just back then without anybody knowing what a headless CMS was and that this would become a hype more than a decade later...

As a consequence of being so open and flexible, the learning curve might feel steep at first, but that's because you're learning a system that gives you real development freedom rather than forcing you into predefined patterns. Stick with it - many of us have made the switch from other systems and never looked back!

Feel free to ask specific questions as you go along. This community is here to help you succeed and is usually very fast with helpful answers! 🚀

PS: @Jonathan Lahijani has made some videos comparing Wordpress and ProcessWire side by side, which might be helpful:

 

 

  • Like 2
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...