octobercms

October CMS create a multi select Form field

浪子不回头ぞ 提交于 2019-12-23 15:10:15
问题 I need to create a multi select form field in October Cms backend form (fields.yaml). I applied the following method select_field: label: Sample type: dropdown attributes: {multiple:'multiple'} Options to this field will be invoked from the model Everything is working good but when i submit the form only the first selected option is being inserted as JSON data in the database table text field. I want every selected option to be stored. I have also declared the field as Jsonable in model ie.,

October CMS - Display only those records that are attached to the groups of the current user

拜拜、爱过 提交于 2019-12-23 05:06:33
问题 I need to display only those records in the model that are attached to some groups. ("belongsToMany" Relations). (backend page of plugin list of Movies model) I want to get the groups of the current user and create a query. What I mean: I use Relations field to to attach records to groups. i.e: I have table "elisseii_myplugin_movies". In the "Movies" model, I created a relation field with the name "groups". and created the table "elisseii_myplugin_movies_groups". Used $belongsToMany in the

Octobercms: How can I make a repeater field jsonable because I am creating this repeater field into a different plugin

点点圈 提交于 2019-12-22 16:36:47
问题 How can I make a repeater field jsonable because I am creating this repeater field into a different plugin and I have created my own plugin. for example: I want to add a repeater field in rainlab.user plugin model but I want to do this by my own plugin so updates on rainlab.user plugin won't affect my work. Thanks 回答1: You should read about Extending Plugins. 1) First register the events in your custom plugin.php - Example 2) Add the related fields to your migration file - Example - Make sure

Octobercms: How can I make a repeater field jsonable because I am creating this repeater field into a different plugin

試著忘記壹切 提交于 2019-12-22 16:31:56
问题 How can I make a repeater field jsonable because I am creating this repeater field into a different plugin and I have created my own plugin. for example: I want to add a repeater field in rainlab.user plugin model but I want to do this by my own plugin so updates on rainlab.user plugin won't affect my work. Thanks 回答1: You should read about Extending Plugins. 1) First register the events in your custom plugin.php - Example 2) Add the related fields to your migration file - Example - Make sure

octobercms Task scheduling not working

痴心易碎 提交于 2019-12-22 10:18:06
问题 I'm using OctoberCMS based on Laravel. I don't have SSH access to my server. Each day I need to delete some users who haven't activated their account in 24 hours after registration, so I'am thinking about use a task sheduling ( like cronjobs) According to octobercms docs I should make a function for register task sheduling in Custom Component's Plugin.php - I made it. I made registered users without activation account and older then 1 day. But problem is that - nothing is happening at all. It

Create API (Web Service) in OctoberCMS

喜欢而已 提交于 2019-12-20 03:00:21
问题 I am new to OctoberCMS and i found it very good CMS indeed. I am creating 2 projects in my local server. One is in Cakephp (http://localhost/5p_group/) and the other is in OctoberCMS (http://localhost/5p_front/) . I am using Static Pages plugin in my OctoberCMS project (http://localhost/5p_front/) and i have created header and footer menus using Static Pages Plugin in it which works fine in my October Project at front end as i am able to display header and footer menus respectively. I have

OctoberCMS How to Override Users Plugin onRegister() Function?

人走茶凉 提交于 2019-12-19 04:15:16
问题 I'm using OctoberCMS based on Laravel. I'm trying to override the Users Plugin onRegister() function. A previous answer helped me extend the plugin. I want to restrict Usernames to alphanumeric only with alpha_dash and limit to 50 characters. The original function in Account.php public function onRegister() { ... if ($this->loginAttribute() == UserSettings::LOGIN_USERNAME) { $rules['username'] = 'required|between:2,255'; } My Override Users Events docs https://github.com/rainlab/user-plugin

How to get static page dropdown in OctoberCMS with get page tree?

≯℡__Kan透↙ 提交于 2019-12-14 03:07:39
问题 I am open this based from my question in my own comment from Static page dropdown within static page in OctoberCMS. I have problem when adding $pageList->getPageTree(true). The child pages did not display. My current code is repeating foreach from $pageObject->subpages which is not a good practice. Below here is my code example: Plugin.php <?php namespace MyPlugin\CustomPlugin use System\Classes\PluginBase; public function boot() { \RainLab\Pages\Classes\Page::extend(function($model) { $model

Passing variable to Octobercms blogPosts component using a Repeater markup

做~自己de王妃 提交于 2019-12-13 05:41:18
问题 On Octobercms blogPosts component I want to pass a variable. I want to change postsPerPage value using: {repeater name="fields" groups="~/themes/demo/myfields.yaml" tab="MyFields"} {/repeater} on static layout. myfields.yaml blogfield: name: Blog Field description: My Blog Field fields: fields_blog_number: label: Posts Number type: number span: right And I render it with: {% for field in fields%} ... {% endfor %} So i want to be able to change postsPerPage component value with this field on

Pass Variable from Component to Model Scope

╄→гoц情女王★ 提交于 2019-12-12 20:01:58
问题 I'm using OctoberCMS based on Laravel. I'm trying to get the identifier from URL and pass it to the Scope to filter database results. $this->property('username') works and returns the username from the URL. But how do you pass it to the Model and into the Scope function? Here is the guide, under Dynamic Scopes. https://octobercms.com/docs/database/model#query-scopes Page URL: localhost/user/matt Identifier: /user/:username Results Component public function init() { // get username from url