silverstripe

SilverStripe 3.1 - Page creating & publishing from the FrontEnd

核能气质少年 提交于 2019-12-01 11:37:00
for our company intranet, I created a page with a Form to create an E-Mailing from the frontend (Create a New E-Mailing Page). The page should be Live after saving the form. I did it like this, but I think I made a mistake somewhere. Because KW1, KW2, Date and SendDate are only visible on the frontend if I go to the backend and click publish again. public static $allowed_actions = array( 'MailingForm' ); public function MailingForm() { $date = new DateField('EndDate', 'Gültig bis'); $date->setConfig('showcalendar', true); $sendDate = new DateField('SendDate', 'Versanddatum'); $sendDate-

Silverstripe 3.1.5 - Upload Error SyntaxError: Unexpected token <

丶灬走出姿态 提交于 2019-12-01 09:11:00
I need to Upload .svg files. To do that I added 'svg' to my config.yml, to the allowed extensions on upload field an to the .htacces in assets/. Also all my assets directories have CHMOD 777. The File gets uploaded but not attached. Instead of that I receive this error in my upload field SyntaxError: Unexpected token < File: allowed_extensions: - svg Image: allowed_extensions: - svg $logo->setAllowedExtensions(array('jpg', 'jpeg', 'png', 'gif', 'svg')); Deny from all <FilesMatch "\.(?i:html|htm|xhtml|js|css|bmp|png|gif|jpg|jpeg|ico|pcx|tif|tiff|au|mid|midi|mpa|mp3|ogg|m4a|ra|wma|wav|cda|avi

Adding a button to the CMS in SilverStripe

三世轮回 提交于 2019-12-01 07:34:27
How do I add a button to the backend of the CMS that fires an action? I can display the button where I want using: public function getCMSFields() { $fields = parent::getCMSFields(); $fields->addFieldsToTab("Root.ButtonTest", array( FormAction::create('doAction', 'Action button') ) ); return $fields; } public function doAction() { //Do something } However the button added does nothing when clicked. I've seen one example of how to put a button on the main action bar (next to save/publish) but that's not what I'm trying to do. Looking at the only page of documentation I can find, do I need to do

Adding a button to the CMS in SilverStripe

廉价感情. 提交于 2019-12-01 05:29:04
问题 How do I add a button to the backend of the CMS that fires an action? I can display the button where I want using: public function getCMSFields() { $fields = parent::getCMSFields(); $fields->addFieldsToTab("Root.ButtonTest", array( FormAction::create('doAction', 'Action button') ) ); return $fields; } public function doAction() { //Do something } However the button added does nothing when clicked. I've seen one example of how to put a button on the main action bar (next to save/publish) but

silverstripe dataobject searchable

╄→гoц情女王★ 提交于 2019-11-29 11:10:57
I´m trying to have certain DataObjects (News) displayed in the default SearchResult Page. So the result should display normal Pages and News. Is there an easy way to accomplish that in Silverstripe 3? Or is it recommended to code it completely custom - I mean a custom controller/action which handles the search request and creates a result list, which I display then in a custom template? I found this, but obviously search is disabled right now: https://github.com/arambalakjian/DataObjects-as-Pages Thx and regards, Florian I usually but together a custom search function after enabling

Silverstripe Uploadify Add fields

醉酒当歌 提交于 2019-11-29 10:20:26
I am looking to attach multiple images to a page in silverstripe (that will act as a rotating gallery eventually) and was wondering if it was possible for a user to add a link for each of these images when uploading each image? Yes. This can be achieved by having a has_many relationship to a custom DataObject which contains an image and a link object in it. In the following example we have a HomePage that has a has_many relationship to Slide . Slide contains an Image and Link . There is some good information on this topic in SilverStripe Lesson 9 - Working with data relationships - $has_many .

How to apply a style to a single special HTML character across the page

让人想犯罪 __ 提交于 2019-11-29 08:46:27
We've got a client who want's to superscript to "registered trademark" (®) character across their website. The website is CMS based and not only are they having trouble consistently superscripting characters but the superscript styling doesn't carry across to any CMS generated page titles etc. I'm wondering what are the possible/ best ways to achieve this: Can CSS be used to apply a style to a specific special character? Using jQuery to apply the style post page load. Extending the template parsing engine (Silverstripe) Any ideas are appreciated. Dave Haigh I dont believe it can be done with

Twitter bootstrap collapse: change display of toggle button

做~自己de王妃 提交于 2019-11-28 17:23:37
I am using Twitter Bootstrap to create collapsible sections of text. The sections are expanded when a + button is pressed. My html code as follows: <div class="row-fluid summary"> <div class="span11"> <h2>MyHeading</h2> </div> <div class="span1"> <button type="button" class="btn btn-success" data-toggle="collapse" data-target="#intro">+</button> </div> </div> <div class="row-fluid summary"> <div id="intro" class="collapse"> Here comes the text... </div> </div> Is there a way to change the button to display - instead of + after the section is expanded (and change back to + when it is collapsed

Silverstripe Uploadify Add fields

萝らか妹 提交于 2019-11-28 03:23:56
问题 I am looking to attach multiple images to a page in silverstripe (that will act as a rotating gallery eventually) and was wondering if it was possible for a user to add a link for each of these images when uploading each image? 回答1: Yes. This can be achieved by having a has_many relationship to a custom DataObject which contains an image and a link object in it. In the following example we have a HomePage that has a has_many relationship to Slide . Slide contains an Image and Link . There is

Twitter bootstrap collapse: change display of toggle button

笑着哭i 提交于 2019-11-27 10:40:25
问题 I am using Twitter Bootstrap to create collapsible sections of text. The sections are expanded when a + button is pressed. My html code as follows: <div class="row-fluid summary"> <div class="span11"> <h2>MyHeading</h2> </div> <div class="span1"> <button type="button" class="btn btn-success" data-toggle="collapse" data-target="#intro">+</button> </div> </div> <div class="row-fluid summary"> <div id="intro" class="collapse"> Here comes the text... </div> </div> Is there a way to change the