rstudio / flexdashboard

Easy interactive dashboards for R
https://pkgs.rstudio.com/flexdashboard/
Other
812 stars 301 forks source link

modify the components of social option with dropdown menu #261

Open ozturkib opened 4 years ago

ozturkib commented 4 years ago

How can I modify the components of social option with dropdown menu ?

social: [ "twitter", "facebook", "linkedin"] This option does not combine those three in drop down menu. Hence, mobile view is weird.

social: menu This option combines components but i cannot change what are the components.

Basically what I need is similar to "menu" but I would like to able to change what are the components inside the menu. Is it possible ? Thanks

Mike-Henderson1 commented 2 years ago

Hi there, I've had this same question for several months now, but wasn't able to find the answer. Turns out I had to do some digging. Instead of defining the links you want to include on the right side of the navbar in the yaml, create an html file that includes some variation of this:

<script id="flexdashboard-navbar" type="application/json"> [{"title":"Links","items":[{"title":"ESPN","href":"espn.com","target":"_blank","align":"right"},{"title":"Google","href":"google.com","target":"_blank","align":"right"}]}] </script>

If you want to keep the social icon instead of text, replace "title":"Links","items": with "icon":"fa-share-alt","items": Then refer to that html file in the yaml instead:

flex_yaml

At this point, you may no longer care, but sharing anyways in the hopes that I can prevent any other poor soul with zero JS or html background from spending hours in vain trying to implement what seems like it should be an easy and doable adjustment.