octobercms

Custom Contact Form in Partials and use in Static Pages plugin

这一生的挚爱 提交于 2019-12-08 13:31:18
问题 I have used OctoberCMS, Static Pages plugin, through which I am creating Static Pages. The thing is, I have created one contact form in Partial like below. contactform_snippet.htm - Markup contactform_snippet.htm - Code And below is the Static Page which I have created and used contactform_snippet.htm which I just created. And below is Preview how its looking like. The thing is, Even if I click on "Submit" button, it is not doing anything. I also changed the form code from data-request="{{ _

How can I display results in bootstrap grid in octobercms?

孤街醉人 提交于 2019-12-08 11:03:07
问题 I have this right now in my octobercms code to display results. It currently displays it in a list but I want it in bootstrap grid of 3 equal columns. {% for cats in cats %} <div> <img src="{{ cats.poster.path }}"><br> <a href="{{ 'subcategory'|page({ slug: cats.slug }) }}"> {{ cats.cat_title }} </a> </div> {% else %} <div class="no-data">{{ noRecordsMessage }}</div> {% endfor %} Any straight forward way of doing this? 回答1: Got it done using this {% for row in cats|batch(3) %} <div class="row

October CMS media finder

断了今生、忘了曾经 提交于 2019-12-08 09:07:11
问题 I have recently created a plugin (using the 'builder plugin') where I have a field for attaching images (using 'media finder widget'). Everything is working fine - I can upload an image or choose one from the media library. After successful saving, when I go back to the recently saved record, the image isn't shown... How can I fix this? Thanks! 回答1: 'media finder widget' not working with relation type 'file attachment', like this: public $attachOne = [ 'avatar' => 'System\Models\File' ]; try

Modify OctoberCMS Laravel Plugin to Disable Form Username Change

岁酱吖の 提交于 2019-12-08 08:57:19
问题 I'm using OctoberCMS based on Laravel with the official Users plugin. How can I modify this plugin to Disable or Deny Username Change? The form can easily be hacked to allow change. Plugin Here is the file on GitHub I need to edit: Account.php In the onUpdate() function, where it says $user->fill , it is saving all input fields. I need to deny the username field in the function or with the validator. public function onUpdate() { if (!$user = $this->user()) { return; } $user->fill(post());

Static page plugin - List with all pages url as a custom page field

北慕城南 提交于 2019-12-08 08:14:34
问题 I'm using static page plugin. I need a way to get from a custom field all the pages of the octobercms. I don't care how this will be done (official page url selector - dropdown list ...), I want only to be user friendly so can be used from a client. There is a workaround but it works only with repeater. If I use it with one other field {variable name="page" label="Page" type="dropdown"}{/variable} I got an error: get_class() expects parameter 1 to be object, array given 回答1: Wow! this

How do I call a component inside a component [OctoberCMS]

谁都会走 提交于 2019-12-07 09:36:33
问题 I want to call a component inside a component with a variable, like this: Here's the code of the default.html-> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js"></script> <div class="container"> <div class="row"> {% partial __SELF__ ~ "::category" category=__SELF__.category childscategory=__SELF__.childscategory%} <div class="col-xs-3"> <strong>DATA</strong> <ul class="list-group text-center"> {% partial __SELF__ ~ "::dates" files=__SELF__.files %} </ul> </div>

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

早过忘川 提交于 2019-12-06 09:30:49
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 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 the field type is set to json or text : $table->json('field_name')->nullable(); Let's say you want to add

octobercms Task scheduling not working

≯℡__Kan透↙ 提交于 2019-12-06 03:03:27
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's my code in plugin.php of component: public function registerSchedule($schedule) { $schedule->call

How do I call a component inside a component [OctoberCMS]

醉酒当歌 提交于 2019-12-05 14:29:14
I want to call a component inside a component with a variable, like this: Here's the code of the default.html-> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js"></script> <div class="container"> <div class="row"> {% partial __SELF__ ~ "::category" category=__SELF__.category childscategory=__SELF__.childscategory%} <div class="col-xs-3"> <strong>DATA</strong> <ul class="list-group text-center"> {% partial __SELF__ ~ "::dates" files=__SELF__.files %} </ul> </div> <div class="col-xs-3"> <strong>Nome do Ficheiro</strong> <ul class="list-group text-center"> {% partial

OctoberCMS call another plugin's data in current plugin's dropdown

China☆狼群 提交于 2019-12-04 06:43:24
问题 I am new to OctoberCMS and i love the way it works. Currently i have created two plugins called as Products and Product Categories . I have created these plugins using Builder Plugin which is also a very good plugin to create another plugins with ease. Now the thing is, In my Products Categories plugin, i simply have a single field called as Product Category and user will add as many categories as he/she wants and this plugin works fine. And in my Products plugin, i have a field called as