Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ajplopez opened this issue Jan 9, 2024 · 0 comments

Comments

@ajplopez
Copy link

ajplopez commented Jan 9, 2024

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant