FAQ Database Discussion Community


What is the difference between “extends” and “include” in Jade?

include,jade
With both of these commands I can use code from another file. As I see it when we use extends file.jade we can use block, to change blocks in file.jade before the compilation. But is it the only difference and am I right? Thank you.

Multiplication in JADE

node.js,jade
It would be nice to multiply two fields inside Jade, if it is possible. Here is what I'm trying to accomplish: tbody each item in items tr td #{item.sku} td.text-center #{item.price} td.text-center #{item.quantity} //td #{item.quantity} * #{item.price} // - var totals = {item.price} * {item.quantity}; //td #{totals} td #{item.quantity} *...

Override Jade script. block

javascript,node.js,express,jade
I'm trying override a Jade script. tag,but all what I do don't work. I have the following code: Layout.jade block foot footer.container#footer .row .twelve.columns Todos os direitos reservados. © 2015 Pet Feeder block scripts script(src="/javascripts/js/jquery.min.js") script(src="/javascripts/lib/jQueryUI/jquery-ui-1.8.18.custom.min.js") script(src="/javascripts/js/s_scripts.js") script(src="/javascripts/js/jquery.ui.extend.js") script(src="/javascripts/lib/qtip2/jquery.qtip.min.js")...

Insert QML code in Jade

javascript,node.js,express,qml,jade
I'm writting a simple video streaming app with Node.js and I'm using the WebChimera plugin. With chimera, the player config is written in QML and I must include it in my .jade page and of course, there's many errors when jade compiles. Is there a way to include QML in...

Express: why is this GET request executed twice?

javascript,node.js,http,express,jade
I have some code written in Jade, with a link in it. The destination of the link is generated by Jade. When the link is clicked, I notice from my console that the GET-request is being executed twice. Why is this? How can I fix this? Here is my code:...

Add hyperlink to text in a column generated by bootstrap-table

jade,bootstrap-table
Using Node + Jade am creating a table that will display a large list of users, so I decided to use bootstrap-table and I found a great library with many possibilities. I'm currently using the pagination to not display as much information in the table, the table at the moment...

HTML “First Time User” form best practice (Jade / Angular)

html,angularjs,forms,jade
So I'm trying to implement the following form in my app. This is a form which should appear the first time a user tries to create a task in our app. Now my question is, what is the best way to deal with something like this? I'm not a very...

angular js ng-view returns blanc partials — Express/ Jade

javascript,angularjs,node.js,express,jade
I am writing an angular application following a tutorial. To my surprise, i followed exactly and my node js is starting fine without an issue. However, my angular is not returning the template as suppose to . I saw a similar problem here same tutorial and the same issue. However,...

Jade: get variable in Bootstrap Modal

javascript,jquery,twitter-bootstrap,express,jade
I am trying to achieve the following: My Jade page uses a for-loop to generate a list of items. Each item in this list has some information, displayed via Jade-variables, and a delete-button. This delete button should open a Bootstrap Modal (a pop-up window). I want the Modal to contain...

Accessing JSON attributes within Jade Mixins

