Jump to content

Using Bootstrap with Processwire

Recommended Posts

Hello all,

Just starting out with ProcessWire and am wondering the best method to get set up to use bootstrap with it. I did already install ProcessWIre and everything is working but was not sure if there was a simple method to include bootstrap.

Thank You.

Share this post

Link to post
Share on other sites

Hi tom0360,

@flydev has created and shared a siteprofile for bootstrap. If this is something for you, you may use it.

But you are totally free in how you define, organize and use your markup, and with wich profile you starts.

  • Like 1

Share this post

Link to post
Share on other sites

On the one hand, that's great. On the other, it's for an early alpha release of Bootstrap 4, which I can attest is still buggy. It  is NOT ready for production. I've looked for a good ProcessWire starter siteprofile for the latest stable release of Bootstrap but haven't found anything ideal.

Share this post

Link to post
Share on other sites

Hi tom0360,

Welcome to the forums!

ProcessWire does not care what you use for your front-end. I have been using Bootstrap for a while. It's setup is just as they explain in their docs.

If you are using 3.3.7 then extract the js, fonts, and css folders to your /site/templates folder. The same with 4.0.0 alpha, except they don't use the fonts folder any longer.

Again, welcome. Feel free to ask any questions. There are a lot of good people here that will help.

  • Like 3

Share this post

Link to post
Share on other sites

Yeah, I get that. I've started from scratch, and I can get all the basic Bootstrap installation working fine, but I'm looking to take it to the next level. I'm not a programmer, but with a working example or a halfway decent tutorial I can usually figure things out. My main beef is that, in the case of Bootstrap vis-a-vis ProcessWire, there's a real dearth of pre-existing modules or examples to dynamically generate, say, BS modals or any number of that framework's components (accordions, nav-tabs, etc.). It's pretty easy to hard-code any of those as a one-off, but I'm looking to build templates with repeaters and I'm trying to figure out how to build the tools in PW to make it easy to wire all this up with triggers that match element IDs and whatnot. My chief frustration is that, somewhere between my skill level and the existing how-tos I've referenced, there is a gap that implicitly assumes I already know how to do a lot of this. It's like the 2-step "how to draw an owl" meme (1. draw some circles; 2. now draw the rest of the owl) -- I'm looking to figure out steps 7 and 8 in a 10-step process, if that makes sense.  Anyway, thanks for listening (or reading).

Share this post

Link to post
Share on other sites

I recommend this one, have you already seen it?
    •   http://blog.mauriziobonani.com/processwire-basic-website-workflow-part-1/
    •   http://blog.mauriziobonani.com/processwire-basic-website-workflow-part-2/
    •   http://blog.mauriziobonani.com/processwire-basic-website-workflow-part-3/
    •   http://blog.mauriziobonani.com/processwire-basic-website-workflow-part-4/

It is without any particular css examples, but you know yours. Also, it uses Twig but for practicing purposes it should not matter too much.

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.

  • Similar Content

    • By flydev 👊🏻
      Bootstrap-4 Minimal site profile for ProcessWire
      This profile is based on the "minimal site profile (intermediate edition)" and bundled with Boostrap v4.4.1
      Bootstrap SASS Font-Awesome SASS Render / helper functions for : Simple ul navigation Bootstrap Multi-level navbar Bootstrap Carousel Bootstrap Cards Bootstrap Jumbotron Boostrap Accordion Assets minification, files bundle   Dependencies
      jQuery Popper.js Bootstrap FontAwesome   Prequisites
       You'll want to install the following on your system before proceeding:
      Yarn / NPM How To Install
      Download the zip file at Github or clone directly the repo with git clone and skip the step 2. Extract the folder site-pwbs4-master into a fresh ProcessWire installation root folder. During the installation of ProcessWire, choose the profile "ProcessWire Bootstrap 4 profile".   After installation
      You can find the development file (CSS/SCSS/JS) in site/assets/dev/src
      The profile can be used as is only with $config->debug set to false. To use it in debug mode, you are required to install the dependencies with the package manager.
      Open a terminal in site/assets/dev and execute the following command-line: yarn Available commands :
      Rebuild, minify and bundle assets for release : yarn build   References
      Bootstrap v4 documentation ProcessWire documentation ProcessWire Forum: bootstrap tag ProcessWire Forum: bootstrap related posts   Credits
      The ProcessWire staff Inspiration from @gebeer and his Bootstrap 3 profile post Members who contributed in various post about Bootstrap navigation and code (see code-source for refs). Screenshots

    • By Marcel
      I am very new to processwire and bootstrap. I have a field (text area) and there I want to be able to insert an image which is responsive. I tryed it with Source but in the end the page doesn't seem to like it when I insert in Source the following code
      <img src="<?php echo $homepage->content_img->url; ?>" class="img-fluid" alt="Responsive image"> What can I do to make it possible to insert reponsive images in a text area?
      Thank you in advance.
    • By modifiedcontent
      I have one central website, with membership registration and content etc., and then several related websites with their own URL/domains, each on Processwire, all on the same server.
      I would like to access the database of the central website from the sister websites. How would I do that?
      You can't bootstrap one PW installation into another. You can include template parts from one in the other by just using the server path, but whatever you try to get/post just comes/goes to the database of the site you are on.
      Could you switch databases by including the config.php from another PW installation somewhere?
      What is the correct, secure way to do this?
    • By androbey
      Hello again! 

      Unfortunately I came across another problem. 

      I have a "regular" ProcessWire setup and want to create a separate php script. That script should be executed by a cron job and is bootstrapped with my PW setup. Main goal is to send mails which are stored in a email field. 
      My problem: I want to access a specific field from a template where only specific users have access to. Right now, the cron job is executed as "guest", of course. 

      How can I bypass this restriction, so that I have access to that specific field (it's only one email field)? 

      Does it make sense to set current user via api? 

      Hope you can help me out there.

    • By SwimToWin
      I am using ProcessWire as the back-end to manage contents on multiple sites (I call them "sub-domains"). I use ProcessWire as an editing system and database only. The ProcessWire templating system is not in use. I want to use ProcessWire's API and in particular the Include & Bootstrap method to output contents -- pretty much in the same way you do, if contents is stored in a MySQL database and output in PHP files that use PDO to load data.
      The issue is that I cannot get ProcessWire to fully work on each of the "sub-domains".
      https://processwire.com/api/include/ says:
      > You can do anything with ProcessWire's API that you can do from a template,
      > so all of this still applies, as does everything in the developer API.
      How can I get access to variables such as $input when using Include & Bootstrap?
      I tried these:
      $wire->pages->get("/foo/bar/"); echo "Segment1: " . $wire->input->urlSegment1; # Returns null $wire->pages->get("/foo/bar/"); echo "Segment1: " . $wire->input()->urlSegment1; # Internal Server Error $p = $wire->pages->get("/foo/bar/"); echo "Segment1: " . $p->input->urlSegment1; # Returns null $p = $wire->pages->get("/foo/bar/"); echo "Segment1: " . $p->input()->urlSegment1; # Returns null @ryan Can the API Variables documentation be updated with a section / an example that explain how to use "Include & Bootstrap" for each variable (since this is a really strong feature in ProcessWire)?
      $page $pages - Example: $homepage = $wire->pages->get("/"); $input $sanitizer $session $fields $user $log $templates $config
  • Create New...