ng-wordpress-templates
v0.1.1
Published
Templates used by headless Wordpress with Angular
Downloads
72
Readme
This library contains different templates that can be used by a headless Wordpress application with Angular.
How to use
The templates provided with this library are supposed to work with the corresponding theme/templates on the server side. Therefore, download pschild-angular-wordpress-theme and use it in your Wordpress installation.
First, install the library using
npm i ng-wordpress-templates --save
After that you can import the main module (NgWordpressServicesModule
) and any of the template modules you want to use into your AppModule.
The NgWordpressServicesModule
expects a configuration (containing URLs etc.) to be passed via forRoot()
method.
You can either use static values or values read from your environment when you want to provide different values for different build types.
Important: the template modules use the configuration passed via NgWordpressServicesModule.forRoot()
and also rely on services provided by this module, so don't forget to call the method.
...
import {
NgWordpressServicesModule,
TplTextModule,
TplGalleryModule,
...
} from '@ngWordpressTemplates';
@NgModule({
...
imports: [
...
NgWordpressServicesModule.forRoot({
apiUrl: environment.apiUrl,
staticSharerUrl: environment.staticSharerUrl,
menuName: 'main'
}),
TplTextModule,
TplGalleryModule,
...
],
...
})
Templates
- Text:
TplTextModule
- Timeline:
TplTimelineModule
- Projects:
TplProjectsModule
- Posts:
TplPostsModule
- Codeblocks:
TplCodeblocksModule
- Gallery:
TplGalleryModule
- TextGallery:
TplTextGalleryModule
- TextMediaSlider:
TplTextMediaSliderModule
Services
PageService
PostService
MediaService
ProjectsService
TimelineService
NavigationService
Included Plugins (peer dependencies)
- https://github.com/orizens/angular2-infinite-scroll
- https://github.com/KoderLabs/ng2-device-detector
- (https://github.com/zyra/ngx-facebook)
- highlight.js - Code Highlighting
- hammerjs - Touch Gestures