Skip to content

Commit a87eeaf

Browse files
committed
Introduced a new IndexLabel property
In the previous commit, I introduced a new `IsIndexed` property, which allows an optional table of contents to be exposed on a `ContentList` page (ebbeeff). This commit introduces a new `IndexLabel` which, optionally, allows the label used for any such table of contents to be set. By default, it will be "Contents". As with `IsIndexed`, it's up to implementors as to whether this is exposed in the editor, and how it will be honored in the view.
1 parent ebbeeff commit a87eeaf

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

OnTopic.ViewModels/ContentListTopicViewModel.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,5 +53,19 @@ public class ContentListTopicViewModel: PageTopicViewModel {
5353
/// <returns>True if the content list should be indexed; false otherwise.</returns>
5454
public bool IsIndexed { get; set; }
5555

56+
/*==========================================================================================================================
57+
| INDEX LABEL
58+
\-------------------------------------------------------------------------------------------------------------------------*/
59+
/// <summary>
60+
/// Assuming <see cref="IsIndexed"/>, determines the label to display. Defaults to <i>Contents</i>.
61+
/// </summary>
62+
/// <remarks>
63+
/// Often, if an indexed list of links is provided on a view, it will be preceded with a lable. The <see cref=
64+
/// "IndexLabel"/> allows that to be optionally set on a per topic basis. The default value is "Contents", though it is up
65+
/// to view implementors and editor configurations as to whether this option is exposed or honored.
66+
/// </remarks>
67+
/// <returns>Returns the value set; defaults to "Contents".</returns>
68+
public string IndexLabel { get; set; } = "Contents";
69+
5670
} //Class
5771
} //Namespace

0 commit comments

Comments
 (0)