Handle embedded featured nodes to get node_id
This commit is contained in:
@@ -26,9 +26,15 @@ nav.navbar-secondary
|
|||||||
| {% endfor %}
|
| {% endfor %}
|
||||||
| {% endif %}
|
| {% endif %}
|
||||||
| {% if project.nodes_featured %}
|
| {% if project.nodes_featured %}
|
||||||
|
| {# In some cases featured_nodes might might be embedded #}
|
||||||
|
| {% if '_id' in project.nodes_featured[0] %}
|
||||||
|
| {% set featured_node_id=project.nodes_featured[0]._id %}
|
||||||
|
| {% else %}
|
||||||
|
| {% set featured_node_id=project.nodes_featured[0] %}
|
||||||
|
| {% endif %}
|
||||||
li
|
li
|
||||||
a.navbar-item(
|
a.navbar-item(
|
||||||
href="{{ url_for('projects.view_node', project_url=project.url, node_id=project.nodes_featured[0]) }}",
|
href="{{ url_for('projects.view_node', project_url=project.url, node_id=featured_node_id) }}",
|
||||||
title="Explore {{ project.name }}",
|
title="Explore {{ project.name }}",
|
||||||
class="{% if category == 'blog' %}active{% endif %}")
|
class="{% if category == 'blog' %}active{% endif %}")
|
||||||
span Explore
|
span Explore
|
||||||
|
Reference in New Issue
Block a user