Skip to content

Commit

Permalink
Fix to template view override
Browse files Browse the repository at this point in the history
  • Loading branch information
cliftonc committed Nov 19, 2011
1 parent f8c999f commit 9db1749
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 182 deletions.
9 changes: 7 additions & 2 deletions modules/core/content/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -750,12 +750,17 @@ function showContent(req,res,template,block,next,err,content,format) {
// Set the page layout to the content type
if(format === "html") {
if(content) {

// Change the layout
res.layout = content.layout ? content.layout : "default";

// Override of the template
template = calipso.theme.cache.contentTypes[content.contentType].view || template;
template = calipso.theme.cache.contentTypes[content.contentType] ? calipso.theme.cache.contentTypes[content.contentType].view : template;

}

calipso.theme.renderItem(req,res,template,block,{content:content.toObject()},next);

}

if(format === "json") {
Expand Down Expand Up @@ -875,7 +880,7 @@ function getContentList(query,out,next) {

// Render the item into the response
if(out.format === 'html') {

var table = {id:'content-list',sort:true,cls:'table-admin',
columns:[{name:'_id',sort:'title',label:'Title',fn:contentLink},
{name:'contentType',label:'Type'},
Expand Down
180 changes: 0 additions & 180 deletions test/sanity.test.js

This file was deleted.

0 comments on commit 9db1749

Please sign in to comment.