Search code examples
apostropheapostrophe-cms

How can i add list items and heading together, in the below code i don't see li at all


{{ apos.area(data.page, 'body', { widgets: { 'apostrophe-images': { size: 'full' }, 'apostrophe-rich-text': { toolbar: [ 'Styles', 'Bold', 'Italic', 'Link', 'Unlink','Table' ], styles: [ { name: 'Heading', element: 'h3' }, { name: 'Paragraph', element: 'p' }, { name: 'Listitems', element: 'li' } ] } } }) }}


Solution

  • To add lists to a rich text widget you want to add 'NumberedList' or 'BulletedList' to the toolbar array in your configuration.

    Your code would look like

    {{ apos.area(data.page, 'body', { 
      widgets: { 
        'apostrophe-images': { size: 'full' },
        'apostrophe-rich-text': { 
          toolbar: [ 'Styles', 'Bold', 'Italic', 'Link', 'Unlink', 'Table', 'NumberedList', 'BulletedList' ], 
          styles: [
            { name: 'Heading', element: 'h3' },
            { name: 'Paragraph', element: 'p' }
          ] 
        }
      }
    }) }}