flydev

Bootstrap 4 Minimal site profile

Recommended Posts

Bootstrap-4 Minimal site profile for ProcessWire

This profile is based on the "minimal site profile (intermediate edition)" and bundled with Boostrap v4.0.0-alpha.2.

The precompiled version can be downloaded at github.

 

  Features

  • Bootstrap SASS
  • Font-Awesome SASS
  • MeanMenu
  • Render / helper functions for :
    • Simple ul navigation
    • Bootstrap Multi-level navbar
    • MeanMenu Responsive menu for mobile device
    • Bootstrap Carousel
    • Bootstrap Cards

  Dependencies

  • jQuery
  • Tether (Tooltips and Popovers)

  Prequisites

 You'll want to install the following on your system before proceeding:

How To Install

  1. Download the zip file at Github or clone directly the repo with git clone and skip the step 2.
  2. Extract the folder site-pwbs4-master into a fresh ProcessWire installation root folder.
  3. During the installation of ProcessWire, choose the profile "ProcessWire Bootstrap 4 profile".

  After installation

The last step is to install all assets and dependencies with Bower.

  • Open a terminal in site/templates and execute the following command-line: bower install

  References

  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

Capture.PNGCapture-responsive.PNG

  • Like 11

Share this post


Link to post
Share on other sites

It is currently only compatible with the devns branch.  Give me some minutes to make backward compatibilty :-X .

It is now compatible with ProcessWire-2.7.

  • Like 4

Share this post


Link to post
Share on other sites

Thanks for doing this and will start working with this one this week-end. Really excited about it if this one can release me from using Pocketgrid all the time. Did you know that there is a thread about templates for Processwire ?

https://processwire.com/talk/topic/12892-processwire-marketplace/

This bootstrap profile could be a very good one to start with.

  • Like 2

Share this post


Link to post
Share on other sites

@pwired :   I will send an email to @kongondo about processwireshop.pw! Thanks for suggesting that.

----

A small trick to make the navbar/dropdown working on mouseover instead of click event:

In js/script.js add :

$(document).ready(function(){
    $('ul.nav li.dropdown').hover(function() {
        $(this).find('.dropdown-menu').first().stop(true, true).delay(200).fadeIn(200);
    }, function() {
        $(this).find('.dropdown-menu').first().stop(true, true).delay(200).fadeOut(200);
    });
});
  • Like 2

Share this post


Link to post
Share on other sites

Is there anything that has to be compiled before using this template ? For example until now I only use plane css and not sass also never used "bower-install" Maybe there is a pre-compiled version ?

Share this post


Link to post
Share on other sites

In the current state of the profile, Bootstrap is already precompiled in css/styles.css; You can also find in the folder css a file called main.css where you can override all values and use it as pure css - without the need of using sass and associated tools - but at this point  you still need Bower.

Bower is used to manage assets like font-awesome and a dependency like tether in our case. With this tool we can manage libs easily and we can avoid repeating tasks. It is really easy to install and do not require any knowledge for the task we accomplish here. If you want to get started with, check the following instructions :

  1. goto https://nodejs.org/ ,  download / install NodeJS
  2. install Git (if you're on Windows, be sure to check Run Git from command-prompt)
  3. open a terminal and type npm install -g bower

done.

You can now execute the bower install command-line.

 

Anyway, if its really required, I can make tonight a profile with precompiled files so you can test it this week-end :). Just let me know.

 

  • Like 1

Share this post


Link to post
Share on other sites


Hi @flydev,
Thanks for stepping in on this. I am not yet familiar with node and git and use processwire with plane php, api, css and pocketgrid. So Yes I would appreciate it for making a profile with precompiled files to enable me start using your template. Thanks in advance.

Share this post


Link to post
Share on other sites

I have setup an online test server and uploaded/installed the pre-compiled profile (template) inside a processwire 2.7.2 setup. It looks everything is working well and also nicely responsive. I find this great. I am going to have a look in the back and front end and see how I can change it into some website and learn bootstrap and tether. You can see the online setup here: http://dev9.pe.hu

 

  • Like 3

Share this post


Link to post
Share on other sites

Thanks you for trying this profile.

I just pushed an update to the css for the responsive menu. Just remove the following code in main.css.

Spoiler

/* meanmenu adjustment (see body: line-height) */
.mean-nav ul li {
    line-height: 24px;
}
.mean-container .mean-nav ul li a.mean-expand {
    height: 24px;
}

 

 

  • Like 3

