Last active
September 8, 2019 19:37
-
-
Save nahanil/c04539266a67cd33a80dd38267853926 to your computer and use it in GitHub Desktop.
Sails page title
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<title><%= typeof data !== 'undefined' && data.title ? data.title + ' | ' : (typeof title == 'undefined' ? '' : title + " | " )%><%= sails.config.appName %> | Chinese - English Dictionary & Mandarin Learning Resources</title> | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports.routes = { | |
'GET /foo': { action: 'something', locals: { title: 'Foo Title thingy' } } | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
return exits.success({ title: 'Action page title thingy' }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
res.locals.title = 'Hook title' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is it possible to control locals from exists in actions2 controller?
The above is already perfect I'm just nit picking to learn. The above I used, I just changed the ternary in layout to: