silverstripe

SilverStripe 3.1 - Page creating & publishing from the FrontEnd

断了今生、忘了曾经 提交于 2019-12-07 22:28:18
问题 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-

Silverstripe 4 - Authenticator class not found

谁说胖子不能爱 提交于 2019-12-07 19:51:18
问题 I would allow pre-generated users to log out from a SilverStripe 4 website front-end page, by using the default from. Logging out because log in works. The problem is that if a logged generic user tries to log out by clicking on a link like Security/logout (as well as Security/logout?BackURL=home/ ), it being redirected to a blank page (just with header/footer visible, as the default Page.ss is implemented). Apparently the controller doesn't work or similar, because URL points me simply to

How to automaticly publish images in silverstripe dataextension

泄露秘密 提交于 2019-12-07 15:06:54
问题 I was trying to add an uploadfield to a Custom DataExtension and got the Image field working. However the image i uploaded stays in concept mode, and i have to go to the File tab to publish it. I tried to use the code provided in the Silverstripe documentation but this only seems to work on regular pages. I found a question similar to mine:How to automaticaly publish files uploaded to a dataobject in Silverstripe model admin however this only seems to work on DataObjects. This is my current

Silverstripe conditional validation

给你一囗甜甜゛ 提交于 2019-12-07 08:19:26
问题 I have a form which has multiple actions e.g. Create Order & Create Quote. Depending on what action is clicked I need to apply different validation. e.g. Order Ref is not required for a quote. Is this possible within Silverstripe? If not how would I got about it? public function Order($request=null) { $form = Form::create( $this, __FUNCTION__, FieldList::create( TextField::create('Name', 'Your Full Name'), TextField::create('OrderRef', 'Purchase Order #') ), FieldList::create( LiteralField:

Silverstripe Multiple Userforms on one page

南笙酒味 提交于 2019-12-07 04:44:16
问题 I am trying to create a single page that will display multiple userforms in a tabbed view. For example basic contact form, request a quote form etc. I thought I could make a new page type and loop through the children to display the forms, but the $Form variable isn't rendering the form. <% loop $Children %> <div> <h2>$Title</h2> $Form </div> <% end_loop %> Am I missing something here, or is there a different way to render a form using a its ID in a template file? 回答1: You could try the

Silverstripe 3.1 - resize image on upload

泪湿孤枕 提交于 2019-12-06 15:43:26
I want to resize the images while uploading them to save storrage. I tried it like this $visual = new UploadField('Visual', _t('Dict.PREVIEW_IMAGE', 'Preview Image')); $visual->setAllowedExtensions(array('jpg', 'jpeg', 'png', 'gif')); $visual->setFolderName('news/' . $this->ID); $visual->resizeByHeight(10); but the result was an whitescreen in the backend. Is it possible to resize the images on upload? What am I doing wrong? thank you in advance Before you read the answer, please rethink this issue. Do you have a reason why you would want to resize on upload? I actually want my sites to store

SilverStripe 4 - Blank page on logging out

坚强是说给别人听的谎言 提交于 2019-12-06 15:29:27
As I stated here , I would allow pre-generated users to log out from a SilverStripe 4 website front-end page, by using the default from. Logging out because log in works. The problem is that if a logged generic user tries to log out by clicking on a link like Security/logout (as well as Security/logout?BackURL=home/ ), it being redirected to a blank page (just with header/footer visible, as the default Page.ss is implemented). Apparently the controller doesn't work or similar, because URL points me simply to Security/logout with no following redirects. Furthermore, the session is not being

Silverstripe 4 - Authenticator class not found

隐身守侯 提交于 2019-12-06 14:08:06
I would allow pre-generated users to log out from a SilverStripe 4 website front-end page, by using the default from. Logging out because log in works. The problem is that if a logged generic user tries to log out by clicking on a link like Security/logout (as well as Security/logout?BackURL=home/ ), it being redirected to a blank page (just with header/footer visible, as the default Page.ss is implemented). Apparently the controller doesn't work or similar, because URL points me simply to Security/logout with no following redirects. So, I tried to implement a custom authenticator, as I

SilverStripe: Rendering a userforms page type in a template loop

蹲街弑〆低调 提交于 2019-12-06 06:16:12
Using SilverStripe 3.1 I have laid out a FrontPage page type that loops through its children to produce a big tall scrolling page. It has all kinds of different page types in it and I access their templates by creating their controllers on the fly by adding on to the Page class: class Page extends SiteTree { ..... function RenderAsChild($templateName = null) { if(!$templateName) $templateName = $this->ClassName; if(!$this->pageController){ $class = $this->ClassName . "_Controller"; $this->pageController = new $class($this); } return $this->pageController->renderForHolderPage($templateName); }

SilverStripe behind load balancer

谁说我不能喝 提交于 2019-12-06 05:55:08
I've got an instance of SilverStripe running on two servers behind an AWS load balancer. To share the session information I'm running Elasticache Redis server. I'm setting my php session store info as such: ini_set('session.save_handler', 'redis'); ini_set('session.save_path', 'tcp://127.0.0.1:6379'); After I've signed into the admin section of the CMS I can jump between servers and it remembers me, however when switching between sections in the CMS the main section doesn't render (an AJAX call). From what I can tell the other server doesn't realise (which ever one you request from second) you