Share this post


Link to post
Share on other sites

@flydev Thanks a lot for putting this together. I was only waiting for BS4 to reach beta state before I will update my site-pwbs profile. Now I don't need to spend the time on it myself, which is great :)

@pwired @cstevensjr

I can only recommend to preprocess yourself and encourage you to look into node, compass, bower etc. It really is worth the effort and gives you so much more flexibility. With the precompiled version of this profile, you need to override a lot of stuff in your own CSS and this will bloat your code.

  • Like 3

Share this post


Link to post
Share on other sites
9 minutes ago, gebeer said:v

@pwired @cstevensjr

I can only recommend to preprocess yourself and encourage you to look into node, compass, bower etc. It really is worth the effort and gives you so much more flexibility. With the precompiled version of this profile, you need to override a lot of stuff in your own CSS and this will bloat your code.

While I agree with you that one needs to expand their horizons, we also need to understand that not everyone uses the latest technology.  We should strive to make these profiles accessible to everyone, no matter their knowledge/skill level.

My push will always be about accessibility to technology by all.  I firmly believe that's how things will spread.

  • Like 3

Share this post


Link to post
Share on other sites

@cstevensjr I partly agree with you. And again thanks to @flydev for providing the precompiled version. But in a way this defeats the purpose of a sass based site profile.

Share this post


Link to post
Share on other sites
Just now, gebeer said:

@cstevensjr I partly agree with you. And again thanks to @flydev for providing the precompiled version. But in a way this defeats the purpose of a sass based site profile.

You seem to be stuck on sass and I am talking about having PW profiles that a basic beginner (who may or may not know anything about sass) can utilize.  We are coming together from two totally different planes.  Yes, I believe it was fantastic and a good trend that @flydev augmented the profiles by including the precompiled version.  It should be a great learning tool for all.

  • Like 4

Share this post


Link to post
Share on other sites

@cstevensjr Got your point and totally agree with what you're saying. I didn't mean to force anybody into using preprocessors. Just wanted to encourage people to start looking into it because it really can make live easier...

  • Like 4

Share this post


Link to post
Share on other sites

Thank you Flydev. I've spent several days looking for proper solution to the PW BS3 dropdown menu issue. And then today I've found this. This profile will be my based from now onward. So far it works good, looking forward to build something great out of this. Once again TQVM.   

  • Like 4

Share this post


Link to post
Share on other sites

Hi @kibod ,  glad you like it and choose it as project starter.

And yes in this profile you can have the first parent as menu, clickable.

  • Like 3

Share this post


Link to post
Share on other sites

Hi @flydev, I plan to use your profile for my next project. I've installed it and it works fine. The carousel however just has only images and no corresponding heading and links, for that would really make the carousel experience complete. Is there a way to add heading and link to the images? Thanks.

Share this post


Link to post
Share on other sites

Hi @MaryMatlow

15 hours ago, MaryMatlow said:

I've installed it and it works fine.

Can you please tell me the version of ProcessWire ?

 

15 hours ago, MaryMatlow said:

Is there a way to add heading and link to the images?

Yes, you have to copy and/or modify the function bsRenderCarousel();

For instance, you could use a repeater to pass datas to the function. Let's say we create a repeater with the three following fields: image_carousel, heading, heading_description

Capture.PNG

and insert the repeater with the name 'carousel' in the home template.

 

In _func.php, add this function :

Spoiler

