ng2-contentful-blog
v2.0.6
Published
Module for creating a blog using [Contentful](https://www.contentful.com/)
Downloads
9
Keywords
Readme
ng2-contentful-blog
Module for creating a blog using Contentful
Components & services
- HeaderMenuComponent
- FooterMenuComponent
- BreadcrumbsService
- BreadcrumbsComponent
- RoutesManagerService
- RoutesGatewayComponent
- RoutesGatewayGuard
- ContenfulContent
- ContentfulImageDirective
- EmbeddedEntryComponent
- VizabiEntryComponent
- HtmlEntryComponent
- EntriesViewComponent
- VideoEntryComponent
- TagsComponent
- TagComponent
- MarkdownPipe
- ToDatePipe
- ContentfulService
- ContributorsComponent
- ProfileComponent
ng2-contentful-blog components diagram
Content model that should exist on Contentful
Menu
- includes fields:
title
(Short text
)Settings:
- Check:
This field represents the Entry title
- Validations:
This field is required
- Appearance:
Single line
- Check:
submenus
(References, many
)Settings:
- Validations => Specify allowed entry type:
Submenu
- Appearance:
Entry links list
- Validations => Specify allowed entry type:
entryPoint
(Reference
)Settings:
- Validations => Specify allowed entry type:
Article
- Appearance:
Entry link
- Validations => Specify allowed entry type:
Submenu
- includes fields:
title
(Short text
)Settings:
- Check:
This field represents the Entry title
- Validations:
This field is required
- Appearance:
Single line
- Check:
entryPoint
(Reference
)Settings:
- Validations => Specify allowed entry type:
Article
- Appearance:
Entry link
- Validations => Specify allowed entry type:
thumbnail
(Media
)
Header
- includes fields:
title
(Short text
)Settings:
- Check:
This field represents the Entry title
- Validations:
This field is required
- Appearance:
Single line
- Check:
entries
(References, many
)Settings:
- Validations => Specify allowed entry type:
Menu
- Appearance:
Entry links list
- Validations => Specify allowed entry type:
Footer
- includes fields:
title
(Short text
)Settings:
- Check:
This field represents the Entry title
- Validations:
This field is required
- Appearance:
Single line
- Check:
entries
(References, many
)Settings:
- Validations => Specify allowed entry type:
Menu
- Appearance:
Entry links list
- Validations => Specify allowed entry type:
Tag
- for creating and attaching tags in Article
, includes fields:
title
(Short text
)Settings:
- Check:
This field represents the Entry title
- Validations:
This field is required
- Appearance:
Slug
- Check:
slug
(Short text
)Settings:
- Appearance:
Slug
- Appearance:
Html
- model that it used to create the html blocks for Article
, includes fields:
title
(Short text
)Settings:
- Check:
This field represents the Entry title
- Appearance:
Single line
- Check:
content
(Long text
)Settings:
- Appearance:
Markdown
- Appearance:
Video
- model that it used to create the video blocks (via iframe) for Article
, includes fields:
title
(Short text
)Settings:
- Check:
This field represents the Entry title
- Appearance:
Single line
- Check:
description
(Long text
)Settings:
- Appearance:
Markdown
- Appearance:
youtube
(Short text
)vimeo
(Short text
)
Embedded
- to create a block of any embedded content (via iframe) for Article
, includes fields:
title
(Short text
)Settings:
- Check:
This field represents the Entry title
- Appearance:
Single line
- Check:
link
(Long text
)Settings:
- Validations:
This field is required
- Appearance:
Single line
- Validations:
Vizabi
- to create a vizabi composition block uses vizabi's state
, includes fields:
title
(Short text
)Settings:
- Check:
This field represents the Entry title
- Appearance:
Single line
- Check:
state
(Long text
)Settings:
- Validations:
This field is required
- Appearance:
Single line
- Validations:
Article
- blueprint of the page for posts/list of posts, includes fields:
title
(Short text
)Settings:
- Check:
This field represents the Entry title
- Validations:
This field is required
- Appearance:
single line
- Check:
slug
(Short text
)Settings:
- Appearance:
slug
- Appearance:
thumbnail
(Media
)description
(Long text
)Settings:
- Appearance:
Markdown
- Appearance:
entries
(References, many
)Settings:
- Validations => Specify allowed entry type:
Html
,Video
,Embedded
,Vizabi
- Appearance:
Entry links list
- Validations => Specify allowed entry type:
related
(References, many
)Settings:
- Validations => Specify allowed entry type:
Article
- Appearance:
Entry links list
- Validations => Specify allowed entry type:
created at
(Date & time
)Settings:
- Validations:
This field is required
- Validations:
show in main page slider
(Boolean
)parent
(Reference
)Settings:
- Validations => Specify allowed entry type:
Article
- Appearance:
Entry link
- Validations => Specify allowed entry type:
tags
(References, many
)Settings:
- Validations => Specify allowed entry type:
Tag
- Appearance:
Entry links list
- Validations => Specify allowed entry type:
Contribution
- includes fields:
description
(Long text
)Settings:
- Appearance:
Markdown
- Appearance:
article
(Reference
)Settings:
- Validations => Specify allowed entry type:
Article
- Appearance:
Entry card
- Validations => Specify allowed entry type:
Profile
- includes fields:
user name
(Short text
)Settings:
- Check:
This field represents the Entry title
- Validations:
This field is required
- Appearance:
single line
- Check:
first name
(Short text
)Settings:
- Validations:
This field is required
- Appearance:
Single line
- Validations:
last name
(Short text
)Settings:
- Validations:
This field is required
- Appearance:
Single line
- Validations:
avatar
(Media
)title
(Short text
)Settings:
- Appearance:
Single line
- Appearance:
location
(Short text
)Settings:
- Appearance:
Single line
- Appearance:
email
(Short text
)Settings:
- Validations:
Match a specific pattern
->E-Mail
- Appearance:
Single line
- Validations:
facebook
(Short text
)Settings:
- Appearance:
Single line
- Appearance:
google+
(Short text
)Settings:
- Appearance:
Single line
- Appearance:
linkedin
(Short text
)Settings:
- Appearance:
Single line
- Appearance:
twitter
(Short text
)Settings:
- Appearance:
Single line
- Appearance:
aboute me
(Long text
)Settings:
- Appearance:
Markdown
- Appearance:
contributions
(References, many
)Settings:
- Validations => Specify allowed entry type:
Contribution
- Appearance:
Entry links list
- Validations => Specify allowed entry type:
my links
(References, many
)Settings:
- Validations => Specify allowed entry type:
Embedded
,Html
,Video
,Vizabi
- Appearance:
Entry links list
- Validations => Specify allowed entry type:
Basic usage Article
Go to contentful
choose content
then choose Add entry
and fill in Article
, for example:
Create first page - Page test
title
: Page testslug
: page-testdescription
: first pageentries
- create newhtml
Create second page - Sub page
title
: Sub pageslug
: sub-pagedescription
: Sub page testentries
- create newhtml
related
:Page test
parent
:Page test
tags
: blog
Basic usage Menu
Go to contentful
choose content
then choose Add entry
and fill in Menu
, for example:
Create first menu item
title
: Menu itemsubmenus
: select or createSubMenu
OR
entryPoint
: select or createArticle
Note: priority will be submenus
Create HeaderMenu
title
: HeaderMenuentries
:Menu item
(your menu item)
Demo
git clone [email protected]:VS-work/ng2-contentful-blog.git
- in folder
ng2-contentful-blog/demo
- open and edit next files:
contentful.cfg.json
- add your accessToken and spaceNg2ContentfulConfig.config = { accessToken: CONTENTFUL_ACCESS_TOKEN, space: CONTENTFUL_SPACE_ID, host: CONTENTFUL_HOST };
contentTypeIds.json
update all id (keys) according to yourcontent model
=>JSON preview
, for exampleGet value from
sys.id
which is***YOUR ID***
and put intocontentTypeIds.json
:{ "NODE_PAGE_TYPE_ID": "***YOUR ID***", "TAG_TYPE_ID": "***YOUR ID***", "VIDEO_TYPE_ID": "***YOUR ID***", "HTML_TYPE_ID": "***YOUR ID***", "EMBEDDED_TYPE_ID": "***YOUR ID***", "PROFILE_TYPE_ID": "***YOUR ID***", "CONTRIBUTION_TYPE_ID": "***YOUR ID***", "HEADER_TYPE_ID": "***YOUR ID***", "FOOTER_TYPE_ID": "***YOUR ID***", "VIZABI_TYPE_ID": "***YOUR ID***" }
npm i && npm run dev
localhost:8080/#/*your menu item*
for examplelocalhost:8080/#/page-test