使用JavaScript和CSS进行自定义

作为财务公司管理员,您可以通过注入CSS和JavaScript来自定义学习者应用程序,以满足公司的品牌和法规要求,进而完全控制应用程序的外观、布局和交互功能。

如需使用CSS和JS自定义学习者界面,请执行以下操作:

  1. 以管理员身份登录Adobe Learning Manager。

  2. 选择“品牌”,然后选择“CSS和JS配置”。

  3. 选择​“编辑”。

  4. 在相应的选项卡中键入自定义CSS和JS。


    Adobe Learning Manager中的“CSS和JS配置”屏幕,管理员可以在其中添加自定义CSS和JS

  5. 选择“保存”。

自定义设置会显示给所有学习者。

自定义之前

学习者主页菜单设计基于Adobe Learning Manager默认设置。


自定义前Adobe Learning Manager学习者主页

自定义后

添加以下CSS和JS后,学习者主页菜单已根据自定义项进行了更新。

示例CSS:

p{
display:block;
}

.withExtraMargin{
margin-right: 100px!important;
}
.alm-footer-extraMargin{
margin-top:0;
}

.alm-layout-almLayoutContainer{
margin: 0;
    margin-bottom: 5rem;
}
#page-756 #category-970151 .alm-category-card-cardLink
{
    height: 400px;

}
#page-756 #category-970151 .alm-category-card-header
{
height: 240px!important;
}
#page-656 .alm-category-card-cardLink{
    height: 380px;
background: white;
}
#page-656 .alm-category-card-header{
height: 200px!important;
}

#page-746 #html-636797 {
    background-color: #f7f9fc;
}

#page-746 .alm-layout-almLayoutContainer{
row-gap:0;
margin-bottom:0;
}

.alm-category-card-cardLink{
transition: border .3s ease;
}
.navText{
       font-size: 16px;
    cursor: pointer;
}
.submenuDownCaret{
display:none;}
.alm-catalog-container-pageContainer{
max-width: 1720px;
    width: 100%;
    padding: 0 40px;
    padding: 0 40px;
}

.pagenavbarcontainer.newNavbarContainer{
width: 1230px;
    margin: 0 auto;
}
div[automationid="learner-menu-inside-header"]{
margin-right:100px!important;
}
#searchScope,.searchSeparator,#searchInDropdown{
display:none!important;
}
#right-navbar{
    margin-right: 0;
}
#companyLogoImg{
cursor:pointer;
max-width:190px;
}
.alm-catalog-container-filtersContainer{
width:340px;
}
.alm-training-card-v2-imageFlipContainer{
border:none;
}
.newSearchBoxContainer{
border-radius: 5px !important;
    border-width: 2px !important;
    border-color: rgb(5, 32, 34) !important;
}
.searchBoxFlex{
width:250px!important;
flex-direction: row-reverse;
    padding-right: 10px;
}
.searchPlaceholderIcon svg{
    height: 16px;
    width: 16px;
}
.searchPlaceholderIcon svg path{
fill: black;
}
#page-656 .alm-layout-almLayoutContainer {
    padding-bottom: 5rem;
margin-bottom:0!important;
}
#page-656 .alm-strip-widget-header-stripHeaderContainer{
display:none;
}
#page-656 .content-wrapper{
padding-bottom:50px;
}
.myspan{
position: absolute;
    bottom: 10px;
    display: block;
    width: 85%;
    margin-left: 20px;
    margin-right: 20px;
    border-top: 1px solid #efefef !important;
    color: #5a697c !important;
    text-align: right;
    padding-top: 5px;
}
.alm-app-wrapperComponent{
padding-bottom:100px;}

@media (max-width: 768px) {
#page-656 .alm-category-widget-cardRow{
   flex-direction: column;
gap: 40px;
 }
#page-656 .alm-category-widget-stripCardContainerRow{
    width: 100%;
    display: flex;
    justify-content: center;
  }
}

@media (max-width: 768px) {
    .container2-right {
        display: none!important;
    }
.container-1 .content-wrapper{
    padding: 0 20px!important;
 }
}

示例JS:

console.error("Hello Error")

setTimeout(() =>{
// Step 1: Check if #category-284977 is present
const categoryElement = document.querySelector('#category-284977');

if (categoryElement) {
  // Step 2: Find all elements with .alm-category-card-cardLink
  const cardLinks = categoryElement.querySelectorAll('.alm-category-card-cardLink');

  // Step 3: Loop over them and append span with random calculation
  cardLinks.forEach((link, index) => {
    const span = document.createElement('span');

    // Calculate number = (index+1) * 5
    let number = (index + 1) * 5;
if(index === 2){
number = number +2;
}
if(index == 3){
number = number - 7;
}

    span.textContent = `${number} courses`;
    span.classList.add('myspan');
    link.appendChild(span);
  });
}

},2000)


自定义后的Adobe Learning Manager学习者主页

自定义小组件

管理员可以通过应用CSS类来自定义自定义页面上的小组件。 例如,他们可以对齐“内容框”小组件中的文本,或调整“课程和路径”小组件中课程拼贴之间的间距。

小贴士
Inspect“学习者”页面,确定要修改的样式。 复制相关的CSS类并将其粘贴到“CSS和JS配置”页面以应用您的自定义设置。

自定义之前

在添加CSS自定义项之前,以下屏幕为销售工程师培训页面。


自定义前_销售工程师学习者页面_

自定义后

添加以下CSS类后,学习者页面会根据在这些类中定义的样式进行更新。 根据CSS,“内容框”小组件中的文本已靠左对齐,课程拼贴之间的间距现已增加。

.alm-custom-content-box-center {
    align-items: baseline;
    text-align: initial;
}
.alm-training-card-v2-imageContainer {
    border: 14px solid var(--prime-color-white);
    border-radius: -1px;
    height: 106%;
    position: relative;
    transition: all .1s ease-in-out;
}
.alm-course-path-widget-cardRow {
    display: flex;
    gap: 135px;
    margin: 0 0 21px;
    padding: 10px;
}


自定义后的销售工程师学习者页面

小组件的预定义CSS类

以下是一些可用于小部件的预定义CSS类。

小组件名称容器CSS
日历alm-calendar-widget-container
类别alm-category-widget-container
类别卡alm-category-card-container
合规性alm-compliance-container
课程和路径alm-course-path-widget-container
课程和路径学习卡alm-training-card-v2-card
内容框alm-custom-content-box-container
游戏alm-leaderboard-container
社交学习alm-social-learning-container
已自动翻译
使用语言选择器查看此页面的英文版本。
翻译有帮助吗?

Ask AI

Not sure where to start?
Ask me anything about Adobe products.

Type your question or pick a suggestion below.

Use of this AI chatbot is subject to Adobe's Privacy Policy. Don't share sensitive data. AI responses are not your Content, may be inaccurate, and any offers provided are non-binding. Generative AI Terms.