json,jade,mixins,javascript-objects
Motivation I have some ugly working code embedded in my Jade template and I want to move it to a mixin so it is more readable, maintainable, etc. The code A simplified equivalent version of the mixing would be: mixin mixinName(param1, param2, paramObject) .tile(class="#{param1 >= paramObject['atr1'] && param1 < paramObject['atr1']...

How to make my .selected class stay on the correct a(href) after the reload in a list of hrefs

javascript,jquery,node.js,jade,href
I have a sidebar of links that loads everytime you click on a link, however when I load the next page, the .selected class moves back to "all" instead of the selected link. I know this is explained with tabs on here but I could not make it work using...

How to Repeat Bootstrap Containers in Jade?

javascript,json,node.js,express,jade
I have JSON data being sent from Express and Mongoose Stack to be rendered for the UI programmed in Jade. What Jade Construct should I use to repeat a Bootstrap Container of col-md-4 using the Jade syntax. Currently my Jade Code is as follows, if deal each item in deal...

Use jade mixin inside code block

node.js,express,jade
Is there a way to use jade mixin inside javascript code block? I have next use case: mixin YYYYMMDD(date) = date.getFullYear() + '-' = ('0' + (date.getMonth() + 1)).slice(-2) + '-' = ('0' + date.getDate()).slice(-2) So I need to use this mixin inside input( value=YYYYMMDD(date) ) Update: I had to...

Background Image Not Showing In Header

html,css,jade,stylus
CSS Background image not showing. heres my stylus file for the heading section: .header { height 50vh border-bottom 5px solid #34495E background url(img/head.png) no-repeat center center fixed background-size cover } .nav { display flex align-items center justify-content flex-end padding 1em background rgba(0,0,0,0.5) position fixed top 0 left 0 width 100%...

grunt-contrib-jade compiling to single JS with cwd

gruntjs,jade
I am trying to compile multiple jade templates into single JS file using grunt-contrib-jade. Problem I'm facing is that with full path to templates, I get function names with full path. I want to avoid that, so I tried using cwd (without expand). This ended up with the following: >>...

angular partial not rendering with jade [duplicate]

javascript,angularjs,node.js,express,jade
This question is an exact duplicate of: angular js ng-view returns blanc partials — Express/ Jade 1 answer I am building an angular app following a tut. However, my angular ng-view is not rendering. I have seen a similar question here yet it has not been answered. Below is...

why is my image not displaying?

html5,image,google-chrome,jade
I just changed the size of an png image in my website. I have changed the name and the url to it: img(src='/images/newname.png') I cleared the cache on chrome but the image still does not appear?...

Can I create dynamic variable names in jade using an array of string values for an object?

javascript,jade
I have an array of values named values. I have an each statement that I am iterating through the array. Within the each statement I am using a for loop to iterate through an array of objects. When I iterate through the objects I want to check and see if...

how capture the main method trace from jade using AspectJ?

jade,aspectj,agents-jade
i am using Jade in eclipse IDE, i want to capture the main method from jade, because the main method is the starting point for every application, i want to test if it is also right with the running of the JADE middleware (ie: i want to check if the...

Jade / Expressjs: Pass objects from server to client

javascript,node.js,express,jade
I'm trying to pass an object from my endpoint to Jade but It keeps giving me Uncaught SyntaxError: Unexpected identifier on Stat! Can someone help me please. Here is my code: app.get('/stats', function (req, res, next) { var stats ={ 'm0t20': {a:0,b:0,c:0,d:0}, 'm20t30': {a:0,b:0,c:0,d:0}, }; res.render('chart',{'stat':stats}); } and in my...

Absolute link in jade

node.js,express,jade,keystone.js
I am running keystonejs (Nodejs + expressjs + jade ), and trying to add absolute links to my pages. Every link I add is a relative link though, and always routes to my site. Below, post.url has the value "www.google.com": a(href=post.url, target=' ') The result is -> localhost:8080//www.google.com The only...

Override Style in Jade?

node.js,jade
I am trying to override a bootstrap class's padding in jade like so: a.navbar-brand(href='#', style={padding:'0px'}) But the resulting HTML ends up like so: &lt;a href="#" style="[object Object]" class="navbar-brand"&gt; Looking at the docs they have an example under "Style Attributes" that is almost identical, so I'm not sure why this doesn't...

AngularJS - Form scope binding in ng-include templates

angularjs,forms,coffeescript,jade,angularjs-ng-include
I'm fairly new to Angular and I have been porting a webform from Zurb's foundation and nasty JQuery to Angular. I'm attempting to load each section of my webform as a template, while still binding the fields to the scope. The sections of the form are dynamically included from a...

Long strings within variables in jade

node.js,string,express,jade
I am writing a web application that supports multiple languages. What I am doing is passing strings to a translator class and it will perform the translation. Now I need to add some long text in my templates and I would like to have it on multiple lines for readability....

Jade block not rendering

node.js,express,jade
I'm sure I'm missing some small thing. I'm playing around with jade templates in express. I'm trying to experiment with blocks and extensions. For some reason my block isn't working. Here is the jade templates: layout.jade doctype html html head title= title link(rel='stylesheet', href='/stylesheets/bootstrap.min.css') link(rel='stylesheet', href='/stylesheets/style.css') script(src='http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js') script(src='/javascripts/bootstrap.min.js') body block...

How can I change text color in a Semantic UI vertical menu?

html,css,jade,semantic-ui
I have an active red link item in a vertical menu and I only want the pointer to be red. What is the most effective way to change the text so it is black? I have attempted to wrap it in a paragraph element but that only makes it difficult...

How to include parameters in url using nodejs+jade?

node.js,express,jade
In jade I have two hyper links that both jump to same page, for example: a(href='/signup')#create-account Create Student Account a(href='/signup')#create-admin Create Teacher Account If I want a variable send to '/signup' url and do some processing using that variable, what should I do? Any help will be appreciated....

Node.js and node_redis - Parsing HGETALL response to Jade template (Object with Buffers)

json,node.js,jade,node-redis
I am using the node_redis NPM module (https://github.com/mranney/node_redis) and the docs state that "HGETALL returns an Object with Buffers keyed by the hash keys." If i log the output to a console, I get something like: { 'foo': '{"data":{},"config":{}}', 'bar': '{"data":{},"config":{}}', 'baz': '{"data":{},"config":{}}' } NOTE the single quotes wrapping each...

Send variable from backbone view to jade template

javascript,node.js,backbone.js,jade
I have the following template in my index.jade: .... <script type="text/template" id="sample-template"> a(href="<%= link.href %>") <%= link.title %> </script> .... And I have the below code in my backbone view which sends a variable called link to index.jade. .... var SampleView = Backbone.View.extend({ template: _.template($('#sample-template').html()), render: function() { this.$el.append(this.template({ link:...

Check if array has a value, add class if doesn't

express,jade
I have a list of category names that are written in Jade. ul li Discussion li Movie li Music li Performance li Dance li Theatre And I have some json, that shows what kind of categories are added to a specific event: … values: [ { ordinal: 50469, db_value: 626,...

Centering image in the middle of page with Jade and Bootstrap

twitter-bootstrap,jade
I just started using Jade and Bootstrap and have run into a snag. I am trying to center an image in the middle of my index.jade. I was able to get it horizontally centered, but not vertically centered. Below is my index.jade and a image of what it currently looks...

JavaScript expression within Angularjs Jade template

angularjs,jade
Trying to only display some content if a property on my $scope object is before now: div(ng-if="{item.end < new Date()}") However, it's complaining: Syntax Error: Token '<' is unexpected, expecting [:] at column 14 of the expression Any ideas how I can achieve this?...

Can no longer grunt build after adding Jade

gruntjs,jade
I have an Angular project which I used Yeoman to build. It was originally plain JavaScript and HTML. A little while ago I switched the JavaScript to CoffeeScript, and then the HTML to Jade. My app functions just fine now that my templates are Jade but I can no longer...

Jade: modify from any place other than the main page

node.js,express,jade,templating-engine
Update: I also posted this question to the Jade GitHub repository. I'm dropping it here too, for future (circular) reference: https://github.com/jadejs/jade/issues/1943 Original post: In a default node + express + jade application, I'm trying to build some common reusable components (menu, footer...) that I can include in some pages. I...

Jade Templates: Make an image a link

javascript,node.js,jade
So in HTML i'd do something like this: <a href="www.something.com"> <img src="my/machine"> </a> to make the image into a link. But I want to do the same for Jade. I was reading through the docs here but nothing relating to what I want. Help please? Thanks very much in advance....

Express render external Json to jade

javascript,json,node.js,express,jade
I have a file (api.js) which when I call in terminal using node.js it gives a working JSON response. I've used request-promise to do the http request and the app is an Express boilerplate. Now I'd like to add that response to a Jade file and have Jade iterate the...

Node.js reference error: index is not defined

node.js,express,jade
I am building a chat application, and this index.js file is in the "routes" directory. The error is on the first line. There is also an index.jade file in the "views" directory. module.exports.index = index; module.exports.logon = logon; module.exports.message = message; exports.index = function index(req, res){ res.render('index'); }; function logon(req,...

angular: ng-pattern not working

regex,angularjs,jade,ng-pattern
I have a simple text input in which I only want to allow floats and ints (watch out: jade) input.form-control(type="text", ng-model='usd', ng-pattern="nums",ng-change='convert_to_btc()', placeholder="USD") However it doesn't work, I can always insert any character in the input (do I need to do more in order to display something? e.g. a red...

In “for article, slug in public.articles._data” what is “slug”? Is there a way to use nesting arrays?

json,node.js,jade,harp
I experiment with HarpJS, a NodeJS static blog generator. In tutorials there is such example for metadata: for article, slug in public.articles._data a(href="/articles/#{ slug }") h2= article.title and _data.json file: { "hello-world": { <-- available everywhere as public.articles._data "title": "Hello World.", "date": "2013-02-28" }, "hello-brazil": { "title": "Hello Brazil.", "date":...

How to set up wiredep with gulp and jade

javascript,jade,gulp,wiredep
I am trying to inject bower files into my jade/html using wiredep. The issue is twofold. If I were to keep the bower_component in the root folder. Being that my server is set up from ./dist and not from root, I am unable to reach bower_compoents If I were to...

Form given padding-right even though padding is 0px

html,css,html5,jade,stylus
No where in the code is a right margin or right padding set, and when viewing the form element in Chrome's developer tools, it shows both "padding: 0" and "margin: 0" in the Styles listing, but does show a margin when hovering over the form element. The Stylus CSS code...

How to make the generated HTML file auto-indent in WebStorm 10

html,jade,webstorm,auto-indent
I'm using WebStorm 10 with Jade. The generated HTML is not auto-indent, for e.g: index.jade: extends layout block content h1= title p Welcome to #{title} index.html <!DOCTYPE html><html><head><title></title><link rel="stylesheet" href="/stylesheets/style.css"></head><body><h1></h1><p>Welcome to </p></body></html> Is there a way to auto-indent the generated HTML ?...

Loop in jade with curly brackets

html,node.js,for-loop,jade
I am really struggling to master Jade. I want to do something very very simple: print out "some text" 3 times. I have a mixin function: mixin outputText() - for (var i = 0; i <= 3; i++) span some text This works fine. Now when I try to output...

is there jade plugin that would allow manipulation using jquery styled syntax

javascript,node.js,express,jade,templating
So say if i have li elements, and i want to use java script to a) find element with class X then add modify some attribute of it. I can run usual JavaScript and it'd be doable, but i have no idea of how to get handle of existing elements...

Value attribute won't bind to ui.bootstrap progressbar

javascript,angularjs,jade
I'm unable to bind data that is in my $scope to the value attribute in a ui.bootstrap progress bar Angular Controller angular.module('app') .controller('progressbarController', function($scope, dataConstant) { 'use strict'; $scope.dataConstant = dataConstant; $scope.stock = dataConstant.item.counts.statuses.stock; $scope.lost = dataConstant.item.counts.statuses.lost; $scope.progress = dataConstant.item.counts.statuses.progress; $scope.totalParts = $scope.stock + $scope.lost + $scope.progress; $scope.calculatePercentage = function()...

how to access data of an js array in jade

javascript,node.js,express,jade,vis
I am using twitter-js-client and vis timeline to develope a timeline,i can get tweets and i want to display in timeline that tweets,in index.js, i parse a json to get tweets and i pass the data which is returned by the JSON.parse() function into jade and i want to display...

Sending a variable from express middleware to jade

javascript,node.js,express,mongoose,jade
I have a keystonejs app setup, using express and jade. I have a fullscreen background image setup in my default.jade file which defines various imports and also the header and footer of the site. I am trying to rotate the image based on a selection of images that are located...

Include whole directory of scripts using Jade?

javascript,node.js,express,jade
Is it possible to include a whole directory of scripts with Jade? My current scripts.jade file looks like this: script(type="text/javascript", src="/vendor/angular.js") script(type="text/javascript", src="/vendor/angular-resource.js") script(type="text/javascript", src="/vendor/angular-route.js") script(type="text/javascript", src="/core.js") I was hoping from something like this: script(type="text/javascript", src="/vendor/*.js") or this: <!-- include: "type": "js", "files": "/vendor/*.js" --> Any ideas?...

CSS Transition not working accordingly

html,css,css3,jade,css-transitions
Not sure what I'm doing wrong here. The hover is definitely working, as the top and bottom properties get changed, but the transition just isn't there. .info{ position:absolute; transition: opacity 2s; top:0px; bottom:0px; right:0px; left:0px; background:rgba(0,0,0,0.8); color:white; text-align:center; justify-content:center; display:none; opacity:0; } .content ul li:hover .info{ top:-10px; bottom:10px; opacity:1; display:flex;...

Including Javascript for button click in Jade

javascript,node.js,twitter-bootstrap,jade
I am having trouble detecting a button click using Node.js, Bootstrap and Jade. I have the following Jade code but I am not seeing the log from the onclick method and there is no change to the button. So the method never gets called. extends layout block content .jumbotron .container...

node.js/Jade - How to pre-compile jade files and cache it?

node.js,express,jade
Framework: node.js / express.js / Jade Question: in production env, when a jade file is rendered by express, jade cache's it so future renders are faster. When I start node.js app, how can I pre-compile (or) pre-render (like warmup) all the jade files so its already in cache when requests...

How to set an empty attribute using Jade?

html,jade
When using jade, AngularJs and angular-translate I prefer to use the translate directive as an empty attribute. But for some reason, when using empty attributes in Jade, instead of getting something like <tag translate OR <tag translate='', I'm getting <tag translate='translate' How can I add an attribute without a value?...

How to use script. in JADE templates

express,jade
I have created a simple node app using the express framework using JADE templating. All was well in the learning process until I came to try and run some client-side js which I cannot figure out how to do. Is there something I need to do in my app/index.js to...

Jade Mixin for List

javascript,html,node.js,jade
I'm trying to create a jade mixin where I can input the number of items in a list. Example, mixin list(n, text) .list a(href="#") #{text} a(href="#") #{text} .....n times If I call the mixin like this +list(4, 'hello') the outputted html should resemble: <div class="list"> <a href="#">hello</a> <a href="#">hello</a> <a...

I am having issues with my navigation menu. I am using Bootstrap 3, JQuery 2.3.1 , Jade , ExpressJS, and Node.js

jquery,node.js,express,twitter-bootstrap-3,jade
Hi I am brand new to Jade templating for Node.js. I am trying to create a basic starter application using Express 4 , JQuery, Bootstrap 3, and Jade. I am trying to add the navbar into my layout.jade file. It seems to add the navbar, but it does not function...

Create variables and require packages in EJS

javascript,node.js,jade,ejs
Is it possible to run custom JavaScript in EJS templates? I'm looking for the equivalent of the following Jade code: - var Fs = require("fs") - var foo = 42; | #{foo} This will create the Fs and foo variables and display 42. Does EJS have this power? From what...

Angular templates not loading after switching to Jade

angularjs,jade,yeoman
I recently switched my Angular project from JavaScript to CoffeeScript (which went fine), and then from HTML to Jade. I'm still trying to work out one of the Jade kinks. I'm using Yeoman. When I load any particular page of my project, I just get a blank screen. If I...

Span at start of paragraph in Jade

html,jade
Im new to Jade and this is probably easy but I've been unable to achieve what I want. The end HTML should look like: <p class='address'> <span class='strong'> Starting Point: </span> 15 Yemen Road, Yemen </p> My jade is: p.address span.strong |Starting Point: |15 Yemen Road, Yemen But this results...

Cannot read the property of undefined error in jade

javascript,node.js,jade
Here is my simple jade script. ul - each user in users li #{user.username} . I will get cannot read the property username of undefined error....

Create table dynamically in jade

node.js,mongodb,jade
How to create dynamic rows for table in jade. My data for rows will be coming from MongoDB rendered by nodejs. Here is my MongoDB document => { "_id" : ObjectId("55429a92bf0adf38ce82052f"), "userid" : "103", "projectName" : "Nodejs Project", "startDate" : "03/15/2015", "endDate" : "05/15/2015", "tasks" : [ { "taskid" :...

On hover color not changing using LESS css

css,less,jade
I'm trying to change the color of text as well as background image, when hovered on the image. I'm using LESS and i am able to change the background image, but the color of the text is not getting changed. Please help. Here's my code snippet :- Jade code (...

Why can't I find app.locals in jade

javascript,node.js,express,jade
I'm working with express/node/jade and have build a module for some variables. I have this line in my app.js app.locals.GVs = require('./utils/globalvars.js'); and this is my jade extends ../layout block content h1 Edit - Change Your Profile p There will hopefully be a form to change users here. form(id='form',action='') include...

Express & Jade & nodejs: Create two button form to redirect

javascript,node.js,express,jade
How do I create a Jade page that includes two buttons where each one of them redirects to another Jade page? Thanks, J....

parsing jade forms with node.js

javascript,node.js,forms,parsing,jade
I'm not sure how to go about getting a user selected item from a dropdown list. My jade code is pretty short: extends layout block content p This is the CSV page p <select> <option value="domain">Domain</option> <option value="test">Test</option> <option value="random">Random</option> <option value="databases">Databases</option> </select> form(action="/csvuploader", method="post", enctype="multipart/form-data") label(for="payload") Select a file...

How do I show an unknown length nested array without crashing the browser?

javascript,html,angularjs,angularjs-ng-repeat,jade
I have an huge array organized sort of like this: [{ name: 'name1', nodes: []}, { name: 'name2', nodes: [ { name: 'name21', nodes: [ { name: 'name211', nodes: []}, { name: 'name212', nodes: []}] }] }, { name: 'name3', nodes: [...] }, {...} ] and it goes on... I...

Turn a div tag into a input box

javascript,jquery,jade
I want to be able to ckick on the h2 in the .editable div and it should change into an input box. Then you can edit it and it will updat the input when you click out of it or press enter. This is what I have for it, i'm...

Passing variables in Jade

jade
I'm trying to pass variables from the calling express application to a jade template and from there to a base template and some includes/mixins. I want to set a default value in case the parameter is not passed. I'm looking for a good description of the variable scope throughout the...

Unable to install jade in a node.js project

node.js,osx,terminal,jade
I am trying a sample node.js based project by referring this tutorial: How To Write A Simple Node.js/MongoDB Web Service for an iOS App. I have configured my package.json like this: { "name": "mango-server", "version": "0.0.1", "private": true, "dependencies": { "express": "*", "jade": "*" } } Problem is - when...

Create dynamic div classes in jade

angularjs,jade
What I need is to create classes dynamically using Jade and AngularJS. For example, I have this "Hello World" code and I want to type in the class inside the text input (e.g. "alert alert-danger") and then change the appearance of the text in {{first.greeting}} {{"World"}} . This means that...

CSS undetected?

css,node.js,jade
I was told the reason that I'm not getting this: and getting this instead: is because no styles are supplied. So I checked my CSS links: link(href="css/bootstrap.css", rel="stylesheet", type="text/css") link(href="elyes.css", rel="stylesheet", type="text/css") link(rel="stylesheet", href="jstree/dist/themes/default/style.min.css") link(href="jquery.mCustomScrollbar.css", rel="stylesheet", type="text/css") link(href="./Icons/splashy.css", rel="stylesheet", type="text/css") link(href="toastr/toastr.css", rel="stylesheet")...

Use email template for contact form using Express/Sendgrid

javascript,node.js,express,jade,sendgrid
I have a simple contact form using the Node Sendgrid helper library. I would like to use a template email/contact.jade that compiles to HTML and adds the right context. I know it needs to go in the payload.html value, however I'm stuck on how to send the email with the...

Website contents seem to be animating in without warning? [closed]

html,css,node.js,jade,stylus
When viewing my website (http://elsealabs.com/), it seems as if the content is animating inwards, even though I have no animations for such an event specified. How do I make this animation stop? It is especially noticeable if you refresh the page and watch the download button or the navigation menu....

AngularJS + Jade ng-repeat does not fill the table

angularjs,jade
I am trying to fill a table via AngularJS. My controller receives through a socket data. The data looks like: [{score: 2, team: 1, kills: 9, assists: 2, deaths: 0}, {score: 2, team: 1, kills: 9, assists: 2, deaths: 0}] I tried to reduce the code to the relevant stuff,...

Meteor JS Jade template does not work as expected

javascript,html,node.js,meteor,jade
I tried this package https://github.com/matteodem/meteor-easy-search/ easy search using this sample code <template name="searchBox"> {{> esInput index="players" placeholder="Search..." }} <ul> {{#esEach index="players"}} <li>Name of the player: {{name}}</li> {{/esEach}} </ul> </template> and convert it to jade template(name="searchBox") +esInput index="players" placeholder="Search..." ul esEach index="players" li Name of the player: {{name}} If I used...

Bootstrap columns inside columns sizing issues

html,css,twitter-bootstrap,jade
So I've used Bootstrap columns before, but this project requires some heavy nesting, and I can't get it to work. The layout requires .col-8 and .col-4 when on desktop, no matter what. The 8 column will support two more columns inside of it that are evenly sized, in which some...

Failed to lookup view in node express for jade

javascript,node.js,templates,express,jade
I'm using Jade template engine to replace to replace my variables:; I have tried the following: var express = require('express'); var jade = require('jade'); var router = express.Router(); router.get('/test', function (req, res, next) { var html= res.render(jade.renderFile('test', {"message": "test1", "title": "test2"})); res.render(html); }); module.exports = router; and the following is...

pass variables to jade template

node.js,express,parameters,parameter-passing,jade
I am trying to pass variables from page.js to page.jade but for some reason this is not working. here's my code: page.js res.render('page', {param1: 'xxx', param2: 'yyy'} ); page.jade #{param1} br #{param2} br ...

Submitting form via jquery trigger

javascript,jquery,forms,twitter-bootstrap,jade
I'm brand new to javascript and seriously cannot figure this out. So, I have a button linked to a form that will submit the data gathered from the form. I was told to rewrite the JS/ JQuery so that it can work across a website. button(trigger-submit='form-presentation').btn.btn-primary( name="action", value="add-assessment" ) Save...

Adding fields in KeystoneJS

node.js,mongodb,jade,keystone
there is any way to add new fields like tags or list of strings for each post? I want to make something with more filters. There is any tutorial on how to post and read in DB? This Jade is so weird for me.

Backbone constructor not working

javascript,node.js,backbone.js,jade
I'm trying a simple backbone program using express which dispalys name and twitter handle and allows its update by using a template in jade. However, its not working. Here is my server.js file: var express= require("express"), bodyparser= require("body-parser"); var app= express(); app.use(express.static(__dirname+ "/public")); app.use(bodyparser.json()); app.get("/", function(req, res){ res.render("index.jade"); }); app.listen(3002);...

Jade - Can I reference DOM element in 'if' statement?

jade
I have the following simple index.jade: input#elem1 'then I need the following:' if #elem1.val()='A' then label#elem2 input=A I know I can do this in my js file, but I was looking for a simpler solution using Jade only....

Is there a way to send new data from nodejs to jade after a page has been rendered?

javascript,ajax,node.js,express,jade
For example I can send a data when a page is about to be rendered: router.post('/login', function(req, res){ res.render('filename', {title: 'File Name', FIles: JSON.stringify(doc)}); } Lets say filename.jade there is a button that sends data back to node js, to '/getdoc' route. and '/getdoc' doesn't render any new page but...

HTML not rendering inside Jade

html,angularjs,node.js,express,jade
I'm building a website with node.js, express, angular.js and jade. I'm currently testing html tags on blog posts, wich don't seem to be working. I'm focusing on the heading for now. Why doesn't the browser render it as HTML? I have btw tested this in chrome but I had the...

li without in Jade lang

html,jade
I'm trying to write this code: <ul> <li> 1 <li> 2 <li> 3 Whithout </li>. How would this html code look on the Jade lang?...

style not working for p tag in gradle

node.js,jade
Hi I am new to both gradle and nodejs. I am trying to add padding for p tag in jade. my jade file goes as below extends layout block content center h1= title p Rate-Review-Ride p(style='padding-left:500px;') | Gradle is a project automation tool that builds upon the concepts of Apache...

stylus not allowing styles to take affect

css,jade,stylus
Can someone explain why this is happening and how to fix it? Here is the file: global-reset() * box-sizing border-box font-size 16px font-family sans-serif .header background #e1e1e1 height 20em border-bottom 5px solid #000 position relative .header:before position absolute display block content '' border-bottom 5px solid red height 100% width 100%...

Bootstrap responsive navbar works when scaling in browser but doesn't when on my mobile

css,node.js,twitter-bootstrap,jade
I have a personal app i've been working on using nodejs, express with jade to build the UI. The site scales file in a browser and all the mobile emulators i've tried. The site is myrecipes.me and the code in question is below. nav.navbar.navbar-default.navbar-fixed-top(role="navigation") .container-fluid .navbar-header button.navbar-toggle.collapsed(type='button', data-toggle='collapse', data-target='#navbar', aria-expanded='false',...

Backbone Collection only fetched after executing alert

node.js,backbone.js,express,handlebars.js,jade
Hey I am new to backbone and Handlebars and something strange is happening with my code that I cannot figure out. Basically my node app queries mongo for some data which is then used by backbone and handlebars to relay the data to the user. When I try to relay...

How do I compile mutliple HTML Jade templates that use the same mixin

html,node.js,gruntjs,jade
mixin hero(title) .hero .hero__inner h1.hero__title #{title} So, my project uses a Jade mixin like the above on multiple pages and, when I compile the Jade to HTML pages, I have to copy that mixin on each page that it is used. I can compile the pages using either grunt-jade or...

Listing data from database - use angularjs with API or generate using Jade on server-side [closed]

angularjs,node.js,jade
I'm creating a Node.js web app and I'm not sure whether to use AngularJS (or other client-side templating engine such as Ember or Backbone) to display data from a database or to generate the page on the server side (with Jade) and then send it over. Is there a significant...

How to render jade layout with loop of users

node.js,jade
I am trying to render something like it: <div class="row"> <div class"test"> User 1 </div> <div class"test"> User 2 </div> <div class"test"> User 3 </div> </div> <div class="row"> <div class"test"> User 4 </div> <div class"test"> User 5 </div> <div class"test"> User 6 </div> </div> I need 3 .test for each...

Advice sleuthing down why Bootstrap CSS not working in Express

css,twitter-bootstrap,jade
I'm learning Express.js, and have included Bootstrap in my layout.jade. Problem is, the styles are not showing up. Any advice how to chase this problem to ground appreciated. Here's layout.jade: doctype html html(lang='en') head title=MiniApp link(rel='stylesheet', ref="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css") link(rel='stylesheet', ref="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap-theme.min.css") body block content...

Express and Jade: getting a variable into JavaScript

javascript,node.js,express,jade
I have the following issue: on the server side I am creating a graph. I would like to display this graph using the Sigma.js library. For reference, the generated data looks for example like this: { nodes: [ { id: '423ed89a-491d-416b-9c19-13fcb6db45bc', label: 'Nevens Jens', x: 0.5935997352935374, y: 0.36792555125430226, size: 5,...

Multiple logical OR Operators in Jade

node.js,jade,logical-operators
Very simple: I want to make an <img>-Tag if the mimetype of my file is an image case comment.fileType when "image/png" || "image/gif" || "image/jpeg" img(src="/files/#{comment.fileLink}") does not work It works for png, but not for jpeg or gif. Is there a trick?...

Can't pass a variable from Node.js to Jade

node.js,express,jade
I have this few lines of code: var base="http://www.youtube.com/watch?v="; var videoID=result.items[0].id.videoId; var link=base+videoID; console.log(link); In console log I see perfectly the value of the variable "link". When I try to use that same variable in Jade, I get nothing.. p This is the link of the movie trailer:#{link} I don't...

Serving compiled jade with express when browser requests “element.html”

node.js,express,jade,polymer
my layout.jade contains link imports of regular html polymer elements, like such: link(rel="import" href="/bower_components/paper-tabs/paper-tabs.html") I was inspired by this gist to write my polymer elements in jade, but now I'm not sure how to serve them when the browser (through the page served from index.jade) requests "paper-tabs.html". I'm basically trying...

Positioning about me section on my website

html,css,jade,stylus
The link to my website is: mckelvey.me:1122 . I am having trouble positioning my About Me section. It has a image that wont scale properly, and should be full height of #about and on the left side with a width of about 40%. and the title and paragragh needs to...

Custom HTML in Jade Template

node.js,jade
I'd like to accomplish something in jade, but not sure on the best approach. I want to have several product pages on a website, and most of these product pages will have the same layout and design, so I'm going to create one jade template. However, I would love to...

Bootstrap - Make a dropdown out of navbar-brand that is like navbar-collapse?

html,css,twitter-bootstrap,less,jade
I'm trying to turn my navigation bar's header into something just like the navbar collapse that already exists in Bootstrap. I've managed to turn the header into a dropdown, which will span just one line. Once completed, I want it to look like (but of course, much nicer): LINK /...

jQuery toggleClass only works for a split second, then it reverts back to how it previously was

jquery,sass,jade,toggleclass
So this is my first question ever on stackoverflow, sorry if I ask this poorly or have failed to find the answer elsewhere. I am using a simple toggleClass jQuery function to add a class called .slide-out that gives the whole body a left: 30% value. If I manually add...