silverstripe

Coda syntax highlighting for Silverstripe

拥有回忆 提交于 2019-12-12 18:04:44
问题 I've just moved onto a new machine. On my old work horse, I had Silverstripe template (.ss) files following HTML syntax highlighting in Coda. I can't for the life of me remember how I turned this on (I remember it was something I did myself though). Google has turned up no results. Any suggestions? 回答1: UPDATE: The real way In Coda, open Preferences, go to Editor, at the bottom, add a Custom Syntax Mode. As per this guide: Right click on Coda.app in /Applications and select Show Package

SilverStripe 3.1+ change FileNameFilter default replacements

老子叫甜甜 提交于 2019-12-12 04:26:19
问题 Currently uploading a file with an '_' (underscore) in it is automatically replace with '-' (hyphen). I need them to stay as _ . The same as this issue: https://github.com/silverstripe/silverstripe-cms/issues/719 I've discovered this happens via FileNameFilter http://api.silverstripe.org/master/class-FileNameFilter.html#_setReplacements I've tried to follow the instructions to stop this by adding this to the YAML config: FileNameFilter: default_use_transliterator: false default_replacements:

SilverStripe 3: Alternate value in template within a loop

风格不统一 提交于 2019-12-12 03:35:59
问题 I am trying to create a page that displays the latest images from the child pages of the holder. Each row will alternate between the example below: Large Image | Small Image Small Image | Large Image Large Image | Small Image and so on.... template.ss <div class="row"> <div class="span8"> LARGE IMAGE </div> <div class="span4"> SMALL IMAGE </div> </div> <div class="row"> <div class="span4"> Small Image </div> <div class="span8"> Large IMage </div> </div> </div> <div class="row"> <div class=

SilverStripe Swipestripe - swipestripe-gallery module error

£可爱£侵袭症+ 提交于 2019-12-12 03:35:43
问题 I've installed Swipestripe module. and added swipestripe-gallery module for product images. when I did dev/bulid?flush=1 it shows error Class 'Gallery_PageExtension' does not exists I have seen gallery.yml file in swipestripe-gallery/_config folder, which has Product: extensions: - 'Gallery_PageExtension' but this class is not there in Product.php file in swipestripe-gallery/code folder. After commenting above code I did dev/build?flush=1 & there was no error. But in product page the Gallery

Calling to data object function on upload (SilverStripe)

只愿长相守 提交于 2019-12-12 03:35:20
问题 I have a DataObject class called AdminUpload that stores two variables: UploadDate (which is always going to bet set to the current date) and Total , which is an int. The function updateUploads() is called and stores the current date and increments the Total by 1 each time its called. <?php class AdminUpload extends DataObject { private static $db = array( 'UploadDate' => 'Date', 'Total' => 'int' ); // Tell the datagrid what fields to show in the table private static $summary_fields = array(

DataExtension and canView [closed]

情到浓时终转凉″ 提交于 2019-12-12 02:59:52
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 6 years ago . I like to second this question from the forum: http://www.silverstripe.org/data-model-questions/show/23484 In short: Is it possible to apply the permission methods: canView, canEdit, canDelete, canCreate etc via

Loading a new page with sliding animation in Silverstripe 3 (with Ajax?)

守給你的承諾、 提交于 2019-12-12 02:33:07
问题 I'm working with SilverStripe to build up a new website for a client and now I have the following problem: Each page (and the children of these pages) will have a specific background image and I want that theses background images slide to the side when a new page is loaded instead of loading the whole page as usual (here you can see an example of what I mean: http:// www.thenomadhotel.com/). I guess I have to do that with Ajax or is there a better solution? Since I'm not so familiar with Ajax

Silverstripe returning a populated form via controller

倖福魔咒の 提交于 2019-12-12 02:26:24
问题 I am trying to figure out the correct way of returning back a form that is pre-populated with data from the database. Let me show you how I am doing it right now: TeamsPage: <?php class TeamsPage extends Page { private static $has_many = array ( 'Teams' => 'Team', ); public function getCMSFields() { $fields = parent::getCMSFields(); $fields->addFieldToTab('Root.Teams', GridField::create( 'Teams', 'Teams on this page', $this->Teams(), GridFieldConfig_RecordEditor::create() )); return $fields;

Getting server error when trying to use GridField to create relationship between DataObjects

自作多情 提交于 2019-12-12 02:23:58
问题 I'm learning SilverStripe by creating a small website that lets the user manage their fragrances (i.e. perfumes/colognes). The user adds ingredients (that are used in the fragrances they have), then adds their fragrances, at which point they choose which ingredients are in the fragrance they're adding. I've created the Ingredient and Fragrance classes which both extend DataObject. I've also created the IngredientsPage page which lets the user add/edit/delete ingredients (made up of a name and

Using a form in a custom controller?

岁酱吖の 提交于 2019-12-11 23:57:44
问题 I have created a Register_Controller and have setup a route for it as per below. The RegisterForm renders fine but when you click 'Register' it goes to the following URL: http://website.com/Register_Controller/RegisterForm and displays 'Page not found' and thus is not hitting the doRegister method. What am I doing wrong? Routes.yml --- Name: mysiteroutes After: framework/routes#coreroutes --- Director: rules: 'register': 'Register_Controller' Register_Controller.php <?php class Register