问题标签 [silverstripe]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
302 浏览

php - Subdomain Issue

I am working on a silverstripe subdomains' issue, someone else did the code, so any help would be appreciated.

There is a "About Us" nav bar on the main website eg www.mainwebsite.com, and we would like the "About Us" to disappear for any subdomains eg subdomain.mainwebsite.com.

I can see from the Silverstripe backend, there is a 'Hide in Subdomains' function, and I ticked it. However, the "About Us" link disappears for some time and it comes back at other tomes on both main site and subdomains.

Can anybody point me to the right direction how can I fix this problem? I can copy any code here if you need. Please help.

Thanks heaps, S:)

add comments, I have found this code in my page.php in my site - code folder if it is useful

add comments, here is navigation part in Page.ss in the theme - templates folder I am using

add comments, here is what my navigation.ss in the templates - includes folder looks like

Sorry it is a bit long but any help is appreciated. Thanks.

Hi everyone, it seems to be working now when I deleted <% cached 'Navigation', Aggregate(Page).Max(LastEdited) %> <% end_cached %> in page.ss. Can someone please kindly explain what was this line for or the meaning of it? Thanks.

0 投票
1 回答
362 浏览

content-management-system - SilverStripe 博客模块翻译

我注意到 SS 的博客模块有硬编码的文本片段——我需要翻译(法语)。我发现代码在 /blog/templates/Includes/BlogSummary.ss 但是当我修改它时,前端没有任何变化......

我试图运行 /dev/build/?flush=all 但什么都没有......仍然。

任何想法?帮助将不胜感激。提前致谢。

0 投票
2 回答
3090 浏览

validation - Silverstripe - 带有自定义模板的表单显示错误的验证错误

我有以下自定义表格

我这个表格的模板是

当我提交表格时,不是“请填写”客户“,而是必填项。” 消息我收到“请填写”这个“,它是必需的。”

除了详细信息字段之外的所有字段都发生这种情况!

有人可以告诉我我做错了什么吗?这太痛苦了...

0 投票
1 回答
646 浏览

forms - Silverstripe - 通用搜索表单在安全/登录页面上不起作用

我在 Page.php 文件中定义了一个搜索表单

函数 AdvancedSearchForm() { $searchText = isset($this->Query) ?$this->Query : '搜索'; $searchText2 = isset($this->Subquery) ?$this->子查询:'0'; $searchText3 = isset($this->documentType) ?$this->documentType : '全部';

}

并且我的所有页面都是从 Page 扩展而来的,并且搜索表单位于标题中,因此出现在所有页面上。但是当用户在安全/登录页面上并尝试搜索某些内容时,他会收到以下错误消息

我认为这是因为安全页面没有从页面扩展。如何设置搜索,以便它可以在任何页面上工作,包括系统页面,例如安全登录页面?

0 投票
1 回答
682 浏览

tinymce - Silverstripe - 通过前端的博客模块博客条目,但 tinymce 中缺少图像上传/插入按钮

我们允许用户通过前端创建博客条目。但由于某种原因,tinymce 编辑器没有图像上传按钮。作者必须将图像从桌面拖到 tinymce 才能插入图像。

有没有办法添加图片按钮,允许作者上传图片并在他们的博客中使用它们?

也刚刚意识到,也没有“链接”按钮

截屏

0 投票
1 回答
588 浏览

php - PHP Foreach 在里面用创建一个新的对象

我对如何修改以下生成表单以允许$Show->DateTimes()自动生成一组新字段并根据可用日期的数量填充价格的代码有点困惑。

我不确定这是否可能。虽然我在注释中添加了 foreach 来解释我认为它应该如何工作,但我认为我只是把我的 PHP 搞混了。

我现在有这个代码:

编辑:最终固定代码:

0 投票
1 回答
1216 浏览

php - 带位置/交互的​​ Silverstripe 控制 -1

我希望能够控制/循环通过我的数据来生成以下内容:

我知道我可以在控件中使用 Pos,尽管我需要从 0 开始。如果我能在 SS 模板中进行简单的数学计算就好了。我想不出我怎么能做到这一点。

0 投票
2 回答
540 浏览

regex - Coda 的语法模式不起作用 - 正则表达式问题

我有以下 SyntaxDefinition.xml 文件,用于为 SilverStripe(.ss) 文件创建语法突出显示。但是,我收到以下代码的正则表达式错误:

我希望此代码的“变量”部分为任何以美元符号开头的代码着色,例如 $Content。

0 投票
1 回答
525 浏览

javascript - Silverstripe 中 TinyMCE 的重新格式化代码

当我在 TinyMCE 中放入一些 HTML/avascript 代码时,代码会在保存页面后重新格式化或消失。我想禁用它。有什么办法可以阻止重新格式化?

0 投票
1 回答
188 浏览

emacs - Silverstripe 模板,html 模式

试图获得一种与 silverstipe 模板一起使用的模式,但<% end_control %>会破坏缩进,但<% nd_control %>不会。它必须是"<% end",但我坚持如何解决它。