Jump to content

Integrating / adapting Processwire to existing website pages


Godfrey
 Share

Recommended Posts

Right now I have my processwire files in a folder called "processwire" on my remote server, as a child of the root folder. I'm wondering how I can begin to apply the CMS process to my existing website pages instead of the default, sample site. 

I'm guessing I can start by moving all those files in the "processwire" folder out into the root directory, but what should I do with the index.php file which the processwire folder came with? I'm also guessing I should replace my sites original index.php file and set the processwire one as the default. But then what should I do with the old index and the other pages as well? Where do the pages I already have go?

Basically I'm unsure how I should  go about "integrating" processwire into my already made pages. The Basic Website Tutorial ("http://wiki.processwire.com/index.php/Basic_Website_Tutorial") instructs me to clean out everything but leave the default site template  and a few fields, but it seems like I would be adapting my site to that template. Instead, I wish to adapt processwire to the pages which I've already made. 

Tell me if I'm getting the workflow/structure wrong: I feel like the workflow/structure requires me to make each of the pages that I already have --  or an identical part of each page --  a template, and then in processwire spawn off a duplicate of each page in my website using the "new" button and selecting those pages as as a template. I feel like I'm kind of working backwards relative to the workflow, or I'm getting the workflow/structure wrong in my head.

Thanks for any help in advance! ​

Update: I've tried changing the "home" page to a template that is basically my original site's homepage, but I get the error:

Can't save page 1: /: Selected homepage template cannot be used because it does not define access. 

I read that ryan said the home, admin, and 404 page are essential. However I don't want the home's template style. What is the php code I need to include in my own homepage to start using it as a template?  

I've tried copy and pasting this from the original home.php template: 


<?php 

/**
 * Home template
 *
 */

include("./head.inc"); 

echo $page->body;

include("./foot.inc"); 
 

But I'm still getting the same message. 

Link to comment
Share on other sites

I'm on mobile so this will be short. Empty the content of the root folder, and put the files from the processwire folder there. Keep your old files on a sub folder in the server or only in your computer. You only need them for copy/pasting.

For now. Leave everything as is, and copy the contents of your old index to home.php. The result might surprise you.

Link to comment
Share on other sites

I've tried copy and pasting this from the original home.php template: 

