Commit 43a16f4f authored by Caleb Weeks's avatar Caleb Weeks

allow title definition in a collection rule

parent 52d86364
......@@ -118,6 +118,7 @@ module.exports = function(parentPath, slingConnector, options, cb){
reasons.push({msg:"Checked for collection", detail:parentPath, result:collection?(collection):"None found."})
if(collection && collection.children){
if(collection.children.allowed){
console.log('call categorizeComponentsByModule with ', collection.children.allowed)
categorizeComponentsByModule(collection.children.allowed, results.suggested);
reasons.push({msg:"Found collection rule", detail:parentPath + "<br>(see previous log entry for details)", result:results.suggested})
......@@ -154,7 +155,7 @@ module.exports = function(parentPath, slingConnector, options, cb){
var id=type + (pageName?(":" + pageName):"");
if(allTypes.indexOf(id)<0){
var component = componentRegistry.get(type), includeIt=false;
var title = component?component.title:"";
var title = pageRules.title || (component?component.title:"");
var parts = type.split("/"), componentClass, longName=[];
for (var i = parts.length; i-- > 0 && !componentClass; ){
if(/^(content|pages|layouts)$/.test(parts[i])){componentClass=parts[i];}
......@@ -171,7 +172,7 @@ module.exports = function(parentPath, slingConnector, options, cb){
var extra=parts[2];
componentClass=componentClass + "-secondary";
if(parts[2]==="pages"){extra = parts[3];}
title=prettyName(extra) + " / " + title;
if(!pageRules.title){title=prettyName(extra) + " / " + title};
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment