Two Line Title
Jan 12, 2021
You want TWO LINES for your Course Title?
- In your player Add your Title text with a pipe inbetween the first and second line - like this: First Line | Second Line
- In the Slide Master (master slide) add a slide trigger to execute javascript when the timeline starts on this slide. Add THIS script into the text box:
//this looks for elements on the player
var bob = document.getElementsByClassName("view-content");//this loops thru all of the returned elements
//to find the element that contains the class
for (var i = 0; i < bob.length; i++) {//if it finds a match
if ( bob[i].parentElement.classList.contains( "cs-title" )) {
if( bob[i].textContent.indexOf( "|" ) != -1){
var lineArray = bob[i].textContent.split("|");
var line1 = lineArray[0].trim();
var line2 = lineArray[1].trim();
bob[i].textContent = line1;
bob[i].innerHTML += '<br/>' + line2;
bob[i].style.textAlign = "left";}
//then we break out of the loop
Publish as usual and view. You will have two lines instead of one.
break;
}
}
1 Reply
I only have SL3.
Alas, this trick doesn't quite work in that Classic Player. The JavaScript does apparently add a line break at the pipe. But only the first line of the title appears:
I assume those with SL360 and the Modern Player will have more luck. :-)