My Jade template includes the following form structure: form(action='/scheduler/save/' + project.Id, method='post') div.form-group label.control-label.col-md-2 RecurringPattern div.col-md-10 ...
I am currently using expressjs in my app and have the following setup: app.get('/profile',index.profile); app.get('/',index.home); Within layout.jade, I have the following code: ... if typeof(username)!=='undefined' li: a(href='/log ...
What are some best practices for processing HTML form data using Express and Jade templates? I was considering implementing a self-calling loop similar to PHP in the router script, where there are two handlers for the same route - one for GET requests and ...
After creating a single page featuring a select dropdown containing various book titles from a JSON file, I encountered an issue. Upon selecting a book and clicking submit (similar to this image), the intention was for it to redirect to another page named ...
I've created a simple Express application with a single function that utilizes the nodejs request and selects specific div elements. My goal is to then render this using jade. var express = require('express'); var voc = require('vocabulaire'); var async = ...
Though I am not sure of the internal workings of Jade, my best guess is that it compiles each template file once and then employs a compiled and cached version for subsequent HTTP requests. One intriguing observation I have made while running my Express a ...
I am looking to receive a notification similar to an alert, as described in this link: https://github.com/visionmedia/express-messages By default, I receive something like this https://i.stack.imgur.com/9XlA9.png If I use a template, I do not get any out ...
I'm currently working on integrating a form into my app for users to create tasks. This form should only appear the first time a user attempts to create a task. As someone who is not very experienced with frontend development, I find myself wondering ...
My issue is that I have a dynamic page where product details are loaded, but the html code loads before the data. This results in errors when trying to use static elements like images because the "product" object does not exist. To address this problem, I ...
I've been attempting to pass values into a jade template using a node/express route, but for some reason, nothing seems to be getting passed through. Below are both the server and template code snippets I am working with: server.js: app.get('/note/:id', ...
I've been working on targeting a specific element within an iteration. each category in categories .menu_category p= category.category_name The code above is in Jade and it's looping through an object called categories. As I' ...
Currently, I am exploring Huge's latest Styleguide templates and delving into Jade syntax. However, despite my efforts, I haven't been able to locate any documentation on how the image paths were created by the author. The specific syntax used is ...
I'm currently using Pug as my view engine for Express (Node.js), and I'm running into some issues with conditionals. The grid framework I am using for newsletter designs is similar to Bootstrap's grid, where I need two items per row that req ...
I have a code snippet that requests data from an external API using axios and I want to incorporate the response into my rendered page. Here is my code: //Snippet from my controller required in main routes exports.recordBySlug = async (req, res, next) =&g ...
Having trouble serving static files with Express and Pug as the templating engine. My assets are not loading correctly. Directory structure : +front +views +login index.pug +images +js +css ... server.js Server code : ap ...
I am trying to pass a global object to a jade template so that I can use it for various purposes later on. For instance: app.get("/", function(req, res){ var options = { myGlobal : {// This is the object I want to be global "prop ...
How can I achieve the following if condition in jade? each item,count in display if(count % 3 === 0) { ul.thumbnails } li.span6 //nested under ul //more code nested under li I have sea ...
Within my node.js Express application, there exists a route like this: router.get('/devices/:id/visualize', catchErrors(deviceController.visualizeDevice)); This route points to the following controller: exports.visualizeDevice = async (req, res) => { ...
Within my views folder, I have a pug template named fixed-assets.pug located in views/administration/assets/ The main template default.pug, which the fixed-assets.pug extends from, is situated in the root views directory. Upon attempting to render the fi ...
Is there a way to transfer all rows from the original console output to Jade using node.js? Currently, only one row of the WCF service is being sent to Jade. var response = result['s:Envelope']['s:Body'] [0].OrderReportResponse[0].exe ...
I'm attempting to develop a basic app, similar to a TO-DO LIST. I want to generate divs dynamically (with incremental ids) when a Button is clicked and then enter some text into an HTML input field. For example: <div id="item1"> <div id="ite ...
I'm looking to retrieve an array of objects from MongoDB and pass it to the client... Here is an example object: var objeto_img= { name:'name of the file', ...
I'm facing a strange problem here. I have a simple jade/pug include setup like this: extends base.pug block vars - var title = 'Home' block body header include ./includes/header.pug A quick observation, using just extends base (without ...
I am currently learning how to develop a meeting web application using express. During the lecture, swig was used, but I personally prefer using jade as I am more familiar with it. I am in the process of translating swig code to jade, and I'm encountering ...
Currently, I have a situation where my script is sending a matrix that looks like this: [[1,2,3,4], [7,6,5,4], [2,3,4,5]]. After sending it using res.send(JSON.stringify(dataArray)); and viewing it in jade with h1#results, I can see that the format appears ...
I have been working on implementing an automatic logout feature for users who remain idle for a specific amount of time on a particular page. My approach involves using jade files to structure the layout of my html pages. I attempted to integrate the idleT ...
Struggling to send a String array from the server side to the client using Nodejs and Pug. Encounter errors like "SyntaxError: expected expression, got '&'" or "SyntaxError: identifier starts immediately after numeric literal". Server runs on v10.15.0 ...
Need help inserting a script into a comment on Pug? I have two scripts that need to be added to my website: <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script> <script src="http ...
I have a .pug app and I want to convert it to a next app. My current app uses the .pug engine, but I know that Next.js is different. How can I go about converting my app to Next.js? Currently, my files are in the views folder and within the views, the fi ...
I have a situation where I am calling a function that makes a request to get some JSON data and then fills in the variables from my router.get method. The issue I am facing is that the variables are getting their value inside the callFunc function, but wh ...
I am in the process of developing an express app integrated with MongoDB. The issue I am facing involves a pug template for the navigation bar where I aim to display the user's name at the top upon logging in. Strangely, it only works on the page that the ...
I am currently working with express and jade to display a web page. My intention is to render the page using this format 'http://127.0.0.1:5000/services/landfreight' but I keep encountering a 404 error. router.get('/service/landfreight', function(req, res, ...
Presently, I am facing an issue: I am required to generate md-checkboxes from a Database. The implementation is successful using ng-repeat. However, I am encountering difficulties in fetching the data from these checkboxes. Each entry in the Database has ...
I'm having trouble setting up pug-php-filter (https://www.npmjs.com/package/pug-php-filter) with gulp in order to enable PHP usage in my Pug files. Any assistance would be greatly appreciated. ...
The code below is part of the app.use section // Setting up redis session store app.use(express.cookieParser()); app.use(express.session({ store: new redisStore({ host: 'localhost', port: 6379, ...
I seem to be overlooking a small detail. Currently, I am experimenting with jade templates in express and trying to utilize blocks and extensions. However, my block does not seem to be functioning correctly. Below are the jade templates I am working with: ...
form(action='/allusers', method="post") input(id='name', placeholder='First Name / Last name') button(type='submit') Launch Spacecraft In my HTML (Jade) code, I am trying to redirect to the allusers page ...
When it comes to implementing a build solution using NPM scripts instead of Gulp or Grunt, I have been facing some challenges in managing multiple Jade files efficiently. I've referred to resources like and for guidance. The Jade CLI allows for compilin ...
After spending the entire day trying to solve this issue, it seems like I might be missing something simple. Here's the problem at hand: I have a well-structured Nodejs/AngularJS application that utilizes Jade for templating. The server performs certain ac ...
Working on a simple log in form for my website using Jade and ExpressJS. Everything is functioning correctly, except for one issue - handling incorrect log in details. When users input wrong information, they are redirected back to the log in page with a p ...
My application is a straightforward blog platform that showcases a schema for the title, entry, and date of each blog post. There is also an edit/delete feature that is currently under development. When attempting to use the edit/delete button on a selecte ...
Currently, I am in the process of developing a basic web application that will initially show a list of bus route numbers and names upon landing on the page. My tech stack includes MySQL integrated with Express and Pug. Below is the server-side code snippe ...
Currently, I am experimenting with a basic node.js application where I can create and save posts. The process involves displaying the post form using the newPost function and handling the submitted data in the savePost method. After performing validation u ...
Currently I have a layout.jade code that I am looking to modify the javascript for. My goal is to load an image onto the page every time it is reloaded using jade. Here is the existing code: html head title= title script(src='/libs/jquery/j ...
Here is a form for users to upload a file and submit text: form(action='/createpost' enctype="multipart/form-data" method='post' id="imgForm") input(type='file' name='imgPath' size = "60") br textarea(name="postText" form="imgForm") Enter your ...
Having recently delved into the world of node.js and Jade, I've been teaching myself through tutorials on udemy. However, I'm facing some challenges when trying to integrate Jade, Express, and Backbone based on an example. I attempted to use res. ...
I am unfamiliar with Express and I am trying to figure out how to pass the user's username from a Jade file to an endpoint function in my JavaScript file. Below is the code for the endpoint function in index.js: router.get('/userdetail', fu ...
Can anyone help with decoding this mysterious data and displaying the image? I'm using pug as my template engine. Below is the questionable data that needs to be shown as an image: /9j/4AAQSkZJRgABAQEAYABgAAD/4QBaRXhpZgAATU0AKgAAAAgABQ ...and so f ...
I'm currently working with Express js to create a web application. I make use of an API to fetch some data, which is then sent to a pug file in the following format. res.render('native.pug', {product_name: body.products, cart_items:body.cart, item_count:b ...
I'm currently developing a component that I plan to use multiple times on a website through a Jade template. This is how my route is set up: router.get('/', function(req, res, next) { res.render('indicators',{category:"", number:"1", title:"whatever" ...
I'm currently utilizing the Jade server-side templating engine to render a layout. The initial layout received by the client will remain largely unchanged, with only occasional updates needed for its contents rather than a complete overhaul. Is there a me ...
Currently, I am working on building a web server using expressjs and jade for the frontend. I have also implemented client-side routing with angularjs but unfortunately, my UI is not displaying as expected. Below you can find my code and the unexpected out ...
After successfully making a GET request to an API, I am now looking for a way to display the response on a Jade page. Below is the code snippet from 'index.js' located in the routes folder where the GET request is implemented. Any suggestions on ...
Does anyone know why this Jade template keeps adding apostrophes around variable outputs no matter what I do? The code snippet below shows how it's displaying in the document at the end. Any suggestions? div.col-md-4.col-xs-12 div#currentImg ...
If I have a jade setup with 3 files as follows: 1. //layout.jade doctype html html body block content 2. //index.jade extends layout block content h1 Animals block cat block dog 3. //animals.jade extends index block cat p Meow block ...
I want to separate the navigation part of my Jade template into a different file called 'navigation.jade'. Is it possible to do that? Currently, I have layout.jade and I would like to achieve something like this: mixin ie(condition, content) | <!--[ ...
In my project using Express/Node and Pug for views, I've been struggling to incorporate Tailwind CSS for styling. Despite adding the necessary classnames in my Pug files, the styles don't seem to be applying correctly. Has anyone faced a similar issue? ht ...
I am struggling with integrating layouts and partials effectively in my project. Can someone provide guidance on the correct setup? Currently, I am using grunt-contrib-jade. Here is my current file structure: app |_jade | |_layouts | | ...
My aim is to modify a record by its unique identifier. functions.updateClassified = function (req, res) { loadSchema.findById(req.params.classified_id, function(err, bear) { if (err) res.send(err); else l ...
Currently, I am working on developing a CRUD (Create, Read, Update, Delete) App using Express and LowDB. So far, I have successfully implemented the create and read functions, but I am facing issues with the delete function. This is an example of what th ...
Hi there, I've been diving into Node.js with Express for the past week and I'm really enjoying it. So far, I've grasped the fundamentals of building an MVC framework on top of it, and using JavaScript has proven to be a much cleaner experience compared to ...
Exploring the realm of single page web apps with node, angular, and jade has been an interesting journey for me as a newcomer to angular. I am currently faced with a dilemma regarding my app.js file - how can I ensure that my initial page template loads fr ...
In my code using JADE syntax, I have the following structure: select(ng-model="eventTypeUI") option(ng-repeat="c in eventUI", ng-value='c.value', ng-disabled='selectEventCanNotBeUsed(c.value)') {{c.name}} I chose not to use ...
I'm struggling to understand where I'm going wrong in this situation. My issue revolves around rendering a form using a GET request and attempting to then parse the data into a POST request to display it as JSON. app.get('/search', (re ...
I've implemented server-side code to fetch data from an external website and return a JSON object to the client side of my node.js/express application. The intention is to further process this JSON on the client side. Within my index.js file, I have ...
Can someone please explain the correct syntax for fetching an API with Node.js? I am trying to fetch it, but keep getting an error stating that 'fetch' is not defined. View image here ...
Recently delving into Jade for a new project and finding it to be quite impressive so far. However, I've encountered a little snag with the Extends feature. The block I created doesn't seem to display when rendering layout.jade. layout.jade: di ...
I've been attempting to integrate map location data from my mongodb collection, but I've run into an issue where I can only access one piece of data at a time. I tried looping through the data both on the server-side and client-side to display it ...
I am currently working on a project that involves the use of NODE, EXPRESS, and JADE TEMPLATE ENGINE, as well as AJAX to optimize page loading. However, I encountered an issue when trying to utilize the data received from a GET request in AJAX directly wit ...
I have searched for answers on this topic, but I haven't found one that addresses the entire process. I am feeling quite stuck. Below is my code: express code res.render('index', {expressVar:"My Example"}); template.jade doctype html ...
I'm curious if there is a way to automate the counting of columns in a mongodb table using .pug. Is there a method to automatically display the total number of columns within a .pug file? ...
As I work my way through the peepcode nodejs video and try to recreate the app using the latest express/node versions, I've encountered a minor issue. Here is the current file structure: site - apps - - authentication - - - views - - - - login.j ...
My Jade template includes an HTML form, but I need the action of the form to be conditional based on external information. How can I pass this information into the template? Here is a snippet of my code: In my ExpressJS app: router.get('/report ...
Is there a way to change only the first letter of the title tooltip (from a span) to be capitalized? I attempted using CSS with text-transform: capitalize;, however, it didn't have the desired effect. <template lang="pug"> .cell-au ...
When using the grunt-contrib-jade module to compile my Jade templates, I encountered an issue. If I leave my attribute blank, like in this line of code: article(ui-view) The compiled output becomes: <article ui-view="ui-view"></article> Thi ...