Jump to content
shogun

Use Process Wire CMS on one page not entire website?

Recommended Posts

I love processwire. I was just wondering if a site is built in a certain way and we don't want the whole site to be driven by the processwire cms, can we use the ProcessWire cms for just a specific page on the website without creating templates or using the database for any other page? I know I can do this with Wordpress. Was just wondering if it was possible with Processwire and how that would work?

Share this post


Link to post
Share on other sites

Hello, 

Did not tried this. But i thing a scenario as following will work. 

Install PW under a subpage. Like www.domain.com/pw

Create your site as usual. In a php file where you want to use pw include the index of pw like;

include("pw/index.php");

This should be enough. (not sure if the namespace needed anycase) 

  • Like 1

Share this post


Link to post
Share on other sites

Hmm interesting. So you're thinking just install processwire in its own subdirectory?

Share this post


Link to post
Share on other sites
1 minute ago, shogun said:

Hmm interesting. So you're thinking just install processwire in its own subdirectory?

This should work fine! After the include, API variables like $pages should be available, letting your grab whatever content you are managing with PW.

Share this post


Link to post
Share on other sites
2 hours ago, shogun said:

I know I can do this with Wordpress.

How does wordpress do this?

You could also do a regular PW installation and add a folder "static" in the root directory. Then you could serve all files that are in this directory via custom htaccess rules (not an expert here 😄 ).

eg /static/foo.html would be served when example.com/foo is requested and /static/bar.html instead of example.com/bar

Share this post


Link to post
Share on other sites
2 hours ago, bernhard said:

How does wordpress do this?

You add wordpress to just the sub-directory. Not excited about wordpress anyway, but that's how you can do it.

Share this post


Link to post
Share on other sites

We could possibly be talking about different things here, but I don't see a difference between WordPress and ProcessWire in this regard: both can be installed into a subdirectory. There are a number of topics here regarding subdirectory installs 🙂

If you're looking into something more specific or custom, some sort of .htaccess trick (or including ProcessWire's index.php, essentially bootstrapping ProcessWire within plain PHP script) might be the way to go — but again, if we're just talking about running a ProcessWire site from a subdirectory, that shouldn't be necessary at all.

  • Like 1

Share this post


Link to post
Share on other sites

I run many sites in sub-directory in my development server. No problem at all.

Share this post


Link to post
Share on other sites

There is not only the possibility to use ProcessWire in a subdirectory and for one page only.
You can also use ProcessWire content in other pages, that are not being served by ProcessWire.

This process is called bootstrapping and others here already wrote about this.
You can find more information in "Including and bootstrapping ProcessWire"

  • Like 1

Share this post


Link to post
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

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...