Create a Directory Sort Page
The directory page with sort capability will filter based off category. The sort filters can be customized by job type, department, etc. Our recommended card layout is provided when you create a page using this template but you can choose to include additional content or remove the content that is provided.
The legacy Cascade CMS theme includes a Directory Module developed by Hannon Hill as a way to manage online profiles for faculty and staff. The Directory Module was built using an outdated framework and is not compatible with Bootstrap 4.
You must add a directory search page from the Add Content menu first. Follow the steps to create a directory search page in the Cascade Basic Training.
On this page:
Code Structure Overview
There are two sections of code to keep note of when working with the directory sort page. The filter code section contains the filter buttons and identifies filter categories. The profile card “items” code contains all of the profile cards and their respective details. The cards contain a class that corresponds to the filter categories.
The Card Items must be placed inside of the “cbp” parent div wrapper to be included in the sort functionality. <div class="cbp">...</div>
Filter Code Snippet Overview
The filter capability is powered by the Cube Portfolio jQuery grid plugin. The sample directory page contains an audience based category for filters. You may choose to adopt these categories or create your own. The most important element to note is that every filter category should be included as a unique data-filter
attribute and that the unique filter categories for the desired target item is added to it's class attribute.
Each code filter is included in a
<a>
HTML element with the class "cpb-filter-item
"Each category includes the
data-filter
attribute and the title of the category.The All category must include the
data-filter
attribute of"*"
to function properly.
Instructions
Editing Filters
Click on the Source Code <> icon.
In the Source code editor, click on the Format Code icon and then Toggle Fullscreen Mode icon to expand the window size.
Locate the code comments
<!--Filter-->
to identify the filter section of the code to edit.In each
<a>
element, locate thedata-filter
attribute and include a new filter name. Do not remove any punctuation from the filter.data-filter=".category-name"
Update the text in-between the
<a>
tags to update the filter button text.
Adding New Filters
Follow steps 1 through 3 above.
Copy the following code snippet below and paste in the list.
Update the
data-filter
attribute and the button text.<a class="cbp-filter-item btn btn-sm btn-soft-secondary shadow-none py-2 px-3 m-1" data-filter=".category-name" href="javascript:;">Category Name</a>
Profile Card Code Snippet Overview
Each card item comprised of the following code sections:
The Parent Div Wrapper - This the parent element. The parent element contains a series of CSS classes.
Required Classed:
cbp-item
andcategory-filter
- in the example above the category filter class is “staff”. This is required to trigger the sort functionality.Design Classed:
card
,card-bordered
andpx-2
- are all of the required classes that control the design of the card.
The Avatar Image - This is the photo element for the card. To remove the image, select the entire Avatar Div depicted in the HTML Code to delete.
The Profile Details - These are the main details for the profile card.
The Social Media Buttons - These are optional social media icons. From the code view you can quickly identify this section by the code comment:
<!--Social Network-->
To remove all social media links, select all of the code between the code comments to delete.
Social media links use the Font Awesome library.
To link to a social media profile include the full URL in place of the # in the link tag
<a href="#">
Instructions
Editing Profile Cards
When adding a Directory Sort page, the content for the sample profile cards are provided in the second row. Click on the Column Content.
If you are satisfied with the content provided in the card, you can use the WYSIWYG editor to change the content in the sample cards.
Using the Code View to Edit Profile Cards
If you would like to remove content from the card or edit the card using the code view, click on the Source Code <> icon.
In the Source code editor, click on the Format Code icon and then Toggle Fullscreen Mode icon to expand the window size.
Locate the section of the card you would like edit using the code comment notations.
If you are removing a section of a card, make sure to remove the entire HTML element.
Creating New Profile Cards
Copy the Code Snippet below to add a card to the list.
Include the proper category after the
cbp-item
class.Edit the sample content.
<!-- Item -->
<div class="cbp-item filter-category card card-bordered px-2">
<div class="cbp-caption-defaultWrap p-3">
<div class="avatar avatar-lg avatar-circle mb-4">
<img alt="Image Description" class="avatar-img" src="https://themetest-d.nmsu.edu/assets/img/100x100/img1.jpg" />
</div>
<span class="d-block small font-weight-bold text-cap mb-1">Position or Job Title</span>
<h4 class="text-lh-sm text-primary">Full Name</h4>
<p class="mb-0">Department Name</p>
<p class="font-size-1 mb-0">
<a href="#">email@nmsu.edu</a>
</p>
<p class="font-size-1">575-123-4567 | Building, Room 100</p>
<!-- Social Networks -->
<a class="btn btn-xs btn-icon btn-soft-secondary rounded-lg shadow-none " href="#">
<i aria-hidden="true" class="fab fa-twitter"></i>
</a>
<a class="btn btn-xs btn-icon btn-soft-secondary rounded-lg shadow-none " href="#">
<i aria-hidden="true" class="fab fa-linkedin-in"></i>
</a>
<a class="btn btn-xs btn-icon btn-soft-secondary rounded-lg shadow-none " href="#">
<i aria-hidden="true" class="fas fa-link"></i>
</a>
<!-- End Social Networks -->
</div>
</div>
<!-- End Item -->
Related articles
-
Custom Top Navigation (Cascade CMS KB)
-
Create a Directory Sort Page (Cascade CMS KB)
-
Create a Directory Search Page (Cascade CMS KB)
-
Create a Directory Page (Cascade CMS - Basic Training)