Custom Side Nav Links
- Edited
I am trying to add some more links but none of the icons I have tried recently are showing up. I have tried:
fab fa-shop
fab fa-tag
I cant get any to work.
- Edited
fab
is intended for brand icons rather than generic icons.
You should be able to use fas fa-tag
and fas fa-store
/fas fa-shopping-basket
(I can't see a shop
icon on FontAwesome's website?)
- Edited
Hi,
What does the "is Flarum URL?" toggle button do exactly?
- Edited
davwheat Hi, I'm not very good with JS, but I was looking around the code to try to understand it and with a bit of help from ChatGPT, I was wondering if this little change would do it (open all external links in new tab/window):
in the file flarum-ext-custom-sidenav-links/js/src/forum
/index.tsx (line 41) we have this code:
items.add(
'customLink-' + i,
<LinkButton external={!link.internal} href={href} rel="noopener noreferrer" icon={link.icon}>
{link.text}
</LinkButton>,
priority
);
and we could maybe add this target={link.internal ? null : "_blank"}
before icon=
:
items.add(
'customLink-' + i,
<LinkButton external={!link.internal} href={href} rel="noopener noreferrer" target={link.internal ? null : "_blank"} icon={link.icon}>
{link.text}
</LinkButton>,
priority
);
would that do it?
I'm running my forum on Flarum Free. I've activated this extension. When I enter a new link and save it, I see the link show up in the extension for a second then go away. I've tried entering a couple of links, deleting them, turning the extension on/off, clearing my cache but nothing allows me to enter a link that shows up.
Durtdawber You have to save twice, first in the new link form and then in the link list.
Darkle When I enter the link in the form then click save link, the button to save changes says "No changes to save". It does not let me save the links I added.
Darkle Also, if I change the Show Top Spacer and Show Bottom Spacker, then click save settings, It acts like if save the change but when I go back into the Extension, the settings are back to the way they were before I changed them.
Durtdawber That's weird, I think you're on Free Flarum, probably best to report it in their discussion as it may require some testing.
I want to hide the following in my sidebar, is there a way to do it?
- Edited
hello, is it possible to use target="_blank" somewhere?
EDIT:
if anyone need it change this part of code in vendor\davwheat\custom-sidenav-links\js\dist\forum.js :
n.add("customLink-"+r,m(u.a,{external:!e.internal,href:o,rel:"noopener noreferrer",icon:e.icon},e.text),c)
in this:
n.add("customLink-"+r,m(u.a,{external:!e.internal,href:o,rel:"noopener noreferrer",target: e.internal ? null : "_blank",icon:e.icon},e.text),c)
Then deactivate and reactivate the plugin, it should work.
Hello, the link on our site has not been clickable for a few days? Is that the case with you too?
However, it can be opened in a new tab