Skip to content

Commit

Permalink
add support for menuTitle
Browse files Browse the repository at this point in the history
  • Loading branch information
zspitzer committed Apr 21, 2018
1 parent a303e3b commit 8f8ee8f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
8 changes: 8 additions & 0 deletions api/data/Page.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ component accessors=true {
property name="depth" type="numeric" default=0;
property name="filePath" type="string" default="";
property name="title" type="string" default="";
property name="menuTitle" type="string" default="";
property name="description" type="string" default="";
property name="body" type="string" default="";
property name="sortOrder" type="numeric" default="0";
Expand Down Expand Up @@ -46,6 +47,13 @@ component accessors=true {
children= [];
}

public string function getPageMenuTitle(){
if (len(getMenuTitle()) gt 0)
return getMenuTitle();
else
return getTitle();
}

public struct function getPageLineageMap(){
var lineageMap = {};
for (var l in variables.lineage)
Expand Down
2 changes: 2 additions & 0 deletions builders/html/assets/js/docsEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,8 @@ $(function(){
data.properties.id = "";
if (!data.properties.description)
data.properties.description = "";
if (!data.properties.menuTitle)
data.properties.menuTitle = "";
}
if (data.reference){
if (!data.properties.categories)
Expand Down
4 changes: 2 additions & 2 deletions builders/html/layouts/sideNavTree.cfm
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
</cfscript>
<li class="<cfif local.firstLevelActive>active</cfif> <cfif local.firstLevelCurrent>current</cfif>">
<a href="#local.item.getPath()#.html" itemprop="url">
<span itemprop="name">#HtmlEditFormat(local.item.getTitle())#</span>
<span itemprop="name">#HtmlEditFormat(local.item.getPageMenuTitle())#</span>
</a>
<cfsilent>
<cfscript>
Expand All @@ -31,7 +31,7 @@
subNav.append('<li' &
(local.secondlevelactive eq true ? ' class="active"' : "") &
'><a href="#local.item.getPath()#.html" itemprop="url">' &
'<span itemprop="name">#HtmlEditFormat(local.item.getTitle())#</span>' &
'<span itemprop="name">#HtmlEditFormat(local.item.getPageMenuTitle())#</span>' &
'</a></li>'
);
}
Expand Down

0 comments on commit 8f8ee8f

Please sign in to comment.