octobercms

Relation Manager Not Showing Pivot Data

∥☆過路亽.° 提交于 2020-04-17 21:53:13
问题 So this question came about because of this other question I was looking into. So I have dabbled in this a bit working with backend forms and thought I knew how to tackle this. However I am not seeing the results that I thought I would. I have tried to do some research and haven't seen anyone bring this up in the issues on the github page or here in stackoverflow. Unless I missed it. How do you show the stored extra Pivot Data in the backend? Here is my model.php relationship: public

October CMS relation to self

浪子不回头ぞ 提交于 2020-02-29 07:22:05
问题 I have the Event model and want to be able to select other events in it to display on the frontend. The first thing that I tried is the relations, but the problem is I don't know how to use the pivot table because actually, it should contain two fields and both should be named as 'event_id' which is obviously impossible. Maybe someone can suggest any way to avoid this or a better way to solve my problem with events choice field in Event model? Thanks in advance. 回答1: yes same name for

OctoberCMS news list / detail page

|▌冷眼眸甩不掉的悲伤 提交于 2020-02-02 17:43:47
问题 After programming plain HTML/CSS/Javascript/PHP I've just started using the CMS called OctoberCMS since both the Laravel framework and OctoberCMS look very well structured and easy to use/maintain. But I'm a little confused on how to process a single detail page or a overview page. Let's take a news page for example. So far I've made this page: title = "News" url = "/news/:news_id?|^[0-9]+$" layout = "default" description = "This is the news page." is_hidden = "0" meta_title = "News" meta

Passing variable to Octobercms blogPosts component

你。 提交于 2020-01-25 08:33:22
问题 On Octobercms blogPosts component i want to pass a variable. I want to change postsPerPage value using: {variable name="blog_postnumber" label="postnumber" tab="postnumber" type="number"}{/variable} on static layout. So i want to be able to change postsPerPage component value with this field on static Pages. I use a partial with blogPosts component. On component postsPerPage field i insert the variable. postsPerPage = "{{ blog_postnumber }}" Then i try to insert a number in my field on my

October CMS | In the controller, create edit button on preview.htm which then links to update.htm with the same ID

不羁的心 提交于 2020-01-25 06:47:31
问题 So what I want to do is, from the backend, click on a list item which then, rather than take you to /mymodel/update/id, it takes you to /mymodel/preview/id. The preview page will then have a button which takes you to /mymodel/update/id which matches the ID as /mymodel/preview/id. I have achieved the first part by changing the config_list.yaml by using 'recordUrl: 'namespace/myplugin/mymodel/preview/:id'.' However, I cannot seem to find a way to make a button which is then aware of the ID of

Laravel: How to update packages in storage/framework

拈花ヽ惹草 提交于 2020-01-07 09:24:45
问题 I have removed a package with composer remove and it's now removed from composer.json and composer.lock files and also removed from vendor directory. But I noticed that it's still listed in these two files: storage/framework/packages.php and storage/framework/services.php . How can I update/rebuild these files? Also, when I run php artisan in the root of my project, I get this error: [Symfony\Component\Debug\Exception\FatalThrowableError] Class 'Morilog\Jalali\JalaliServiceProvider' not found

Laravel: How to update packages in storage/framework

删除回忆录丶 提交于 2020-01-07 09:23:32
问题 I have removed a package with composer remove and it's now removed from composer.json and composer.lock files and also removed from vendor directory. But I noticed that it's still listed in these two files: storage/framework/packages.php and storage/framework/services.php . How can I update/rebuild these files? Also, when I run php artisan in the root of my project, I get this error: [Symfony\Component\Debug\Exception\FatalThrowableError] Class 'Morilog\Jalali\JalaliServiceProvider' not found

Laravel: How to update packages in storage/framework

白昼怎懂夜的黑 提交于 2020-01-07 09:23:00
问题 I have removed a package with composer remove and it's now removed from composer.json and composer.lock files and also removed from vendor directory. But I noticed that it's still listed in these two files: storage/framework/packages.php and storage/framework/services.php . How can I update/rebuild these files? Also, when I run php artisan in the root of my project, I get this error: [Symfony\Component\Debug\Exception\FatalThrowableError] Class 'Morilog\Jalali\JalaliServiceProvider' not found

relationship between user and category OctoberCMS

半腔热情 提交于 2020-01-06 07:52:48
问题 how to establish a relationship between the user and the category? A category has more than one user, and a user belongs to a category I add category_id in the user table on the frontend I display the list of users with the plugin builder but I also want to display the category of the user I use the RainLab user plugin Help me please, thank you in advance 回答1: it seems you need to extend user model and add category relation runtime You need to add this code to your plugin's boot method public

OctoberCMS: How to check if user logged in for all pages

强颜欢笑 提交于 2020-01-02 07:19:08
问题 I am using the following code (in the code section of a page) to redirect users to the login page if they are not logged in: function onStart() { $user = $this->account->user(); if(!$user) { return Redirect::to('/login'); } } How can I avoid doing this in every page and perform this checking in one place for all the pages that need authentication? 回答1: You can use the Session Component as suggested but then you need two layouts : a) Layout for registered Users >> Add session component to this