Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

Adding Bootstrap to Shopping Cart in Perl ?

by glennpm (Novice)
on Jan 04, 2016 at 20:41 UTC ( #1151873=perlquestion: print w/replies, xml ) Need Help??

glennpm has asked for the wisdom of the Perl Monks concerning the following question:

I redid my web site using a Bootstrap based template and have done some basic Bootstrap changes to my web site but my site is an e-commerce site that uses a shopping cart written in Perl.

All I want to do is change the tables, buttons, input text boxes and such in the <form> code so that the shopping cart look good on mobile devices. I know nothing about Perl but I'm a programmer by trade using C#/Visual Studio.

What is the easiest way to call Bootstrap classes/functions inside .PL scripts?

Thanks, Glenn
  • Comment on Adding Bootstrap to Shopping Cart in Perl ?

Replies are listed 'Best First'.
Re: Adding Bootstrap to Shopping Cart in Perl ?
by hotchiwawa (Scribe) on Jan 04, 2016 at 21:06 UTC
    <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1 +"> <!-- The above 3 meta tags *must* come first in the head; any othe +r head content must come *after* these tags --> <title>Your title</title> <!-- Bootstrap --> <link href="css/bootstrap.min.css" rel="stylesheet"> </head> <body> <h1>Hello, world!</h1> <!-- jQuery (necessary for Bootstrap's JavaScript plugins) --> <script src=" +query.min.js"></script> <!-- Include all compiled plugins (below), or include individual f +iles as needed --> <script src="js/bootstrap.min.js"></script> </body> </html>
    Import the files in local and change the paths ;)

    After that you can include this code in a .cgi script with print.


    #!/usr/bin/perl print "Content-type:text/html\r\n\r\n"; print '<html>'; print '<head>'; print '<title>Hello Word - First CGI Program</title>'; print '</head>'; print '<body>'; print '<h2>Hello Word! This is my first CGI program</h2>'; print '</body>'; print '</html>'; 1;
    Now put some jquery instructions if needed, server side codes (perl), custom some boostrap style definition (but not always necessary), data, include others jquery objects...
      Thanks hotchiwawa, but how do you import the Bootstrap files, like <script src="js/bootstrap.min.js"></script> in a Perl .PL script?
        Yep, the url was not good in the page of bootstrap!!

        Check the CGI script above and add some print like this:
        print "<script src=''> +</script>";
      All interactions is via jquery FW => learn the basics, it's very simple but you can also take another way and instead of using Boostrap & Jquery, you can use Bootstrap & AngularJS.

      AngularJS is very popular, it's a MVC pattern.
Re: Adding Bootstrap to Shopping Cart in Perl ?
by hotchiwawa (Scribe) on Jan 05, 2016 at 08:43 UTC
    examples of their doc:
    <div class="panel panel-default"> <div class="panel-body"> Basic panel example </div> </div> <div class="panel panel-default"> <div class="panel-body"> Panel content </div> <div class="panel-footer">Panel footer</div> </div> <a href="#">Inbox <span class="badge">42</span></a> <button class="btn btn-primary" type="button"> Messages <span class="badge">4</span> </button>

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1151873]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (9)
As of 2022-01-18 13:27 GMT
Find Nodes?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:

    Results (53 votes). Check out past polls.