An open API service indexing awesome lists of open source software.

https://github.com/webreinvent/vaahcms-module-cms

CMS module for VaahCMS Framework
https://github.com/webreinvent/vaahcms-module-cms

cms cms-module module php vaahcms vue vuejs vuex

Last synced: 10 months ago
JSON representation

CMS module for VaahCMS Framework

Awesome Lists containing this project

README

          

# vaahcms-module-cms
Cms Module for VaahCMS

#### New Version Release
- Version should be updated in `composer.json` and `Config/config.php` file

#### For Hot Reload add following:
```dotenv
MODULE_CMS_ENV=develop
```

#### Frontend Routes

```php

/{permalink}

/{content_type}/{permalink}

/taxonomies/{taxonomy_type_slug}/{taxonomy_slug}

/search

```

## Helper Methods

#### Theme Locations
```blade
{!! vh_location('top', true) !!}
```

#### Content
```blade
{!! get_content($data) !!} // return HTML format

{!! get_the_content($data) !!} // return DATA format
```

```php
get_content(Content $content, $type=null)

$type = content/template;
```

#### Content List
```blade
{!! get_contents('page') !!} // return HTML format

{!! get_the_contents('page') !!} // return DATA format
```

```php
get_contents($content_type_slug='pages', array $args = null,$has_pagination = true)

$args = [

'q' => 'search_item',
'per_page' => 5, // default = 20
'include_groups' => [], // group_slug
'exclude_groups' => [], // group_slug
'order' => 'name', // default = id
'order_by' => 'asc', // default = desc asc/desc/ASC/DESC
'container_opening_tag' => '

',
'container_closing_tag' => '
',
'content_opening_tag' => '
',
'content_closing_tag' => '
'

];
```

#### Field
```blade
{!! get_field($data, 'title', 'default') !!} // return HTML format

{!! get_the_field($data, 'title', 'default') !!} // return DATA format
```

```php
get_field(Content $content, $field_slug,
$group_slug='default', $type='content',
$group_index = 0 , $field_index = null)

$type = content/template;

$group_index = 0/1/2/3/4/.....
$field_index = 0/1/2/3/4/.....
```

#### Group
```blade
{!! get_group($data ,'default' ) !!} // return HTML format

{!! get_the_group($data ,'default' ) !!} // return DATA format
```

```php
get_group(Content $content, $group_slug='default',
$type='content, $group_index = null)

$type = content/template;

$group_index = 0/1/2/3/4/.....
```

## API

#### Content
```php
parameter = [

'q' => 'search_item',
'per_page' => 5, // default = 20
'include_groups' => [], // group_slug
'exclude_groups' => [], // group_slug
'order' => 'name', // default = id
'order_by' => 'asc', // default = desc asc/desc/ASC/DESC

];

/api/cms/contents/{plural_slug}
```

```php
/api/cms/contents/{singular_slug}/{content_slug}
```

#### Content Type
```php
/api/cms/contents-types

/api/cms/contents-types/{slug}
```

#### To Run Modules Dusk Test:
- Change path of dusk in `phpunit.dusk.xml` to following:
```xml

./VaahCms/Modules/Cms/Tests/Browser

```

- Then run `php artisan dusk`

### Change Log
- Install `npm install auto-changelog -g`
- To generate `CHANGELOG.md`, run `auto-changelog --commit-limit false` in the root folder of the project

Maintain following pre-fixes to your commit messages:
```md
Added:
Changed:
Deprecated:
Removed:
Fixed:
Security:
```