2025-2-26-fixed
This commit is contained in:
19
themes/fluid/layout/_partials/category-chains.ejs
Normal file
19
themes/fluid/layout/_partials/category-chains.ejs
Normal file
@@ -0,0 +1,19 @@
|
||||
<% function render_category_chain(cat) { %>
|
||||
<a href="<%= url_for(cat.path) %>" class="category-chain-item"><%= cat.name.trim() %></a>
|
||||
<% var nextCats = categories.find({ parent: cat._id }).sort(config.index_generator.order_by || 'name').filter(cat => cat.length) %>
|
||||
<% if (nextCats.length > 0) { %>
|
||||
<span>></span>
|
||||
<%- render_category_chain(nextCats.data[0]) %>
|
||||
<% } %>
|
||||
<% } %>
|
||||
|
||||
<span class="category-chains">
|
||||
<% var catsFirst = categories.find({ parent: { $exists: false } }).sort(config.index_generator.order_by || 'name').filter(cat => cat.length) %>
|
||||
<% catsFirst.each((cat, idx) => { %>
|
||||
<% if (typeof(limit) === "undefined" || idx < limit) { %>
|
||||
<span class="category-chain">
|
||||
<%- render_category_chain(cat) %>
|
||||
</span>
|
||||
<% } %>
|
||||
<% }) %>
|
||||
</span>
|
||||
Reference in New Issue
Block a user