https://www.silverstripe.org/community/forums/rss Re: File Upload Error with Video Files Over 30M https://www.silverstripe.org/community/forums/customising-the-cms/show/120829#post424564 <p>I'm getting the same error when trying to upload the MP4 files, some of them are around 80MB. Does anyone know how to fix this issue?</p> <br /> <p data-swiftype-index="false">Posted to: File Upload Error with Video Files Over 30M | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/show/120829#post424564" class="showLink">Show Thread</a> | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/reply/120829" class="replyLink">Post Reply</a></p> Thu, 28 Sep 2017 12:48:15 +1300 https://www.silverstripe.org/community/forums/customising-the-cms/show/120829#post424564 User selected parameters on Reports https://www.silverstripe.org/community/forums/customising-the-cms/show/122076 <p>I'm having difficulty figuring out how to add a date range to my report. Ideally I want the report to show all records in a 24-hour period. </p><p>This is what I have so far: </p><p><div class="codesnippet"><p>class DailyReport extends SS_Report { </p><p> // the name of the report <br /> public function title() { <br /> return 'Auckland List'; <br /> } </p><p> // what we want the report to return <br /> public function sourceRecords($params = null) { <br /> return NomineeList::get()-&gt;where(array( <br /> '"Venue"' =&gt; 'Auckland' <br /> ))-&gt;sort('Shared'); <br /> } </p><p> function parameterFields() { <br /> $fields = DateField::create('Created', 'Report Day'); <br /> return $fields; <br /> } </p><p> // which fields on that object we want to show <br /> public function columns() { <br /> $fields = array( <br /> 'RunnersFirstName' =&gt; 'First Name', <br /> 'RunnersLastName' =&gt; 'Last Name', <br /> 'RunnersEmail' =&gt; 'Email', <br /> 'Address' =&gt; 'Address', <br /> 'Message' =&gt; 'Message', <br /> 'Name' =&gt; 'Nominated by', <br /> 'Email' =&gt; 'Nominator\'s Email', <br /> 'Shared' =&gt; 'Shared' <br /> ); </p><p> return $fields; <br /> } <br />}</p></div></p> <br /> <p data-swiftype-index="false">Posted to: User selected parameters on Reports | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/show/122076" class="showLink">Show Thread</a> | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/reply/122076" class="replyLink">Post Reply</a></p> Wed, 20 Sep 2017 16:17:38 +1200 https://www.silverstripe.org/community/forums/customising-the-cms/show/122076 Returning $this->customise with an #anchor https://www.silverstripe.org/community/forums/customising-the-cms/show/121911 <p>OK so I've been racking my brains to figure out the best way of achieving this and wonder if anyone has any experience of ideas?!? </p><p>We've heavily extended a version of MemberProfiles for a MemberDirectory based website and are providing a number of DataObjects within a front-end tab structure for editing. Part of this is an event calendar. Naturally, users what to be able to search for event within specific data criteria. Functionality wise, we've got it all working, but ONLY if we return $this-&gt;customise. This wouldn't normally be an issue, however using the Zurb Foundation 6 framework to display the data within a tab structure, we need to direct the users back to the URL with an #anchor appended to ensure the correct tab re-opens on page launch. </p><p>We can achieve the #anchor and correct page launch using a GET method, but the results won't populate (we assume because MemberProfilePage.php already uses the index() function? Then the $this-&gt;customise will produce the results, but not reload the page on the correct tab (always default). </p><p>So.... is there a way of adding an #anchor to the customise() or renderWith() based on this existing return code? <br />return $this-&gt;customise(array('eventResults' =&gt; $eventResults))-&gt;renderWith(array('MemberProfilePage_profile', 'MemberProfilePage')); </p><p>Any help would be massively appreciated as we're cutting it fine for beta testing and have 2 other little quirks that need addressing :( </p><p>Thanks guys <br />Antony</p> <br /> <p data-swiftype-index="false">Posted to: Returning $this-&gt;customise with an #anchor | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/show/121911" class="showLink">Show Thread</a> | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/reply/121911" class="replyLink">Post Reply</a></p> Tue, 12 Sep 2017 05:59:28 +1200 https://www.silverstripe.org/community/forums/customising-the-cms/show/121911 Left menu and foot menu https://www.silverstripe.org/community/forums/customising-the-cms/show/121860 <p>Hello, so i made two menus, one is left menu and other is foot menu. What i want to do now is to make that you can add pages in admin panel for both menus. I follow to some of tutorials in forum but it wont work on me. The page crashed. I tryed to make a new check box in admin page and then in foot menu made it with if statement so if the checkbox is checked then the page in made in foot menu. Maybe someone can provide me with some good tutorial ? <br />I followed this links <br /><a href="https://www.silverstripe.org/community/forums/customising-the-cms/show/10989">https://www.silverstripe.org/community/forums/customising-the-cms/show/10989</a> <br /><a href="https://www.silverstripe.org/community/forums/general-questions/show/14786">https://www.silverstripe.org/community/forums/general-questions/show/14786</a></p> <br /> <p data-swiftype-index="false">Posted to: Left menu and foot menu | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/show/121860" class="showLink">Show Thread</a> | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/reply/121860" class="replyLink">Post Reply</a></p> Fri, 08 Sep 2017 11:40:49 +1200 https://www.silverstripe.org/community/forums/customising-the-cms/show/121860 Re: Problems extending Member class https://www.silverstripe.org/community/forums/customising-the-cms/show/11027?start=8#post423553 <p>Ok. So if you create a Decorator, it doesn't seem like it can be used in an extended ModelAdmin in this array. <br />private static $managed_models = array( ..... <br />I get a 500 internal error when I add it to this. <br />This thread is so old, is this stuff done differently nowadays? I am using 3.5</p> <br /> <p data-swiftype-index="false">Posted to: Problems extending Member class | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/show/11027?start=8#post423553" class="showLink">Show Thread</a> | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/reply/11027" class="replyLink">Post Reply</a></p> Wed, 02 Aug 2017 14:45:45 +1200 https://www.silverstripe.org/community/forums/customising-the-cms/show/11027?start=8#post423553 Re: [SOLVED] How get the CMS form of a DataObject "getCMSForm" method https://www.silverstripe.org/community/forums/customising-the-cms/show/121288#post423534 <p>Thanks a lot! That is an excellent answer to what I asked. Fortunately I found out today that FormFields have a method called setValue() I really don't know how I missed that (for multiple hours!) <br>Anyway, thank you for your answer!</p> <br> <p data-swiftype-index="false">Posted to: [SOLVED] How get the CMS form of a DataObject "getCMSForm" method | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/show/121288#post423534" class="showLink">Show Thread</a> | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/reply/121288" class="replyLink">Post Reply</a></p> Fri, 21 Jul 2017 04:25:28 +1200 https://www.silverstripe.org/community/forums/customising-the-cms/show/121288#post423534 Re: [SOLVED] How get the CMS form of a DataObject "getCMSForm" method https://www.silverstripe.org/community/forums/customising-the-cms/show/121288#post423533 <p>At a second glance, there are also extension hooks.</p><p>ModelAdmin:<br>- GridFieldDetailForm_ItemRequest: $this-&gt;extend("updateItemEditForm", $form);<br></p><div class="codesnippet"><p>GridFieldDetailForm_ItemRequest:<br> extensions:<br> - MyGridFieldDetailForm_ItemRequestExtension</p><p>class MyGridFieldDetailForm_ItemRequestExtension extends DataExtension {<br>   public function updateItemEditForm($form) {<br>      $form-&gt;loadDataFrom($myRecord);<br>   }<br>}</p></div><p>CMS:<br>- CMSMain: $this-&gt;extend('updateEditForm', $form);<br></p><div class="codesnippet"><p>CMSMain:<br> extensions:<br> - MyCMSMainExtension</p><p>class MyCMSMainExtension extends DataExtension {<br>   public function updateEditForm($form) {<br>      $form-&gt;loadDataFrom($myRecord);<br>   }<br>}</p></div> <br> <p data-swiftype-index="false">Posted to: [SOLVED] How get the CMS form of a DataObject "getCMSForm" method | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/show/121288#post423533" class="showLink">Show Thread</a> | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/reply/121288" class="replyLink">Post Reply</a></p> Fri, 21 Jul 2017 03:51:14 +1200 https://www.silverstripe.org/community/forums/customising-the-cms/show/121288#post423533 Overloading Admin Templates in 4.0 https://www.silverstripe.org/community/forums/customising-the-cms/show/121290 <p>Now that the admin has been split out into a separate module in 4.0, the only way to overload the templates is to have a module that sits above it alphabetically e.g _my-custom-cms/templates/SilverStripe/Admin/Includes/*.ss will override the admin templates, but z-my-custom-cms will not. </p><p>Is there a way to force the admin to use a template regardless of it's folder name? </p><p>Cheers!</p> <br /> <p data-swiftype-index="false">Posted to: Overloading Admin Templates in 4.0 | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/show/121290" class="showLink">Show Thread</a> | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/reply/121290" class="replyLink">Post Reply</a></p> Thu, 20 Jul 2017 03:51:00 +1200 https://www.silverstripe.org/community/forums/customising-the-cms/show/121290 [SOLVED] How get the CMS form of a DataObject "getCMSForm" method https://www.silverstripe.org/community/forums/customising-the-cms/show/121288 <p>Hi all,</p><p>I am saving custom text fields in the CMS, what I mean by that is that where normally you'd have a DataObject with <br> </p><div class="codesnippet"><p>private static $db = array(<br>'MyField' =&gt; 'Text'<br>);</p></div><br>And you then have <br><div class="codesnippet"><p>public function getCMSFields(){<br>...<br>TextField::create('MyField', 'Title of the field: ')<br>...<br>}</p></div> To add the fields to the form.<p>Well I am not using matching field names because I have custom save logic in place that saves the data some other way. So now I need to populate these textfields with data. Right now everytime you reload the CMS the fields are empty.</p><p>So what I'd like to to is<br>or: </p><div class="codesnippet"><p>TextField::create('MyCustomNameThatDoesNotMatch', 'Title of the field: ', 'Initial data that the user is editing')</p></div><br><strong>or (what I see as feasable): Some method that returns me the Form instance of the CMS Form so I can use loadDataFrom on it to populate the fields with the data.</strong><p>I really hope this is possible so I can continue working :)</p><p>Thank you all for reading this!</p> <br> <p data-swiftype-index="false">Posted to: [SOLVED] How get the CMS form of a DataObject "getCMSForm" method | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/show/121288" class="showLink">Show Thread</a> | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/reply/121288" class="replyLink">Post Reply</a></p> Tue, 18 Jul 2017 01:54:55 +1200 https://www.silverstripe.org/community/forums/customising-the-cms/show/121288 Re: Admin Login template https://www.silverstripe.org/community/forums/customising-the-cms/show/18465?start=8#post423509 <p><a href="https://www.silverstripe.org/learn/lessons/adding-dynamic-content">SilverStripe doesn’t have a custom template for the login form by default. Instead, it injects it into your default page type.</a> <br />Check out <a href="http://tamethebackbutton.blogspot.ca/2009/09/customize-your-own-silverstripe-login.html">this article</a> here which may help.</p> <br /> <p data-swiftype-index="false">Posted to: Admin Login template | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/show/18465?start=8#post423509" class="showLink">Show Thread</a> | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/reply/18465" class="replyLink">Post Reply</a></p> Tue, 11 Jul 2017 00:33:33 +1200 https://www.silverstripe.org/community/forums/customising-the-cms/show/18465?start=8#post423509 Re: Customize Upload Manager for Images https://www.silverstripe.org/community/forums/customising-the-cms/show/24110#post423491 <p>4 Years late to the party lol :o but for anyone wanting to know the answer to how we can extend the default image fields, heres how you do it: </p><p>Instead of creating a whole new <span style="color:red">FieldList</span> and replacing the default fields on the image object as seen with the example below... <br /><div class="codesnippet"><p>public function getCustomFields() { <br /> $fields = new FieldList(); <br /> $fields-&gt;push(new TextField('Title', 'Titel')); <br /> $fields-&gt;push(new TextField('Filename', 'Dateiname')); <br /> $fields-&gt;push(new TextField('Alt', 'Alt')); <br /> $fields-&gt;push(new TextField('Photographer', 'Fotograf')); <br /> $fields-&gt;push(new DropdownField('Owner', 'Eigent&amp;uuml;mer')); <br /> $fields-&gt;push(new DropdownField('Folder', 'Ordner')); <br /> return $fields; <br /> }</p></div> </p><p>You can simply just utilise <span style="color:red">updateCMSFields</span> on your DataExtension <br /><div class="codesnippet"><p>public function updateCMSFields(FieldList $fields) <br />{ <br /> $photographer = new TextField('Photographer', 'Photographer'); <br /> $fields-&gt;addFieldToTab('Root.Main', $photographer); <br /> }</p></div> </p><p>By updating the FieldList with the new fields (not overwriting) will solve your problem for the default view being removed :) </p><p>Hope this helps, <br />Spotelf13, signing out.</p> <br /> <p data-swiftype-index="false">Posted to: Customize Upload Manager for Images | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/show/24110#post423491" class="showLink">Show Thread</a> | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/reply/24110" class="replyLink">Post Reply</a></p> Mon, 03 Jul 2017 16:24:54 +1200 https://www.silverstripe.org/community/forums/customising-the-cms/show/24110#post423491 Re: Gridfield filters not working on production https://www.silverstripe.org/community/forums/customising-the-cms/show/101343#post423481 <p>Not solved for me. Not working for me on 2.4. This has something to do with server environment. I have local running on apache 2.2 with php 5.3 (filters work) and a dev server apache 2.4 with php 5.6 (filters do not work). Suhosin is not running on either. I know... 2.4.</p> <br /> <p data-swiftype-index="false">Posted to: Gridfield filters not working on production | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/show/101343#post423481" class="showLink">Show Thread</a> | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/reply/101343" class="replyLink">Post Reply</a></p> Tue, 27 Jun 2017 22:26:53 +1200 https://www.silverstripe.org/community/forums/customising-the-cms/show/101343#post423481 Re: Add checkbox within visibility in page settings https://www.silverstripe.org/community/forums/customising-the-cms/show/25147#post423444 <p>Update: I was trying to add this within the standard getCMSFields - I missed that you were actually updating <strong>getSettingsFields</strong> separately. <br />Leaving this here in case anyone else makes the same mistake</p> <br /> <p data-swiftype-index="false">Posted to: Add checkbox within visibility in page settings | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/show/25147#post423444" class="showLink">Show Thread</a> | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/reply/25147" class="replyLink">Post Reply</a></p> Tue, 20 Jun 2017 04:31:10 +1200 https://www.silverstripe.org/community/forums/customising-the-cms/show/25147#post423444 Re: Add checkbox within visibility in page settings https://www.silverstripe.org/community/forums/customising-the-cms/show/25147#post423443 <p>Any idea how this is done in 3.5+ ? <br />If I add to Root.Settings then I get a new 'Settings' tab in the main area - is it possible to add a field into the existing Settings area in 3.5+ as you've done here?</p> <br /> <p data-swiftype-index="false">Posted to: Add checkbox within visibility in page settings | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/show/25147#post423443" class="showLink">Show Thread</a> | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/reply/25147" class="replyLink">Post Reply</a></p> Tue, 20 Jun 2017 04:17:43 +1200 https://www.silverstripe.org/community/forums/customising-the-cms/show/25147#post423443 How to create a Time field with 3 decimal places? https://www.silverstripe.org/community/forums/customising-the-cms/show/121218 <p>Hej there. </p><p>I have to handle race data. The time format for race time and laps is h:mm:ss.xxx, eg. 1:19:02.394. </p><p>A Time field only offers hh:mm:ss format and a max value of 23:59:59. Is there a way to change the format to hh:mm:ss.xxx and to allow hours beyond 23? </p><p>Thanks in advance. </p><p>Best, Mario</p> <br /> <p data-swiftype-index="false">Posted to: How to create a Time field with 3 decimal places? | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/show/121218" class="showLink">Show Thread</a> | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/reply/121218" class="replyLink">Post Reply</a></p> Wed, 07 Jun 2017 06:32:25 +1200 https://www.silverstripe.org/community/forums/customising-the-cms/show/121218 Re: Adding Custom CsvBulkUploader to Model Admin https://www.silverstripe.org/community/forums/customising-the-cms/show/121197#post423373 <p>I figured it out. <a href="https://stackoverflow.com/questions/44271755/adding-custom-csvbulkuploader-to-modeladmin-in-silverstripe">Long answer is here.</a> </p><p>Short answer is that you can create a custom uploader by extending off of CsvBulkLoader and then simply declare it in your ModelAdmin within <strong>$model_importers</strong>.</p> <br /> <p data-swiftype-index="false">Posted to: Adding Custom CsvBulkUploader to Model Admin | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/show/121197#post423373" class="showLink">Show Thread</a> | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/reply/121197" class="replyLink">Post Reply</a></p> Thu, 01 Jun 2017 02:33:36 +1200 https://www.silverstripe.org/community/forums/customising-the-cms/show/121197#post423373 Re: Added a new page in admin cms but after reload, it is not under admin cms https://www.silverstripe.org/community/forums/customising-the-cms/show/121201#post423369 <p>minor modifications needed. finally found solution myself. <br />Added new function in controller. and loop used for displaying in template file. this solved my problem. <br /><div class="codesnippet"><p>public function getViewEmails() { <br /> $hash=''; <br /> $getmem=Member::currentUser(); <br /> if($getmem-&gt;RainloopEmail !='' &amp;&amp; $getmem-&gt;Pass !='') <br /> { <br /> $com=$getmem-&gt;RainloopEmail.":".$getmem-&gt;Pass; <br /> $encrypted = base64_encode($getmem-&gt;RainloopEmail) ; <br /> $rainloopemail=$encrypted; <br /> $encrypted =base64_encode($getmem-&gt;Pass); <br /> $pss=$encrypted; </p><p> $hash=base64_encode($com); </p><p> } <br /> else <br /> { <br /> $rainloopemail=''; <br /> $pss=''; <br /> $com=$getmem-&gt;RainloopEmail.":".$getmem-&gt;Pass; <br /> $hash=base64_encode($com); </p><p> } <br /> $url='http://op.mctitsolutions.com/rainloop/rainloop.php?hash='.$hash; <br /> return new ArrayList(array( <br /> new ArrayData(array( <br /> 'Url'=&gt;$url, <br /> 'Width' =&gt; '100%', <br /> )) <br /> )); <br />}</p></div> <br />Here is my template file. <br /><div class="codesnippet"><p>&lt;div style="padding:55px 20px"&gt; </p><p>&lt;% loop ViewEmails %&gt; <br />&lt;iframe id="MainPopupIframe" width="$Width" height="605px" src="$Url"&gt; <br /> &lt;/iframe&gt; <br /> &lt;% end_loop %&gt; <br />&lt;/div&gt;</p></div></p> <br /> <p data-swiftype-index="false">Posted to: Added a new page in admin cms but after reload, it is not under admin cms | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/show/121201#post423369" class="showLink">Show Thread</a> | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/reply/121201" class="replyLink">Post Reply</a></p> Wed, 31 May 2017 19:35:58 +1200 https://www.silverstripe.org/community/forums/customising-the-cms/show/121201#post423369 Added a new page in admin cms but after reload, it is not under admin cms https://www.silverstripe.org/community/forums/customising-the-cms/show/121201 <p>I am trying to add new settings page and emails page. When you click on emails menu, it is under silverstripe admin cms but After reloading Emails page, it is not under silverstripe admin cms. </p><p>Here is controller code: <br /><div class="codesnippet"><p>public function index() { <br /> $getmem=Member::currentUser(); <br /> if($getmem-&gt;RainloopEmail !='' &amp;&amp; $getmem-&gt;Pass !='') <br /> { <br /> $com=$getmem-&gt;RainloopEmail.":".$getmem-&gt;Pass; <br /> $encrypted = base64_encode($getmem-&gt;RainloopEmail) ; <br /> $rainloopemail=$encrypted; <br /> $encrypted =base64_encode($getmem-&gt;Pass); <br /> $pss=$encrypted; </p><p> $hash=base64_encode($com); </p><p> } <br /> else <br /> { <br /> $rainloopemail=''; <br /> $pss=''; <br /> $com=$getmem-&gt;RainloopEmail.":".$getmem-&gt;Pass; <br /> $hash=base64_encode($com); </p><p> } <br /> $url='http://op.mctitsolutions.com/rainloop/rainloop.php?hash='.$hash; <br /> $arrayData = new ArrayData(array( <br />'Width' =&gt; '100%', <br />'Height' =&gt; '100%', <br />'Location'=&gt;$url )); </p><p>return $arrayData-&gt;renderWith(Array('EmailsAdminController_Content','Coach_message','Page')); </p><p>}</p></div> <br />And here is template file code: <br /><div class="codesnippet"><p>&lt;div style="padding:55px 20px"&gt; <br />$EditForm <br />&lt;iframe id="MainPopupIframe" width="$Width" height="605px" src="$Location"&gt;&lt;/iframe&gt; <br />&lt;/div&gt;</p></div></p> <br /> <p data-swiftype-index="false">Posted to: Added a new page in admin cms but after reload, it is not under admin cms | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/show/121201" class="showLink">Show Thread</a> | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/reply/121201" class="replyLink">Post Reply</a></p> Tue, 30 May 2017 22:31:16 +1200 https://www.silverstripe.org/community/forums/customising-the-cms/show/121201 Adding Custom CsvBulkUploader to Model Admin https://www.silverstripe.org/community/forums/customising-the-cms/show/121197 <p>Hi, after looking at the <a href="https://docs.silverstripe.org/en/3/developer_guides/integration/csv_import">documentation</a> 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 <a href="https://docs.silverstripe.org/en/3/developer_guides/integration/csv_import#import-through-modeladmin">add the default uploader</a> and how you can <a href="https://docs.silverstripe.org/en/3/developer_guides/integration/csv_import#import-through-a-custom-controller">create a custom controller for importing</a> 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 SS community forums, but haven't been able to find anything yet. Any direction would be greatly appreciated!</p> <br /> <p data-swiftype-index="false">Posted to: Adding Custom CsvBulkUploader to Model Admin | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/show/121197" class="showLink">Show Thread</a> | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/reply/121197" class="replyLink">Post Reply</a></p> Sat, 27 May 2017 05:54:25 +1200 https://www.silverstripe.org/community/forums/customising-the-cms/show/121197 Re: Changing UploadField "Select from files" default display order of all files from alphabetical to 'Created DESC' ? https://www.silverstripe.org/community/forums/customising-the-cms/show/121194#post423357 <p>Update: So for the moment I've done this by directly editing the UploadField.php file in framework/forms (I know, I shouldn't) <br />On line 1595 I added -&gt;sort('Created DESC') <br /><div class="codesnippet"><p>$files = DataList::create($baseClass)-&gt;exclude('ClassName', 'Folder')-&gt;sort('Created DESC');</p></div> </p><p>I'm going to submit this on Github as a suggested update</p> <br /> <p data-swiftype-index="false">Posted to: Changing UploadField &quot;Select from files&quot; default display order of all files from alphabetical to &#039;Created DESC&#039; ? | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/show/121194#post423357" class="showLink">Show Thread</a> | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/reply/121194" class="replyLink">Post Reply</a></p> Fri, 26 May 2017 03:24:36 +1200 https://www.silverstripe.org/community/forums/customising-the-cms/show/121194#post423357 Changing UploadField "Select from files" default display order of all files from alphabetical to 'Created DESC' ? https://www.silverstripe.org/community/forums/customising-the-cms/show/121194 <p>Since 3.2 the UploadField "Select from files" shows files in all folders by default. It looks like these are in alphabetical order at the moment — is there an easy way to change the default to display these by newest files first? </p><p>At the moment this requires clicking on the 'Created' header twice each time before then selecting the file - and on a site with a lot of files this can be very slow. If you're choosing adding a lot of files that you've just uploaded to data objects this could be very helpful.</p> <br /> <p data-swiftype-index="false">Posted to: Changing UploadField &quot;Select from files&quot; default display order of all files from alphabetical to &#039;Created DESC&#039; ? | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/show/121194" class="showLink">Show Thread</a> | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/reply/121194" class="replyLink">Post Reply</a></p> Fri, 26 May 2017 03:03:35 +1200 https://www.silverstripe.org/community/forums/customising-the-cms/show/121194 Creating a shortcode that handles collections of data https://www.silverstripe.org/community/forums/customising-the-cms/show/121192 <p>In my project I have a Feature class that extends DataObject. In Feature, I've defined a short code called `GetFeatureById`:</p><p></p><div class="codesnippet"><p>public static function GetFeatureById($arguments, $content = null, $parser = null, $tagName) {<br> $id = (int)$arguments['id'];<br> $feature = DataObject::get_by_id('Feature', $id);</p><p> $arrayData = new ArrayData(array(<br> 'Title' =&gt; $feature-&gt;Title,<br> 'Content' =&gt; $feature-&gt;Description,<br> 'ImageURL' =&gt; $feature-&gt;Image()-&gt;url<br> ));</p><p> return $arrayData-&gt;renderWith('SingleFeatureTemplate');<br> }</p></div><p>This short code retrieves a single Feature by providing an id, and it works as expected.<br>What I'm trying to do now is define a second shortcode `GetFeatures` that allows a user to pass in one to many parameters and renders 1 or more Features that match the parameters passed in. For example:</p><p>[get_features, section="foobar", limit=4]</p><p>would render a page of 4 Features that belong to the "foobar" section on the page. Here is the code I presently have to accomplish this:</p><p></p><div class="codesnippet"><p>public static function GetFeatures($arguments, $content = null, $parser = null, $tagName) {<br> $limit = isset($arguments['limit']) ? (int)$arguments['limit'] : '';<br> $filter = isset($arguments['section']) ? $arguments['section'] : '';<br> $sort = isset($arguments['sort']) ? $arguments['sort'] : '';</p><p> if ($filter == '') {<br> $listOfFeatures = Feature::get()-&gt;sort($sort)-&gt;limit($limit);<br> } else {<br> $listOfFeatures = Feature::get()-&gt;filter(array('Section.Title' =&gt; $filter))-&gt;sort($sort)-&gt;limit($limit);<br> }</p><p> return $listOfFeatures-&gt;renderWith('MultipleFeatureTemplate');<br> }</p></div><p>Here is my MultipleFeatureTemplate:</p><p></p><div class="codesnippet"><p>&lt;% loop $Me %&gt;<br> &lt;div class="col-md-4"&gt;<br> &lt;h3&gt;$Title&lt;/h3&gt;<br> &lt;p&gt;$Description&lt;/h3&gt;<br> &lt;/div&gt;<br>&lt;% end_loop %&gt;</p></div><p>This works just fine (except I have no clue why I have to use $Me in my template to get it to work, but whatever). However, I don't know how to get access to each Feature's image. The relationship between Feature and Image is `has_one`. In the GetFeatureById shortcode I'm explicitly setting the `$ImageURL` variable for use in the template. I'm not sure how to accomplish this with the GetFeatures shortcode, however. Trying the following:</p><p></p><div class="codesnippet"><p>&lt;% loop $Me %&gt;<br> &lt;div class="col-md-4"&gt;<br> &lt;img src=$Image-&gt;url /&gt;<br> &lt;h3&gt;$Title&lt;/h3&gt;<br> &lt;p&gt;$Description&lt;/h3&gt;<br> &lt;/div&gt;<br>&lt;% end_loop %&gt;</p></div><br>Results in properly displaying the Title and Description, but the url for the &lt;img&gt; does not get interpreted correctly. I have looked over the documentation for short codes multiple times and I haven't read anything that describes how to deal with rendering collections of DataObjects into a template that loops over that collection. Can anyone provide insight on how this might be done? <br> <p data-swiftype-index="false">Posted to: Creating a shortcode that handles collections of data | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/show/121192" class="showLink">Show Thread</a> | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/reply/121192" class="replyLink">Post Reply</a></p> Thu, 25 May 2017 01:19:28 +1200 https://www.silverstripe.org/community/forums/customising-the-cms/show/121192 File Upload Error with Video Files Over 30M https://www.silverstripe.org/community/forums/customising-the-cms/show/120829 <p>Does anyone know why I cannot get an mp4 file larger than 30M to upload? I've had my IT department increase both the max filesize and the post max size to 75M and yet I cannot upload anything over 30M. I'm trying to upload an mp4 file and all I get is "Sorry your upload failed" and "true" at the end of the file name and size line.</p> <br /> <p data-swiftype-index="false">Posted to: File Upload Error with Video Files Over 30M | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/show/120829" class="showLink">Show Thread</a> | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/reply/120829" class="replyLink">Post Reply</a></p> Fri, 19 May 2017 05:09:00 +1200 https://www.silverstripe.org/community/forums/customising-the-cms/show/120829 ModelAdmin: How to preserve search filters when clicking on the print or export as CSV buttons? https://www.silverstripe.org/community/forums/customising-the-cms/show/120740 <p>Hi all, </p><p>I have a project using SilverStripe 3.4.1 with a custom DataObject class called Document. I think there is something like 1000 - 2000 documents in the system and now my client asked whether it's possible to print or export only part of the list. Currently if I use the filter form to show only documents in a certain category, I can see the filtered list alright, but if I after that click on the export or print button at the top, it will print/export all documents without filtering. </p><p>Is this a bug or a feature? :) </p><p>Thanks! :)</p> <br /> <p data-swiftype-index="false">Posted to: ModelAdmin: How to preserve search filters when clicking on the print or export as CSV buttons? | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/show/120740" class="showLink">Show Thread</a> | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/reply/120740" class="replyLink">Post Reply</a></p> Tue, 02 May 2017 23:09:05 +1200 https://www.silverstripe.org/community/forums/customising-the-cms/show/120740 Re: How to allow multibyte characters in the names of uploaded files? https://www.silverstripe.org/community/forums/customising-the-cms/show/120713#post422857 <p>Thank you very much! I will try it out next time when I'm going to do some work with attachments.</p> <br /> <p data-swiftype-index="false">Posted to: How to allow multibyte characters in the names of uploaded files? | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/show/120713#post422857" class="showLink">Show Thread</a> | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/reply/120713" class="replyLink">Post Reply</a></p> Tue, 25 Apr 2017 22:25:20 +1200 https://www.silverstripe.org/community/forums/customising-the-cms/show/120713#post422857 Re: Revert the search form appearance in ModelAdmin to be like it was in SS 3.1 https://www.silverstripe.org/community/forums/customising-the-cms/show/119782#post422839 <p>Bump, anyone? :)</p> <br /> <p data-swiftype-index="false">Posted to: Revert the search form appearance in ModelAdmin to be like it was in SS 3.1 | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/show/119782#post422839" class="showLink">Show Thread</a> | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/reply/119782" class="replyLink">Post Reply</a></p> Thu, 20 Apr 2017 21:34:30 +1200 https://www.silverstripe.org/community/forums/customising-the-cms/show/119782#post422839 Re: How to allow multibyte characters in the names of uploaded files? https://www.silverstripe.org/community/forums/customising-the-cms/show/120713#post422833 <p><a href="https://api.silverstripe.org/3.1/class-FileNameFilter.html">https://api.silverstripe.org/3.1/class-FileNameFilter.html</a> </p><p>To leave uploaded filenames as they are (being aware of filesystem restrictions), add the following code to your YAML config: </p><p><div class="codesnippet"><p>FileNameFilter: <br /> default_use_transliterator: false <br /> default_replacements:</p></div></p> <br /> <p data-swiftype-index="false">Posted to: How to allow multibyte characters in the names of uploaded files? | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/show/120713#post422833" class="showLink">Show Thread</a> | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/reply/120713" class="replyLink">Post Reply</a></p> Wed, 19 Apr 2017 00:54:09 +1200 https://www.silverstripe.org/community/forums/customising-the-cms/show/120713#post422833 How to allow multibyte characters in the names of uploaded files? https://www.silverstripe.org/community/forums/customising-the-cms/show/120713 <p>Hi, </p><p>I know how to enable multibyte characters in URL segments (via the configuration of the URLSegment class), but doing that has no effect on uploaded file names. If they contain multibyte characters, they will be transliterated. For example, an image file name <em>Pääsiäinen.jpg</em> (a Finnish word meaning Easter) becomes <em>Paeaesiaeinen.jpg</em>, because <em>ä</em> is not simply transliterated to <em>a</em>, but to <em>ae</em> instead. The current result is just really hard to read :D. </p><p>So it would be best to be able to keep the file name intact, but another good solution would be to modify the transliteration process so that <em>ä</em> would become <em>a</em>. </p><p>Thanks for your support! :)</p> <br /> <p data-swiftype-index="false">Posted to: How to allow multibyte characters in the names of uploaded files? | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/show/120713" class="showLink">Show Thread</a> | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/reply/120713" class="replyLink">Post Reply</a></p> Thu, 13 Apr 2017 20:11:11 +1200 https://www.silverstripe.org/community/forums/customising-the-cms/show/120713 Re: Complicated many many relationship https://www.silverstripe.org/community/forums/customising-the-cms/show/119940#post422045 <p>You could add in the code in an onBeforeWrite() function based on selecting a 'type' for the mentor. For example: </p><p><div class="codesnippet"><p>&lt;?php <br />class Mentor extends DataObject { <br /> private static $db = array( <br /> 'Name' =&gt; 'Varchar', <br /> 'Type' =&gt; 'Enum("BusinessMentor, CommunicationsMentor")', <br /> 'Code' =&gt; 'Text' <br /> ); </p><p> function onBeforeWrite(){ <br /> if($this-&gt;Type &amp;&amp; $this-&gt;Type == 'BusinessMentor'){ <br /> $this-&gt;Code = '12A'; <br /> }&nbsp;&nbsp;&nbsp; <br /> parent::onBeforeWrite(); <br /> } <br />}</p></div></p> <br /> <p data-swiftype-index="false">Posted to: Complicated many many relationship | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/show/119940#post422045" class="showLink">Show Thread</a> | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/reply/119940" class="replyLink">Post Reply</a></p> Fri, 31 Mar 2017 20:43:56 +1300 https://www.silverstripe.org/community/forums/customising-the-cms/show/119940#post422045 Complicated many many relationship https://www.silverstripe.org/community/forums/customising-the-cms/show/119940 <p>I would like to create a many many relationship, as per the tutorials. So far so good. <br />I'll use class Mentor from <a href="https://docs.silverstripe.org/en/3/tutorials/dataobject_relationship_management/">https://docs.silverstripe.org/en/3/tutorials/dataobject_relationship_management/</a> to illustrate my idea. </p><p>What if there are different types of Mentors? Each mentor has a set skill. Some mentors have business skills, some have communication skills, etc. How would those different types be represented in such a way that when a mentor is added, their specific skill can be nominated? </p><p>The reason I ask this, is because I wish to be able to create various types that have secret information that should be used in a template, but someone using the many to many relationship doesn't need to worry about. </p><p>So for example: Mentor has a property called code. <br />In BusinessMentor it is set to 12A, and in CommunicationMentor it is set to 45C. Every Mentor who is a BusinessMentor has this code 12A. Every Mentor who is a CommunicationMentor has the code 45C. </p><p>When people are selecting Mentor's for the project in the CMS user interface, they don't need to worry about the underlying code, they just find the Mentor name and use that. </p><p>But that code is accessible in a template. Should the code be a DataObject itself? </p><p>Any ideas?</p> <br /> <p data-swiftype-index="false">Posted to: Complicated many many relationship | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/show/119940" class="showLink">Show Thread</a> | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/reply/119940" class="replyLink">Post Reply</a></p> Wed, 29 Mar 2017 15:52:52 +1300 https://www.silverstripe.org/community/forums/customising-the-cms/show/119940 Re: Removing the entire 3rd row on default Content TinyMCE https://www.silverstripe.org/community/forums/customising-the-cms/show/119902#post421995 <p>I solved this by adding the following CSS to my cms.css file in mysite/extracss folder <br /><div class="codesnippet"><p>.mceToolbarRow3 { display: none;}</p></div> </p><p>It's a bit of a hack, but it works. </p><p>If anyone is interested here are the other items I've got in this extra css file that I find useful: <br /><div class="codesnippet"><p>/* Hide ErrorPages from CMS */ <br />li.class-ErrorPage { <br />&nbsp;&nbsp;&nbsp;display: none !important; <br />} </p><p>/* Gray out Pages hidden from menus */ <br />.notinmenu &gt; a { <br />&nbsp;&nbsp;&nbsp;color: #89878b !important; <br />} </p><p>/* Fixes extra margin on HTMLEditor Right Title labels */ <br />.htmleditor.field label.right { <br />&nbsp;&nbsp;&nbsp;margin-left: 0; <br />} </p><p>/* Aligns UploadField with other normal fields! */ <br />.ss-uploadfield .middleColumn { <br />&nbsp;&nbsp;&nbsp;float: left !important; <br />&nbsp;&nbsp;&nbsp;clear: none !important; <br />} </p><p>/* Hides Pages that can't be created in Add page list */ <br />#Form_AddForm_PageType li.disabled { <br /> display: none !important; <br />} </p><p>/* Float Gridfield 'Add New' button to the right */ <br />.ss-gridfield &gt; div.ss-gridfield-buttonrow-before { <br />&nbsp;&nbsp;&nbsp;float: right; <br />} </p><p>/* Hide TinyMCE HTMLEditor third row of buttons */ <br />.mceToolbarRow3 { display: none;}</p></div> </p><p>Some of these might already be addressed in 4.0 but I find the CMS experience better with these updates</p> <br /> <p data-swiftype-index="false">Posted to: Removing the entire 3rd row on default Content TinyMCE | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/show/119902#post421995" class="showLink">Show Thread</a> | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/reply/119902" class="replyLink">Post Reply</a></p> Sun, 19 Mar 2017 00:10:54 +1300 https://www.silverstripe.org/community/forums/customising-the-cms/show/119902#post421995 Re: Removing the entire 3rd row on default Content TinyMCE https://www.silverstripe.org/community/forums/customising-the-cms/show/119902#post421994 <p>Thanks Devlin, but I already tried that (just tried again to confirm) it makes no difference - I still have that third row with separators in it. <br />I also tried -&gt;setButtonsForLine(3, array()); but no joy <br />Any other ideas?</p> <br /> <p data-swiftype-index="false">Posted to: Removing the entire 3rd row on default Content TinyMCE | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/show/119902#post421994" class="showLink">Show Thread</a> | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/reply/119902" class="replyLink">Post Reply</a></p> Sun, 19 Mar 2017 00:00:25 +1300 https://www.silverstripe.org/community/forums/customising-the-cms/show/119902#post421994 Re: Removing the entire 3rd row on default Content TinyMCE https://www.silverstripe.org/community/forums/customising-the-cms/show/119902#post421993 <p><div class="codesnippet"><p>HtmlEditorConfig::get('cms')-&gt;setButtonsForLine(3, '');</p></div></p> <br /> <p data-swiftype-index="false">Posted to: Removing the entire 3rd row on default Content TinyMCE | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/show/119902#post421993" class="showLink">Show Thread</a> | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/reply/119902" class="replyLink">Post Reply</a></p> Sat, 18 Mar 2017 05:24:33 +1300 https://www.silverstripe.org/community/forums/customising-the-cms/show/119902#post421993 Customising the information available in the member view for specific users https://www.silverstripe.org/community/forums/customising-the-cms/show/119906 <p>I am currently building a web application that has a number of QandA exercises, the user completes the exercises and then gets a score. <br />Additionally I wish to display a list of the exercises and the scores for the admin to view when they select the member in the security section. </p><p>What i need is help getting my head around the atoB approach of implementing this. My first instinct is to extend the member class and override the cms fields and add a 2nd tab, but I dont know how to link the member to its scores, i obviously need to setup additional data objects to deal with this but im unsure of how to bring it all together. </p><p>thank you for your help in advance. </p><p>Byron</p> <br /> <p data-swiftype-index="false">Posted to: Customising the information available in the member view for specific users | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/show/119906" class="showLink">Show Thread</a> | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/reply/119906" class="replyLink">Post Reply</a></p> Sat, 18 Mar 2017 01:56:49 +1300 https://www.silverstripe.org/community/forums/customising-the-cms/show/119906 Re: CMS shows blank on edit page https://www.silverstripe.org/community/forums/customising-the-cms/show/119903#post421987 <p>SOLVED! </p><p>I have descovered that the date format 'YYYY-MM-dd' breaks the code. When using 'MM/dd/YYYY' it works correctly. </p><p>Looks like a rookie mistake on my part.</p> <br /> <p data-swiftype-index="false">Posted to: CMS shows blank on edit page | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/show/119903#post421987" class="showLink">Show Thread</a> | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/reply/119903" class="replyLink">Post Reply</a></p> Fri, 17 Mar 2017 11:55:24 +1300 https://www.silverstripe.org/community/forums/customising-the-cms/show/119903#post421987 CMS shows blank on edit page https://www.silverstripe.org/community/forums/customising-the-cms/show/119903 <p>I am attempting to make a custom news holder and article page per the docs here: <a href="https://docs.silverstripe.org/en/4/tutorials/extending_a_basic_site/">https://docs.silverstripe.org/en/4/tutorials/extending_a_basic_site/</a> </p><p>The news holder works fine but when attempting to edit the article page it only displays blank. It creates a default page but I cannot edit it. </p><p>This is the code in my NewsArticlePage.php: <br /><div class="codesnippet"><p>&lt;?php </p><p>class NewsArticlePage extends Page { <br /> private static $db = array( <br /> 'PubDate' =&gt; 'Date', <br /> 'Author' =&gt; 'Text' <br /> ); </p><p> public function getCMSFields() { <br /> $fields = parent::getCMSFields(); </p><p> $dateField = new DateField('PubDate', 'Article Date'); <br /> $dateField-&gt;setConfig('showcalendar', true); <br /> $dateField-&gt;setConfig('dateformat', 'YYYY-MM-dd'); </p><p> $fields-&gt;addFieldToTab('Root.Main', $dateField, 'Content'); <br /> $fields-&gt;addFieldToTab('Root.Main', new TextField('Author', 'Author Name'), 'Content'); </p><p> return $fields; <br /> } <br />} </p><p>class NewsArticlePage_Controller extends Page_Controller { </p><p>}</p></div> </p><p>mysite/simple/NewsArticlePage.ss <br /><div class="codesnippet"><p>&lt;% include SideBar %&gt; <br />&lt;div class="content-container unit size3of4 lastUnit"&gt; <br /> &lt;article&gt; <br /> &lt;h1&gt;$Title&lt;/h1&gt; <br /> &lt;div class="news-details"&gt;&lt;p&gt;Posted on $Date.Nice by $Author&lt;/p&gt;&lt;/div&gt; <br /> &lt;div class="content"&gt;$Content&lt;/div&gt; <br /> &lt;/article&gt; <br /> $Form <br />&lt;/div&gt;</p></div> </p><p>Before anyone asks...Yes - I did do the obligatory dev/build and flush.</p> <br /> <p data-swiftype-index="false">Posted to: CMS shows blank on edit page | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/show/119903" class="showLink">Show Thread</a> | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/reply/119903" class="replyLink">Post Reply</a></p> Fri, 17 Mar 2017 08:05:57 +1300 https://www.silverstripe.org/community/forums/customising-the-cms/show/119903 Removing the entire 3rd row on default Content TinyMCE https://www.silverstripe.org/community/forums/customising-the-cms/show/119902 <p>I can customise the buttons that appear in each row of TinyMCE and even remove the Table controls using the code below but the third row still appears with just separators in it. Is there any way to remove these separators and remove this 3rd row completely? <br /><div class="codesnippet"><p>HtmlEditorConfig::get('cms')-&gt;setOption('theme_advanced_blockformats', 'p,h1,h2,h3'); <br />HtmlEditorConfig::get('cms')-&gt;setOption('theme_advanced_disable', 'styleselect,cut,copy,paste,pasteword,undo,redo,selectall,visualaid,separator,Separator,|'); <br />HtmlEditorConfig::get('cms')-&gt;setButtonsForLine(3); <br />HtmlEditorConfig::get('cms')-&gt;disablePlugins('table');</p></div> </p><p>This results in: <img src="http://www.fuel.ie/assets/Uploads/screenshot2017-03-16.png" /> </p><p>I would love to get rid of that last row! <br /><em>(using CMS and Framework 3.5.2)</em></p> <br /> <p data-swiftype-index="false">Posted to: Removing the entire 3rd row on default Content TinyMCE | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/show/119902" class="showLink">Show Thread</a> | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/reply/119902" class="replyLink">Post Reply</a></p> Fri, 17 Mar 2017 04:21:17 +1300 https://www.silverstripe.org/community/forums/customising-the-cms/show/119902 Re: Silverstripe version 3.1.9 Max file size? https://www.silverstripe.org/community/forums/customising-the-cms/show/119786#post421860 <p>Hi Kat</p><p>If you check out the docs on the Upload field (<a href="https://docs.silverstripe.org/en/3/developer_guides/forms/field_types/uploadfield/">https://docs.silverstripe.org/en/3/developer_guides/forms/field_types/uploadfield/</a>) you will see some of the stuff you can do with uploads. </p><p>You can setAllowedMaxFileSize() on an upload field on each instance you wish to apply it, or add some options to your _config.yml file to apply globally. </p><p>Example from the upload field docs page is<br>_config.yml<br></p><div class="codesnippet"><p>Upload_Validator: <br> default_max_file_size: <br> '[image]': '1m'<br> '[doc]': '5m'<br> 'jpeg': 2000</p></div><p>Or an individual upload field might look like<br></p><div class="codesnippet"><p>function getCMSFields() {<br> $fields = parent::getCMSFields(); <br> $upload = new UploadField('MyFile', 'My File Title');<br> $sizeMB = 2; // 2 MB<br> $size = $sizeMB * 1024 * 1024; // 2 MB in bytes<br> $upload-&gt;getValidator()-&gt;setAllowedMaxFileSize($size);<br> $fields-&gt;addFieldToTab("Root.MyTab", $upload);<br> return $fields;<br>}</p></div> <br> <p data-swiftype-index="false">Posted to: Silverstripe version 3.1.9 Max file size? | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/show/119786#post421860" class="showLink">Show Thread</a> | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/reply/119786" class="replyLink">Post Reply</a></p> Wed, 08 Mar 2017 21:58:24 +1300 https://www.silverstripe.org/community/forums/customising-the-cms/show/119786#post421860 Silverstripe version 3.1.9 Max file size? https://www.silverstripe.org/community/forums/customising-the-cms/show/119786 <p>A user uploaded an image that was slightly larger than 8MB into a folder under the Files tab. Both upload_max_filesize and post_max_size were set to 32M now 64MB. This resulted in the user now longer being able to access that Folder through Silverstripe. The entry in the database table appears to be fine. The file uploaded fine and could be downloaded via FTP fine. </p><p>I removed that folder and tried to upload the image as part of a specialised page. The image does not upload. <br />I can't see the image on the server, though I do see a listing in the database table. The CMS refuses to navigate the page 3 where that file should be listed. </p><p>What could be going on? </p><p>*Yes, I realise 8MB is large for a photo. And isn't ideal. I can manually correct this myself. However, in future instances, how do I let the users do what they want to do? They may actually have good cause for posting such a large image. Is there a file size limit?</p> <br /> <p data-swiftype-index="false">Posted to: Silverstripe version 3.1.9 Max file size? | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/show/119786" class="showLink">Show Thread</a> | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/reply/119786" class="replyLink">Post Reply</a></p> Tue, 07 Mar 2017 13:58:06 +1300 https://www.silverstripe.org/community/forums/customising-the-cms/show/119786 Revert the search form appearance in ModelAdmin to be like it was in SS 3.1 https://www.silverstripe.org/community/forums/customising-the-cms/show/119782 <p>Hi, </p><p>I've just upgraded one site from 3.1 to 3.5 and I'm not sure at which version along the way the ModelAdmin search/filter form was moved from the left side to be opened by clicking an icon in the top right corner, which after the form appears on top of the page. I tried to search if there is an option to put it back the way it was before, but didn't find anything. I could also override some template files if I knew which one(s). </p><p>I think the new search form layout is good in cases where you rarely need the search (doesn't take up space), but my client told me that she uses the search all the time as she's managing over one hundred DataObjects in the list. </p><p>Thank you for your help! :)</p> <br /> <p data-swiftype-index="false">Posted to: Revert the search form appearance in ModelAdmin to be like it was in SS 3.1 | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/show/119782" class="showLink">Show Thread</a> | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/reply/119782" class="replyLink">Post Reply</a></p> Mon, 06 Mar 2017 22:13:02 +1300 https://www.silverstripe.org/community/forums/customising-the-cms/show/119782 Re: create a true virtual holder page with no urlsegment / have children URLsegments set at root level https://www.silverstripe.org/community/forums/customising-the-cms/show/119614#post421652 <p>You can set the config "SiteTree:nested_urls" to false to disable nested urls.</p> <br /> <p data-swiftype-index="false">Posted to: create a true virtual holder page with no urlsegment / have children URLsegments set at root level | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/show/119614#post421652" class="showLink">Show Thread</a> | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/reply/119614" class="replyLink">Post Reply</a></p> Sat, 25 Feb 2017 05:58:12 +1300 https://www.silverstripe.org/community/forums/customising-the-cms/show/119614#post421652 Fluent - all translated fields on one place https://www.silverstripe.org/community/forums/customising-the-cms/show/119623 <p>This is excellent module. <br />Anyway I have an admin question. I have a DataObject with some text fields and they have been marked as translated (with $translated = array....). Everything works fine with language switching from the green dropdown. <br />Here is my issue - is it possible transated fields for the different languages (e.g. Title_en_US, Title_bg_BG, Title_ru_RU.....) to be listed all together and thus to be skipped language switching from the dropdown and save the DataObject with one click? <br />Is there a way to switch off or disable temporarily Fluent?</p> <br /> <p data-swiftype-index="false">Posted to: Fluent - all translated fields on one place | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/show/119623" class="showLink">Show Thread</a> | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/reply/119623" class="replyLink">Post Reply</a></p> Fri, 24 Feb 2017 21:56:28 +1300 https://www.silverstripe.org/community/forums/customising-the-cms/show/119623 create a true virtual holder page with no urlsegment / have children URLsegments set at root level https://www.silverstripe.org/community/forums/customising-the-cms/show/119614 <p>So i have a very specific task I need to accomplish, and I'd like to do this the *right way*. </p><p>Basically my client is interested in creating a landing page module for the website, with explicit permissions for certain members to only be allowed to interact with those specific pages. Fine. </p><p>However, the other requirement is that these pages are all accessible from the baseurl - i.e. <a href="http://www.example.com/my-landing-page/">www.example.com/my-landing-page/</a> </p><p>The simplest solution is to allow said members to create pages at the root level... but I'd rather not let them do that, as it would quickly balloon out of control and the bloat to the site tree would not be scalable. </p><p>I would rather, ideally, do the following: <br />- Use the Blog Module as a holder page that doesn't exist as a page, but just holds the landing pages themselves <br />-- This can't be the homepage as I don't want these members to have access to the homepage, also because the homepage would append /home/ to the URLs anyway. <br />-- Users should be able to go into this holder page, create their landing page from a variety of different classes based on their need, and be able to set additional features yadda yadda yadda </p><p>All of that can be dealt with, except for the bypassing of the page creation. As far as I can tell, I can't tell Silverstripe to not actually publish a page but still have its children accessible - nor can I tell it to bypass the URLSegment requirement. I know I can still set it up with a urlsegment like "lp", but i'd rather just not have that be a page at all and keep the landing pages accessible from the root level, without cluttering up the site tree. </p><p>Is this at all possible? I can't find any documentation or other issues in the forums that would suggest it is.</p> <br /> <p data-swiftype-index="false">Posted to: create a true virtual holder page with no urlsegment / have children URLsegments set at root level | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/show/119614" class="showLink">Show Thread</a> | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/reply/119614" class="replyLink">Post Reply</a></p> Thu, 23 Feb 2017 08:47:50 +1300 https://www.silverstripe.org/community/forums/customising-the-cms/show/119614 Re: Admin Login template https://www.silverstripe.org/community/forums/customising-the-cms/show/18465?start=8#post421619 <p>Naveed - did you manage to find a way of doing this? I'm trying to achieve the same thing, but not sure how to pull the individual fields rather than the template. </p><p>Any help appreciated!</p> <br /> <p data-swiftype-index="false">Posted to: Admin Login template | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/show/18465?start=8#post421619" class="showLink">Show Thread</a> | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/reply/18465" class="replyLink">Post Reply</a></p> Mon, 20 Feb 2017 21:14:45 +1300 https://www.silverstripe.org/community/forums/customising-the-cms/show/18465?start=8#post421619 Re: [Solved] 2 managed_models from the same dataobject in modeladmin https://www.silverstripe.org/community/forums/customising-the-cms/show/119148#post421618 <p>if there where no relations on the database it would have worked perfectly, I give it a A for effort</p> <br> <p data-swiftype-index="false">Posted to: [Solved] 2 managed_models from the same dataobject in modeladmin | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/show/119148#post421618" class="showLink">Show Thread</a> | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/reply/119148" class="replyLink">Post Reply</a></p> Fri, 17 Feb 2017 06:15:15 +1300 https://www.silverstripe.org/community/forums/customising-the-cms/show/119148#post421618 Re: [Solved] 2 managed_models from the same dataobject in modeladmin https://www.silverstripe.org/community/forums/customising-the-cms/show/119148#post421617 <p>Ah... Guess there are no shortcuts :)</p> <br> <p data-swiftype-index="false">Posted to: [Solved] 2 managed_models from the same dataobject in modeladmin | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/show/119148#post421617" class="showLink">Show Thread</a> | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/reply/119148" class="replyLink">Post Reply</a></p> Fri, 17 Feb 2017 06:12:50 +1300 https://www.silverstripe.org/community/forums/customising-the-cms/show/119148#post421617 Re: [Solved] 2 managed_models from the same dataobject in modeladmin https://www.silverstripe.org/community/forums/customising-the-cms/show/119148#post421616 <p>It all was working fine, except for sorting $has_one columns, it will give you a dbconnection error, and I think this is because you have to override the getList function to have the HiddenTicketReport class to show TicketReport class data.</p> <br> <p data-swiftype-index="false">Posted to: [Solved] 2 managed_models from the same dataobject in modeladmin | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/show/119148#post421616" class="showLink">Show Thread</a> | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/reply/119148" class="replyLink">Post Reply</a></p> Fri, 17 Feb 2017 05:59:24 +1300 https://www.silverstripe.org/community/forums/customising-the-cms/show/119148#post421616 Re: [Solved] 2 managed_models from the same dataobject in modeladmin https://www.silverstripe.org/community/forums/customising-the-cms/show/119148#post421614 <p>Great that you found a better way, which probably is the better one anyway :). </p><p>Just wondering where my dubious idea went wrong, as it seemed to work ... :)</p> <br> <p data-swiftype-index="false">Posted to: [Solved] 2 managed_models from the same dataobject in modeladmin | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/show/119148#post421614" class="showLink">Show Thread</a> | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/reply/119148" class="replyLink">Post Reply</a></p> Thu, 16 Feb 2017 23:35:45 +1300 https://www.silverstripe.org/community/forums/customising-the-cms/show/119148#post421614 Re: [Solved] 2 managed_models from the same dataobject in modeladmin https://www.silverstripe.org/community/forums/customising-the-cms/show/119148#post421366 <p>Just for anybody that is looking for the same thing, I was runnning into so problems with releations, so i found a new solution on stackoverflow.</p><p>Overload getEditForm and define a new FieldList containing a TabSet. The SilverStripe Comments module provides a great example this in action, by showing different types of comments (Spam vs. Moderated) in separate tabs within the same ModelAdmin. </p><p>so far this is working well the only downside is that it is loading all the gridfield tabs on initial load so it is a little slow.</p> <br> <p data-swiftype-index="false">Posted to: [Solved] 2 managed_models from the same dataobject in modeladmin | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/show/119148#post421366" class="showLink">Show Thread</a> | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/reply/119148" class="replyLink">Post Reply</a></p> Thu, 16 Feb 2017 17:41:23 +1300 https://www.silverstripe.org/community/forums/customising-the-cms/show/119148#post421366 Relational dropdowns in CMS https://www.silverstripe.org/community/forums/customising-the-cms/show/119333 <p>Hi! </p><p>I'm developing a custom CMS for my client and he needs to select a CITY filtered by a COUNTRY. </p><p>i have: </p><p><div class="codesnippet"><p>class Country extends DataObject <br />{ <br /> static $has_many = array( <br /> 'cities' =&gt; 'City' <br />); <br />} </p><p>class City extends DataObject <br />{ <br /> static $has_one = array( <br /> 'country' =&gt; 'Country ' <br />); <br />}</p></div> </p><p>I'd like to have two separate dropdown fields (or something similar) and be able to dynamically filter the cities. <br />i've heard of 'FilteredDropdownSet' but it looks deprecated now (i'm using SS 3.4). </p><p>How can i do that? I really can't figure out </p><p>Thanks in advance</p> <br /> <p data-swiftype-index="false">Posted to: Relational dropdowns in CMS | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/show/119333" class="showLink">Show Thread</a> | <a href="https://www.silverstripe.org/community/forums/customising-the-cms/reply/119333" class="replyLink">Post Reply</a></p> Thu, 16 Feb 2017 04:20:41 +1300 https://www.silverstripe.org/community/forums/customising-the-cms/show/119333