Search code examples
rflexdashboard

Flexdashboard multiple attributes page


I'm learning flexdashboard and trying some different lay-outs for a future app. But I'm having trouble assigning different attributes for the same page.

I want the second page to have a row lay-out, be listed in nav-bar A and have an icon in front of the title. When I write them like this: {data-orientation=rows, data-navmenu="Menu A", data-icon="fa-list"} none of them is used. When written like this: {data-orientation=rows}, {data-navmenu="Menu A"}, {data-icon="fa-list"} only the last one is executed and the first two are put in the page-title. When using the second one without commas, the same thing happens.

I haven't found any examples of muliple attributes for a page in the examples.

How do I combine them? It must be possible as I can't imagine I have to chose between giving my page a row-format and putting it in a drop-down menu...

This is the code I used:


title: "My flexdash"
output: 
  flexdashboard::flex_dashboard:
    orientation: columns
    vertical_layout: fill
runtime: shiny
---

```{r setup, include=FALSE}
library(flexdashboard)
```

Page 1 {data-navmenu="Menu A"}
======================================    
Column {data-width=350}
-----------------------------------------------------------------------
### Chart A
```{r}

```
Column {data-width=650}
-----------------------------------------------------------------------
### Chart B
```{r}

```
# need these attributes to be working but invisible
Page 2 {data-orientation=rows}, {data-navmenu="Menu A"}, {data-icon="fa-list"}
=============================================   
Row {data-width=650}
-----------------------------------------------------------------------   
### Chart C 
```{r}

```
Row {data-width=350}
-----------------------------------------------------------------------
### Chart D
```{r}

```

Solution

  • Found the answer: I only had to separate them by a space...

    Page 2 {data-orientation=rows data-navmenu="Menu A" data-icon="fa-list"}