简体   繁体   English

$ 2sxc未定义

[英]$2sxc is not defined

After adding Content module to a page, I just get a round blue icon with white glasses. 将内容模块添加到页面后,我得到的是带有白色眼镜的圆形蓝色图标。 Clicking on it produces an error in the console: 单击它会在控制台中产生错误:

ReferenceError: $2sxc is not defined 1 ui.html:20:5
<anonymous> http://localhost/DotNetNuke/desktopmodules/tosic_sexycontent/dist/ng/ui.html:20:5

Clicking 'Change Template / Layout' in pencil menu also does nothing. 在铅笔菜单中单击“更改模板/布局”也无效。 This happened after upgrading from 2sxc 8.12 to 9.02. 从2sxc 8.12升级到9.02后发生了这种情况。 I checked the file and of course could not see $2sxc defined anywhere. 我检查了文件,当然在任何地方都看不到$ 2sxc。 I have installed on other sites and not had this problem, but it is failing on my localhost installation. 我已经在其他站点上进行了安装,并且没有出现此问题,但是在我的localhost安装上失败了。 DNN 9.1.1 I have tried uninstalling 2sxc and deleting all the Tosic... files I can find, then reinstalling, but I get the same results. DNN 9.1.1我尝试卸载2sxc并删除所有可以找到的Tosic ...文件,然后重新安装,但得到的结果相同。

Similar to: Having some issues with 2sxc version 9.x: unable to select App/Content layout 类似于: 2sxc 9.x版存在一些问题:无法选择应用程序/内容布局

Does anyone know how to fix this? 有谁知道如何解决这一问题? Thx. 谢谢。

I fixed this after a little debugging and following the code. 经过一点调试并遵循代码后,我修复了此问题。 The problem happens on localhost implementations. 该问题发生在localhost实现上。 There is a file: DesktopModules\\ToSIC_SexyContent\\dist\\ng\\ui.html that contains the code in a script container: 有一个文件: DesktopModules\\ToSIC_SexyContent\\dist\\ng\\ui.html ,该文件包含脚本容器中的代码:

var
  path = window.location.pathname,
  isDevMode = window.location.hostname === 'localhost',
  apiUrl;

The problem is that it thinks it is in 'DevMode' when it is on localhost and therefore sets: 问题在于,当它位于本地主机上时,它认为它处于“ DevMode”中,因此设置为:

devPath = 'http://2sxc.dev/desktopmodules/tosic_sexycontent/dist/a4/';

which is certainly not a valid URL on my system, and apparently not on the web either. 在我的系统上,这肯定不是有效的URL,显然在网络上也是如此。 So the solution is to have it avoid 'DevMode' and everything works as it should. 因此解决方案是使它避免使用“ DevMode”,并且一切正常进行。 I did this by modifying the 'localhost' to be 'xlocalhost' and it worked like a charm. 我通过将'localhost'修改为'xlocalhost'来做到这一点,它像一个魅力一样工作。 You could also just set it to false. 您也可以将其设置为false。

因此,这是该版本中的错误,现已修复。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM