silverstripe

SilverStripe gridfield multi class editor has invalid sort() column

风格不统一 提交于 2019-12-24 12:51:16
问题 I am having trouble setting the SortOrder of a nested has_many relationship where the child items are drag and drop reorder-able though the Orderable Rows module of Gridfield Extensions. I am also using the Multi Class Editor I have a Page that has many ComplexStrips . These ComplexStrip objects have many 'LinkedObjects'. The issue: When I try to add a ComplexStrip via the GridField I get the following error: Uncaught InvalidArgumentException: Invalid sort() column My Setup: Page Class: This

Adding Custom CsvBulkUploader to ModelAdmin in Silverstripe

混江龙づ霸主 提交于 2019-12-24 11:53:29
问题 after looking at the documentation for the built-in CSV importing, it's still not clear to me how to add a custom CsvBulkUploader to ModelAdmin. I see how you can easily add the default uploader and how you can create a custom controller for importing but it's not clear to me how you would add this to a ModelAdmin. I've spent the morning looking through Stack Overflow and the SilverStripe community forums, but haven't been able to find anything yet. Any direction would be greatly appreciated!

Adding Custom CsvBulkUploader to ModelAdmin in Silverstripe

╄→гoц情女王★ 提交于 2019-12-24 11:48:03
问题 after looking at the documentation for the built-in CSV importing, it's still not clear to me how to add a custom CsvBulkUploader to ModelAdmin. I see how you can easily add the default uploader and how you can create a custom controller for importing but it's not clear to me how you would add this to a ModelAdmin. I've spent the morning looking through Stack Overflow and the SilverStripe community forums, but haven't been able to find anything yet. Any direction would be greatly appreciated!

SilverStripe default content author permissions

匆匆过客 提交于 2019-12-24 09:17:23
问题 The default value for Manage site configuration is off security > groups > content authors > permissions Although it's possible to simply check the box and activate this, I would rather have this on by default for every SS installation. How can the default value for this be set to on ? 回答1: This should do as required, make an extension of Group and add a requireDefaultRecords function, this is called on every dev build. This function is to look for that permission and if not existing create

Silverstripe - Blog post ordering

二次信任 提交于 2019-12-24 07:34:32
问题 Thought this would be fairly easy but I seem to be struggling with this. How does the Silverstripe blog sort its posts? I want to pin a specific blog post to the top of the list so I created a SortOrder field and gave it a value of 1. Tried to sort by SortOrder and then by PublishDate but it only seems to sort by PublishDate all the time. Even changing this on the blog model doesn't do anything: private static $default_sort = '"PublishDate" IS NULL DESC, "PublishDate" DESC' ; 回答1: Updating

Silverstripe mod_rewrite issue (I think)

我的梦境 提交于 2019-12-24 04:44:12
问题 A site I've been working on, which has been working fine on my local dev and live dev environments is giving me issues when I try to deploy it to a live server (the client wants to host it with their existing hosting provider). I uploaded the site to the server and updated the database config as I have done many times before on both my and other's servers without issue. This time, however, I was presented with: SilverStripe Framework requires a $databaseConfig defined. When I removed the

Resize images on upload

我的未来我决定 提交于 2019-12-24 03:08:48
问题 How it would be possible to resize the images when uploading them? There exists i.e. the function: $image->resizeByWidth(width) Where it can be implemented for having a resizing of the images which are uploaded? How could it be added to the following example of upload: class GalleryPage extends Page { private static $many_many = array( 'GalleryImages' => 'Image' ); function getCMSFields() { $fields = parent::getCMSFields(); $fields->addFieldToTab( 'Root.Upload', $uploadField = new UploadField

silverstripe Sitetree onAfterWrite - renderWith Error: Template not found

元气小坏坏 提交于 2019-12-24 02:59:10
问题 for the automated generation of pdfs from the page content I want to use the renderWith function within onAfterWrite in the Page Class (later with DOMPDF the PDF will be generated from the returned HTML): public function onAfterWrite() { parent::onAfterWrite(); $this->renderPdf(); } public function renderPdf() { return $this->renderWith(array('Pdf')); } There is always this Error returned when saving the Page: None of these templates can be found in theme 'mytheme': Pdf.ss The Template exists

Silverstripe Custom Validator on Uploadfield

一曲冷凌霜 提交于 2019-12-24 02:24:22
问题 I am using foresight.js to load hi-res images for retina devices. Foresight attempts to replace lo-res images with 2x-pixel density images. Since foresight attempts to replace lo-res images before the page has rendered, it is not possible for me to use the GD image resizing methods in the template for my resized images. So, I am allowing the SS 3.1 cms user to upload one large image and having the system re-size it after upload - leaving a 1x and 2x image in the assets folder. My question is

SilverStripe 4.1 - SS_DEFAULT_ADMIN_USERNAME and PASSWORD not respected

半腔热情 提交于 2019-12-24 00:56:56
问题 I have a SilverStripe 4.1 site (upgraded from 3.4) running on an Ubuntu Vagrant VM. I have the following .env file: # Default Admin SS_DEFAULT_ADMIN_USERNAME="admin" SS_DEFAULT_ADMIN_PASSWORD="password" # DB credentials SS_DATABASE_CLASS="MySQLPDODatabase" SS_DATABASE_SERVER="127.0.0.1" SS_DATABASE_USERNAME="user" SS_DATABASE_PASSWORD="pass" SS_DATABASE_NAME="silverstripe" # environment SS_ENVIRONMENT_TYPE="dev" The site otherwise works, and complains when .env is deleted, so it's being read