Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
express-render-template
Advanced tools
Use the HTML source of an external URL as an express layout template (clean iframe alternative)
This package in no longer supported and has been replaced by node-iframe-replacement
Use the HTML source of an external URL as an express layout template, a clean alternative to an iframe.
Extends res.render allowing an external URL to be used as a layout & CSS selector as a placeholder location to inject view content.
$ npm install --save express-render-template
The example below will request the Mammoth Workwear home page and replace the contents of #promo-banner with the contents of the view
var renderTemplate = require('express-render-template');
// replace res.render with renderTemplate version
app.use(renderTemplate);
// create a regular express route
app.get('/', function(req, res){
// call res.render as normal but pass template and selector rather than layout
res.render('view-name',{
template: 'http://mammothworkwear.com', // external url to use as layout page
templateSelector: '#promo-banner' // element within the layout to inject view content
});
});
<h1>20% off <a href="https://northseaworkwear.com/brands-dickies-fr-workwear/">Dickies Workwear</a></h1>
To ensure scripts, styles and images in the external template load on your site, the render method injects a HTML base tag <base href="http://mammothworkwear.com" />
. Therefore you need to ensure any links within your view are absolute.
ISC License © 2016 John Doherty
FAQs
Use the HTML source of an external URL as an express layout template (clean iframe alternative)
The npm package express-render-template receives a total of 11 weekly downloads. As such, express-render-template popularity was classified as not popular.
We found that express-render-template demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.