I'm using your convenient Links extension in relation to your static Pages extension. Combined they allow for significant enhancement of Flarum's header overall. My objective at the moment is to have this left-to-right order:
- Main page (this is actually Flarum's
h1.Header-link
block, but it will be styled to look like the first item in the menu list)
- Guidelines
- User groups
- Help
So the last three links are created with your extension (and point to three pages created with your Pages extension). You can see the idea in the image shared here.
Ordering
However, I'm having trouble getting the three links in the left-to-right order I want. I didn't foresee the fact there's no way to re-order the links after they're created — and I've tried deleting all the pages then recreating them again thinking maybe the page IDs had something to do with it, but nothing is working.
I would propose you provide some means for easily putting links in the l-to-r order people want after the link/page combos are created. That's definitely going to be needed.
Styling
Also, I'm having a very hard time getting the links styled to match the h1
link, which seems to be because the links are using the .Buttons
classes. I don't know if that's Flarum forcing you to use those selectors, or the design of your extension, but it's a little annoying. I highly recommend you don't use those selectors so we can style those links as an actual menu. They're not supposed to be buttons, so no button rules should need to be overridden. When I try to override the links as needed, it screws up the other actual buttons (e.g. at right of search box and the back-button in top-left). There shouldn't be a need to fight that so much. It's overly complicated as is.
Combined Pages/Links extension
Finally, and I'm probably dreaming, but it would be great if you combined your Links and Pages extension into a single extension and it functioned like this. I'm modeling it here mostly after your Pages extension, which is a little out of context in this thread, sorry:
- The default form provides fields for (mostly the same as you have now in your Pages extension):
- Title (used as link label)
- Slug (used as url-only title)
- Content (of course)
- Output location (radio buttons or a select menu for indicating where page link will appear)
- List order (1, 2, 3... etc; the order in which the link should appear in the output location)
- Existing pages (a table list that adds *Output location** to your existing Edit, View, Delete items)
- Example Output location options:
- Draft (not yet assigned; won't output anywhere)
- Primary menu (i.e.
.Header-primary ul.Header-controls
)
- Side menu (the core functional menu: All discussions, Following, Tags, etc.)
- Footer menu (i.e.
Footer ul.Footer-list1
— a hypothetical location in the future)
- etc
- When selecting an Output location (e.g., Primary menu), a link is added to that location automatically (no need to separately use the Links extension).
The advantages of this should be clear: automatic links, order control, etc.
You could then change the function of your Links extension to be External Links only and remove the need for indicating whether the link is Flarum or external.