我在Thinkific LMS中有一个站点,并且课程概述页面上有一个部分显示课程表。这是在模板代码中动态获取的。我的客户还希望将标题链接到相应的课程。
我找到了代码并添加了链接,但是我需要用课程页面URL的变量替换#。我已经查看了所有支持材料,并在任何地方都找不到该特定变量。
<section class="course-curriculum section-height__medium
{% include 'section_utility_heading_alignment' %}" data-preview-item="course-curriculum">
<div class="course-curriculum__container">
{% include 'section_headings' %}
<article class="section__content">
<ul class="course-curriculum__chapter-list section__body">
{% for chapter in page.course.chapters %}
{% assign index = forloop.index + 1 %}
<li class="course-curriculum__chapter">
{% if index < 10 %}
{% assign chapter_prefix = "0" %}
{% else %}
{% assign chapter_prefix = "" %}
{% endif %}
<div class="course-curriculum__chapter-content-wrapper">
<span class="course-curriculum__chapter-number">{{ index }}</span>
<header class="course-curriculum__chapter-header">
<h5 class="course-curriculum__chapter-title">{{ chapter.name }}</h5>
<span class="course-curriculum__chapter-header__toggle"><i tabindex="0" aria-label="toggle chapter content"></i></span>
</header>
<ul class="course-curriculum__chapter-content" id="chapter-{{ index + 1 }}">
{% for content in chapter.contents %}
<li>
{% if content.free %}
<a href="{{ page.course.links.enroll_free_trial }}" class="course-curriculum__chapter-lesson">
{% else %}
<span class="course-curriculum__chapter-lesson">
{% endif %}
<i class="{{ content.icon_css_class }}"></i><a href="#">{{ content.name }}</a>
{% if content.free %}
<span class="course-curriculum__chapter-lesson--free">{{ 'liquid.partials.course_landing_page_curriculum.label_free' | translate }}</span>
{% endif %}
{% if content.free %}
</a>
{% else %}
</span>
{% endif %}
</li>
{% endfor %}
</ul>
</div>
</li>
{% endfor %}
</ul>
</article>
</div>
</section>
<script>
$(document).ready(function() {
var $header = $('.course-curriculum .course-curriculum__chapter-header');
{% if section.settings.show_collapsed %}
$header.not(":eq(0)").each(function(k,v) {
$(v).parents('.course-curriculum__chapter').addClass('course-curriculum__chapter--collapsed');
$(v).next('.course-curriculum__chapter-content').hide();
});
{% endif %}
$header.on('click keypress', function(e) {
if (e.which === 13 || e.type === 'click') {
e.stopPropagation();
var $content = $(this).next('.course-curriculum__chapter-content');
if($content.is(":visible")) {
$content.slideUp(350).fadeOut(350);
$(this).parents('.course-curriculum__chapter').addClass('course-curriculum__chapter--collapsed');
}
else {
$content.slideDown(350).fadeIn(350);
$(this).parents('.course-curriculum__chapter').removeClass('course-curriculum__chapter--collapsed');
}
}
});
});
</script>
这是我需要添加变量的区域:
<i class="{{ content.icon_css_class }}"></i><a href=" {{ ADD-VERIABLE-HERE }} ">{{ content.name }}</a>
答案 0 :(得分:1)
Thinkific产品团队的Jonathan在这里。
您要寻找的下落是{{ content.take_course_url }}
。请记住,重要的是,如果用户单击此链接并且它不属于免费试用版,则它将使他们重新回到“课程”页面并显示标语消息“您尚未注册此课程”。
如果您想加入我们的FB集团与我们的社区建立联系,则应直接进入https://www.facebook.com/groups/thinkific/
此外,我们在开发人员文档中也听到您的声音。我可以向您保证,我们已经在努力改善这些领域以支持您。与小组中的我们联系,并让Rob知道我已发送给您;)