What you want to do instead is wipe out what's in the /site/templates/home.php and replace it with your own. The template files included with the default profile as just an example. You don't have to retain anything about them if you don't want to. Though I do recommend using the same name for your home template (home.php) just to keep it simple. 

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.
  • Similar Content

    • By Kiwi Chris
      I don't really have anything public to show, as nearly all the work is back-end, but I thought I'd post here anyway as it's a pretty good example of just how powerful Processwire can be.
      About a year ago, I inherited an incomplete Craft website made by a designer. Apart from the usual company information site, it was supposed to provide a customer portal for clients of a wine bottling company to make bookings for production runs.
      Data for stock levels of goods like bottles and labels was to come from an inventory management system Unleashed https://www.unleashedsoftware.com/
      Unleashed provides a REST API, so I had to integrate with that first by writing an API integration module, and then ended up using Processwire's core lazy cron module to periodically pull data from Unleashed using a custom module.
      The booking forms have a lot of conditional fields, eg if you are bottling a given wine variety, you should only be able to select labels that match that variety. All this conditional stuff was achieved with a lot of additions to ready.php.
      I also needed to be able to created a predefined set of pages when a new user is added if they have a 'client' role. Once again, more hooking in ready.php
      I've used the Admin Restrict Branch module so clients can only see their own records when they're logged in, but staff can see all records.
      Lister Pro provides the ability to search and view completed production runs.
      Part way through the project, as the client was happy with the way things were going, I was asked to add in logistics and dispatch which is provided by another company, which also runs Unleashed with a separate set of data, and with some clients who don't bottle wine, but will end up using the same portal, so using the roles and permissions inherent in Processwire, I set up production templates with separate roles to dispatch templates, so I could easily have clients assigned access to just the templates they need.
      Tracey Debugger got a thorough workout along the way, and the debugger console is an absolute killer tool for making quick changes to data when updating a live site to match changes from the dev site.
      At the start of this project, I'd used Processwire quite a bit, but never dived into module development or hooking, but I've now ended up with a reasonable idea how they work.
      @bernhard has produced some excellent tutorials which I found really helpful figuring out how to create modules, and other people like @Robin S have answered questions when I've got stuck. @ryan himself has been helpful when I've been trying to do things that push either the limits of my knowledge or Processwire or both 😋  .
      Could I have done this with other tools? Depends. Wordpress would have been as useless as using petrol to fight a fire, however something like ASP.Net COULD have done the job but would have probably made things a lot more complicated. In parallel, I've been working on building a REST API with ASP.Net for another client to integrate with an existing SQL Server database, and I've found that Visual Studio is inclined to break projects quite regularly, with dependencies getting messed up, or even whole configuration files getting corrupted when it has a hissy fit, so working with Processwire is a pleasure in comparison.
       
    • By prestoav
      Hi folks,
      I have a marketplace site built on PW which I'd like to tie to a subscription payment system for those selling. The user accounts currently use specific PW user accounts. I'm looking closely at PayWhirl to manage payments and subscriptions as it looks ideal for subscriptions. Their API seems to work well too from initial testing.
      I wondered if anyone else in this super forum had used PayWhirl and had any advice or tips & tricks?
      Thanks.
      https://app.paywhirl.com/
    • By thlinna
      I am running development server where I test and try the changes in fields and templates of ProcessWire. The php files are stored in git@bitbucket. 
      The part of managing changes and versions of php code itself via git is quite straightforward, as I presume we all know. However, I have not been able to come up with decent way of moving the changes in fields, templates, modules and settings from development to production other than repeating them, step-by-step, manually in production environment via the admin back-end.
      Perhaps there is more sophisticated way of transferring these changes?
    • By Bellis
      While the implementation here is specific to InGo product functionality, we thought we'd share it here generally as well because the approach and use of templates, fields and other aspects of the implementation might be useful to others trying to incorporate third-party widgets into your pages.  Enjoy!
      Integrating InGo Into a ProcessWire Site
       
       
    • By dotnetic
      I want to use the ProcessWire API and rendering of templates inside of a Shopware installation.
      So CMS pages should be served via ProcessWire (but with elements like a shopping cart coming from Shopware) and the products category page and the products detail page should be served from Shopware.
      How would I do that? I tried to include ProcessWire´s index.php into the shopware.php and even Shopware´s autoload.php but when I do this, I get a 500 Server Error.
      I use ProcessWire Version 3.0.24 (devns) and Shopware 5.2.1
      My shopware directory is located at the same level as ProcessWire´s index.php and site and wire directories.
      Now I enabled ProcessWire´s debug mode and I get the following error:
       
      Error: Uncaught Zend_Session_Exception: session has already been started by session.auto-start or session_start() in K:\xampp\htdocs\meinprojekt\relaunch2016\src\shopware\engine\Library\Zend\Session.php:473 Stack trace: #0 K:\xampp\htdocs\meinprojekt\relaunch2016\src\shopware\engine\Shopware\Components\DependencyInjection\Bridge\Session.php(77): Zend_Session::start(Array) #1 K:\xampp\htdocs\meinprojekt\relaunch2016\src\shopware\var\cache\production_201607041559\proxies\ShopwareProductionda39a3ee5e6b4b0d3255bfef95601890afd80709ProjectContainer.php(679): Shopware\Components\DependencyInjection\Bridge\Session->factory(Object(ShopwareProductionda39a3ee5e6b4b0d3255bfef95601890afd80709ProjectContainer)) #2 K:\xampp\htdocs\meinprojekt\relaunch2016\src\shopware\vendor\symfony\dependency-injection\Container.php(314): ShopwareProductionda39a3ee5e6b4b0d3255bfef95601890afd80709ProjectContainer->getSessionService() #3 K:\xampp\htdocs\meinprojekt\relaunch2016\src\shopwar (line 473 of K:\xampp\htdocs\jentschura\p-jentschura\relaunch2016\src\shopware\engine\Library\Zend\Session.php) This error message was shown because: site is in debug mode. ($config->debug = true; => /site/config.php). Error has been logged. So it seems, when I include ProcessWire, it wants to start a new session, but Shopware already started one. Any suggestions what to do?
×
×
  • Create New...