Page 1 of 2

Web Pages - Home Tab

Posted: Fri Nov 08, 2019 6:33 am
by marius
Good day.
I've created a custom page with links to other content within the LMS. This page is also set as the default page and is published.
In the User Area in LMS, the Home tab is also activated and set as the default. However when a user logs in, The Home Tab is selected but no content is displayed under it. Am I missing another setting somewhere?
thx

Re: Web Pages - Home Tab

Posted: Fri Nov 08, 2019 8:59 am
by alfa24
can't replicate... I see the content correctly.
Can you upload a screenshot with evidence of the inspector window?

Re: Web Pages - Home Tab

Posted: Fri Nov 08, 2019 10:30 am
by marius
Please see the screenshots attached. Note that this is a client's system running on Google Cloud. The inspector_thunderbird.png also shows that the div "tab_content" is empty and does not contain anything...

We're running version 2.0 and have not updated as it's a live system that the client uses.

Re: Web Pages - Home Tab

Posted: Fri Nov 08, 2019 10:37 am
by alfa24
Nothing is attached.
Anyway, I tested on a 2.2.1, I haven't a 2.0 to try.

Re: Web Pages - Home Tab

Posted: Fri Nov 08, 2019 10:48 am
by marius
I've also found the following error in the browser console mode:

SyntaxError: '' string literal contains an unescaped line break index.php:389:186

When viewing the page source through the debugger it references the following block of code - clearly a javascript block pulling the content for the relevant "default page". I just took out the html table content for easier reading

<script type="text/javascript">
document.getElementById('tab_content').innerHTML = '<div id=\"tabhome_title\"><h1>Dashboard</h1></div><div id=\"tabhome_description\"><h1 style=\"text-align: center;\">Dashboard</h1>
<br /><br />
<p>this is normal</p>
<table style=\"height: 342px; width: 75%; border-collapse: collapse; margin-left: auto; margin-right: auto;\" border=\"0\">
<tbody>
.....
</tbody>
</table></div>';
</script>

Re: Web Pages - Home Tab

Posted: Fri Nov 08, 2019 10:55 am
by marius
I've removed all content and just replaced it with one line of text, and it now seems to work.
I'll keep on adding content to see what html component within tiny_MCE breaks the formatting - seems to insert a line break or single quote ' somewhere that breaks the script

Re: Web Pages - Home Tab

Posted: Fri Nov 08, 2019 11:03 am
by alfa24
Please, provide the line 360 of index.php as the browser renders it.

Re: Web Pages - Home Tab

Posted: Fri Nov 08, 2019 11:09 am
by marius
What I notice is that any unformatted text renders fine, but as soon as any style elements are used it causes syntax error within the script.
This is from 355 - 386:

<div id="inline_no_help" >
No Help Desk

</div>

</div>




<!-- content -->
<div class="row">
<div class="container-fluid">
<!-- welcome page (main tab) -->
<div id="yui-main">
<div class="yui-a">
<div>
<div id="middlearea" class="yui-navset">


<div class="tabs-wrapper">
<ul class="nav nav-tabs hidden-xs slider-menu slider-menu--tabs">
<li ><a href="index.php?r=lms/elearning/show&sop=unregistercourse"><em>E-learning</em></a></li><li class="active" ><a href="index.php?r=lms/home/show&sop=unregistercourse"><em>Dashboard</em></a></li> </ul>
</div>


</div>
</div>
</div> </div>
</div>
<div id="tab_content"></div>
</div>

Re: Web Pages - Home Tab

Posted: Fri Nov 08, 2019 11:12 am
by marius
This script is currently causing the syntax error:

<script type="text/javascript">
document.getElementById('tab_content').innerHTML = '<div id=\"tabhome_title\"><h1>Dashboard</h1></div><div id=\"tabhome_description\"><h1>DASHBOARD</h1>
<br />2020 BETTERBOND (realACHIEVERS) INCENTIVE TRIP (PHUKET)_BOOKING FORMS AND TRIP INFORMATION AVAILABLE HERE <br />(real)UPDATE 13 September 2019 <br />From the Desk of the MD &ndash; September 2019</div>';
</script>

As soon as styling elements are removed it renders fine

Re: Web Pages - Home Tab

Posted: Fri Nov 08, 2019 11:17 am
by alfa24
marius wrote: Fri Nov 08, 2019 11:12 am This script is currently causing the syntax error:

<script type="text/javascript">
document.getElementById('tab_content').innerHTML = '<div id=\"tabhome_title\"><h1>Dashboard</h1></div><div id=\"tabhome_description\"><h1>DASHBOARD</h1>
<br />2020 BETTERBOND (realACHIEVERS) INCENTIVE TRIP (PHUKET)_BOOKING FORMS AND TRIP INFORMATION AVAILABLE HERE <br />(real)UPDATE 13 September 2019 <br />From the Desk of the MD &ndash; September 2019</div>';
</script>

As soon as styling elements are removed it renders fine
I don't see styling elements within this code.