I like customizing the Landing Page. Its great for having a splash or intro.
However, if I set display:none;
in the .app::before
CSS to remove the Flarum Title bar / Login / Register header, I have no way of getting the guests to the main Flarum forum page.
What I would like to do is have the Landing Page either do its splash animation and redirect th guest to the Flarum main index, or have button that takes the guest to the main Flarum index.
Here is the Landing Page extension source:
https://github.com/johnhearfield/flarum-ext-landing-page
Here is the file I am pretty sure I need to modify:
https://github.com/johnhearfield/flarum-ext-landing-page/blob/master/js/forum/src/components/NewIndexPage.js
Here is the code:
import { extend } from 'flarum/extend';
import IndexPage from 'flarum/components/IndexPage';
export default class NewIndexPage extends IndexPage {
view() {
if(!app.session.user) {
return (
<div class="newIndex page">
<div class="newIndex header">
{m.trust(app.forum.attribute('johnhearfield-landing-page.header'))}
</div>
<div class="newIndex content">
{m.trust(app.forum.attribute('johnhearfield-landing-page.container'))}
</div>
</div>
);
} else {
return super.view();
}
}
}
From my limited understanding of the code, its saying:
If the user is not logged in, take them to the Landing Page Index,
If the user has logged in, take them to the Main Flarum Index.
What I would like it to say is:
If the user is not logged in, take them to the Landing Page Index, wait X-seconds,
then take them to the Main Flarum Index.
If the user is logged in, then take them to the Main Flarum Index (no changes).
Any help or advice would be greatly appreciated.
Thank you.