mirror of
/repos/Prototyper.git
synced 2025-12-30 06:31:32 +01:00
updated /page handling
This commit is contained in:
parent
cc2dc2b132
commit
13bfa46ede
22
routes.js
22
routes.js
@ -276,7 +276,10 @@ module.exports = function (app, config) {
|
||||
collection: req.params.collection,
|
||||
ext: req.params.ext,
|
||||
query: {name: req.params.name},
|
||||
debug: req.query && req.query.hasOwnProperty('debug')
|
||||
req: { query: req.query,
|
||||
headers: req.headers
|
||||
}
|
||||
// debug: req.query && req.query.hasOwnProperty('debug')
|
||||
};
|
||||
mongodataInstance.getMongoContent(options, function (err, result) {
|
||||
if (err) {
|
||||
@ -285,12 +288,19 @@ module.exports = function (app, config) {
|
||||
if (result) {
|
||||
var attribute_parts = options.query.name.split('.');
|
||||
var attribute = attribute_parts[attribute_parts.length - 1];
|
||||
var content = result[attribute];
|
||||
if (content) {
|
||||
var attribute_value = result[attribute];
|
||||
if (attribute_value) {
|
||||
options.name = attribute_parts[0];
|
||||
//options.attribute=attribute;
|
||||
config.debug && console.log('getPreviewContent content', content);
|
||||
previewInstance.getPreviewHTML(options, content,
|
||||
var preview_options = {
|
||||
collection: options.collection,
|
||||
name: options.name,
|
||||
attribute: attribute,
|
||||
query: {_id: result._id},
|
||||
req: options.req
|
||||
};
|
||||
|
||||
config.debug && console.log('getPreviewContent content', attribute_value);
|
||||
previewInstance.getPreviewHTML(preview_options, attribute_value,
|
||||
responder(options, res, next)
|
||||
);
|
||||
} else {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user