function bsRenderCarouselFromArray(array $datas) {

    $cnt = count($datas['images']);
    $id = $datas['images'][0]->get('page').$datas['images'][0]->get('field')->id;
    $out  = "<div id='carousel-{$id}' class='carousel slide' data-ride='carousel'>
                <ol class='carousel-indicators hidden-sm-down'>";
    $i = 0;
    foreach($datas as $image) {
        $class = ($i == 0) ? "active" : "";
        $out .= "<li data-target='#carousel-{$id}' data-slide-to='{$i}' class='{$class}'></li>";
        $i++;
        if($i >= $cnt) break;
    }
    $out .= "</ol>
             <div class='carousel-inner' role='listbox'>";
    $i = 0;

    foreach($datas as $data) {
        $class = ($i == 0) ? "active" : "";
        $out .= "<div class='carousel-item $class'>
                <img src='{$datas['images'][$i]->url}' alt='{$datas['images'][$i]->description}' height='{$datas['images'][$i]->height}' width='{$datas['images'][$i]->width}'>
                <div class='carousel-caption'>
                    <h3>{$datas['headings'][$i]}</h3>
                    <p>{$datas['description'][$i]}</p>
                </div>
             </div>";
        $i++;
        if($i >= $cnt) break;
    }
    $out .= "</div>";
    $out .= "<a class='left carousel-control' href='#carousel-{$id}' role='button' data-slide='prev'>
                <span class='icon-prev' aria-hidden='true'></span>
                <span class='sr-only'>Previous</span>
             </a>
             <a class='right carousel-control' href='#carousel-{$id}' role='button' data-slide='next'>
                <span class='icon-next fa fa-chevron-right ' aria-hidden='true'></span>
                <span class='sr-only'>Next</span>
            </a>
        </div>";

    return $out;
}

a bit hacky but eh...

 

Then in the home template, make the array and call the new function with the new array as parameter :

// render the carousel
//$content .= bsRenderCarousel($page->images);
foreach ($page->carousel as $key => $value) {
    $datas['images'][] = $value->carousel_image;
    $datas['headings'][] = $value->heading;
    $datas['description'][] = $value->heading_description;
}

$content .= bsRenderCarouselFromArray($datas);

 

Result:

pwbs4.gif

 

 

  • Like 4

Share this post


Link to post
Share on other sites

Hi @flydev, It works like a charm :-). Thank you, thank you. The only other thing i needed was a link/button to link the slide to another page/post. I'll try to do that myself first. If I get stuck will ask for your help. Thank you very much.

  • Like 1

Share this post


Link to post
Share on other sites

Hi all!

I have ProcessWire 3.0.42 installed with a lot of content. How can I install this bootstrap profile over it?

Cheers

Fred

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 rafaoski
      This profile can be used as a business card or very simple blog.
      Requires the latest version processwire 3.0.101 !!!
      Milligram Site Profile For Processwire 3x with include functions like:
      MarkupRegions
      FunctionsAPI
      wireIncludeFile | wireRenderFile
      Essentially, this structure uses minimalist CSS framework Milligram and the Flexbox Grid System Gridlex
       
      Live Example
      CAN DOWNLOAD FROM THIS LINK ( Basic Version and simple Blog Version )
      https://github.com/rafaoski/site-milligram
      https://github.com/rafaoski/site-milligram-blog
      Screenshot:

      If you want to use Laravel Mix you must first ensure that Node.js and NPM are installed on your machine.
      Basic example to Debian and Ubuntu based Linux distributions:
      Node.js
      curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash - sudo apt-get install -y nodejs
      See more installation options LINK
      npm is installed with Node.js just check in linux terminal like below:
      node -v
      npm -v
      Set BrowserSync inside folder /templates/webpack.mix.js and change your dev url
      proxy: 'http://localhost/mix/', to your installation processwire folder like:
      proxy: 'http://localhost/your-processwire-installation-folder/',
      Next install npm packages in your templates folder with command npm install
      Now, boot up the dev server npm run watch, and you're all set go!
      On completion, use the command npm run production to build styles and scripts in the dist folder
      Simple Usage ( Basic Command )
      Run npm install Watch npm run watch Build npm run production All files to Webpack build steps is inside file ( webpack.mix.js )
      Folder With all SCSS files is inside templates/src/scss
      All build styles and scripts is inside the ( dist ) folder
      References:
      Milligram
      Gridlex
      Laravel Mix
      Feather Icons
      Web Font Loader
      Verlok Lazy Load
      Cookie Consent
      Particles.js
       
       
       
       
    • By Marcel
      Hey, 
      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.
      Marcel
    • By karian
      Hi, based on the work of @microcipcip and @gebeer  (see their posts here and here), I put together a Processwire + React boilerplate (profile).
      Github repo: https://github.com/lapico/process-react

      Cheers,
      K
       
    • By webhoes
      Hello,
      I am working of a site for a sport organisation.
      All affiliated gyms can edit their profile. I have used the advaced mode so that if you create a new page under location the gym can login and edit their profile.
      i also want that they can add instructors as child of their profile and also are able to edit those instructors.
      I can not get passed the able to edit all subpaged or none.
      How should this be done? Or is this not possible?