octobercms-backend

octoberCMS | share the code between layouts

北战南征 提交于 2019-12-12 03:45:47
问题 On my default layout I have many AJAX handlers , but for my project, I need to create static pages with the same layout but with different variables (fields for client)... So as I understand I need to create different layout's that extends the partials from default layout ... But there are some way to share the code between the layouts to prevent repeating? Or, there are some way to create different variables on a layout to diferrent statics pages? Ex. of var. code: {variable name="tagline"

Making a deep related field searchable in OctoberCMS

試著忘記壹切 提交于 2019-12-11 05:19:03
问题 My my columns.yaml file for the Invoice model I have the following column: transaction[user][email]: label: Login email type: text searchable: true // doesn't work! Unfortunately, the searchable bit doesn't work and I understand that this is because I am using transaction[user][email] instead of having a relation and select as part of the column. My question is, can I somehow use relation and select when I'm going 2 relations deep, like this, or do I need a different approach? My Invoice

Media Finder display Image on Front End

青春壹個敷衍的年華 提交于 2019-12-10 12:00:00
问题 I created a Model and Database and can upload an image using the Media Finder. I set Media Finder field as photo in fields.yamal . But after uploading, no image path is saved to the database in the photo column. Database Tables id (integer) title (string) photo (string) Twig {% for product in builderListCatalog.records %} {{ product.title }} <img src="{{ product.photo }}" /> {% endfor %} This successfully displays the Title but not the Photo path because it is empty in the database. 回答1: You

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="{{ _

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

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 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