为 Thinkific 模板获取课程 url 变量(流动语言)
Get lesson url variable (liquid language) for Thinkific template
我在 Thinkific LMS 中有一个站点,课程概览页面上有一个部分显示课程表。这是在模板代码中动态获取的。我的客户也想 link 相应课程的标题。
我找到了代码并添加了 link,但我需要用课程页面 URL 的变量替换 #。我查看了所有支持 material,但无法在任何地方找到该特定变量。
<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>
来自 Thinkific 产品团队的 Jonathan。
您要查找的掉落物是 {{ content.take_course_url }}
。请务必牢记,如果用户单击此 link 而它不是免费试用的一部分,那么它会将他们带回课程页面并显示 "You are not enrolled in this course" 的横幅消息。
如果您想加入我们的 FB 群组与我们的社区建立联系,您应该前往 https://www.facebook.com/groups/thinkific/
此外,我们还听到了您关于开发者文档的意见。我可以向您保证,我们已经在努力改进这些领域以支持您。在群里与我们联系,让 Rob 知道我派你来了 ;)
我在 Thinkific LMS 中有一个站点,课程概览页面上有一个部分显示课程表。这是在模板代码中动态获取的。我的客户也想 link 相应课程的标题。
我找到了代码并添加了 link,但我需要用课程页面 URL 的变量替换 #。我查看了所有支持 material,但无法在任何地方找到该特定变量。
<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>
来自 Thinkific 产品团队的 Jonathan。
您要查找的掉落物是 {{ content.take_course_url }}
。请务必牢记,如果用户单击此 link 而它不是免费试用的一部分,那么它会将他们带回课程页面并显示 "You are not enrolled in this course" 的横幅消息。
如果您想加入我们的 FB 群组与我们的社区建立联系,您应该前往 https://www.facebook.com/groups/thinkific/
此外,我们还听到了您关于开发者文档的意见。我可以向您保证,我们已经在努力改进这些领域以支持您。在群里与我们联系,让 Rob 知道我派你来了 ;)