Skip to content

Timeline JS not appearing on page for logged out users / can't edit as admin #5

@ajplopez

Description

@ajplopez

DNN 9.13
2sxc 16.7.0
TimelineJS2 app version 2.4.0

I have a new site and I installed TimelineJS2 app version 2.4.0 on it. And I'm seeing two issues:

  1. As an admin, clicking on the edit icon doesn't do anything
  2. For non-logged in users, there's a JS error and the Timeline isn't showing

First issue

I dropped the app on the page and (as a SuperUser), I can see the app. When I try to edit the first blue pencil icon, nothing happens. It does not pop open a modal for editing, and no error occurs.

Screenshot 2024-01-09 at 10 47 00 AM

Second Issue

Also, when I'm logged out, the module doesn't appear on the page. I see in the Console this error:

Uncaught (in promise) ReferenceError: $2sxc is not defined
at n.appTimelineJs2.init (index.ts:9:15)
at turn-on.js?v=16.7.0.1704825996&cdv=2:1:5618
n.appTimelineJs2.init @ index.ts:9
(anonymous) @ turn-on.js?v=16.7.0.1704825996&cdv=2:1
Promise.then (async)
(anonymous) @ turn-on.js?v=16.7.0.1704825996&cdv=2:1
t.add @ turn-on.js?v=16.7.0.1704825996&cdv=2:1
t.tryToLoadTag @ turn-on.js?v=16.7.0.1704825996&cdv=2:1
(anonymous) @ turn-on.js?v=16.7.0.1704825996&cdv=2:1
t.checkAndLoadChildren @ turn-on.js?v=16.7.0.1704825996&cdv=2:1
(anonymous) @ turn-on.js?v=16.7.0.1704825996&cdv=2:1
(anonymous) @ turn-on.js?v=16.7.0.1704825996&cdv=2:1
(anonymous) @ turn-on.js?v=16.7.0.1704825996&cdv=2:1

For that, I updated my template to active TurnOn and 2sxc.JsCore like this:

@inherits Custom.Hybrid.RazorTyped
@{
  var page = GetService<ToSic.Sxc.Services.IPageService>();
}

@page.Activate("turnOn", "2sxc.JsCore")


@{
  var timelineJsAttribute = "app-timelinejs2-" + UniqueKey;
}
<div class="app-timelinejs2" @timelineJsAttribute></div>
@Html.Partial("Timeline.PartAssets.cshtml", new { timelineJsAttribute })

And it seems to have started working for the non-logged in users. Is this the correct way to fix this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions