Hi. I am trying to extend the doc's Homepage setting values, as shown in the doc : https://docs.flarum.org/extend/frontend-pages#setting-page-as-homepage
In the examples shown there is a problem :
- the doc says
flarum/common/components/BasicsPage
- the Github example file linked (Tags extension) says
flarum/components/BasicsPage
- the file installed by composer (Tags extension) says
flarum/admin/components/BasicsPage
This is confusing to say the least ! I have tried all three without success. Here are the other files in my extension for the record :
// js/admin.js
export * from './src/admin';
// js/src/admin/index.js
import addMyHomePageOption from './addMyHomePageOption';
app.initializers.add('flarum-my', function(app) {
addMyHomePageOption();
});
// js/src/admin/addMyHomePageOption.js
import { extend } from 'flarum/common/extend';
import BasicsPage from 'flarum/components/BasicsPage';
export default function () {
extend(BasicsPage.prototype, 'homePageItems', items => {
items.add('my', {
path: '/my',
label: 'My welcome page',
});
});
};
The extension is active and another unrelated customization works.
What am I missing ?
Regards
edit apparently this should be flarum/admin/components/BasicsPage
since there is a vendor/flarum/core/js/src/admin/components/BasicsPage.tsx
file. Doesn't work any better. Errors in the console :
flarum-my failed to initialize
TypeError: flarum_admin_components_BasicsPage__WEBPACK_IMPORTED_MODULE_1___default.a is undefined