Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Readme and container calling #1

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 76 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,82 @@ Soflomo\Sitemap is a simple sitemap generation module for Zend Framework 2. It p

Installation
---
Soflomo\Sitemap can be loaded via composer. Require `soflomo/sitemap`. The current version is tagged as 0.1.0, so you can use the constraint `>=0.1.0,<0.2.0-dev`. After the module is loaded, do not forget to enable it in your application.config.php under the module name `Soflomo\Sitemap`.
Soflomo\Sitemap can be loaded via composer. Require `soflomo/sitemap`. The current version is tagged as 0.1.0, so you can use the constraint `>=0.1.0,<0.2.0-dev`.

```json
"require": {
"soflomo/sitemap": ">=0.1.0,<0.2.0-dev",
}
```

After the module is loaded, do not forget to enable it in your application.config.php under the module name `Soflomo\Sitemap`.

```php
return array(
'modules' => array(
// ...
'Sitemap',
),
// ...
);
```

Usage
---
Visit `/sitemap` for the html version. The `/sitemap/xml` is the XML version for the sitemap. Soflomo\Sitemap uses the default navigation container. If you want to set another container to be rendered, inject this container in the navigation view helper prior to the dispatch of the `Soflomo\Sitemap\Controller\SitemapController`.

Add a navigation container to the Application module.config.php or the application.config.php outlining your application sitemap:

```php
return array(
'navigation' => array(
'default' => array(
array(
'label' => 'Home',
'route' => 'home',
'lastmod' => '2013-09-09',
'changefreq' => 'daily',
'priority' => '0.5',
),
array(
'label' => 'About',
'route' => 'about',
'lastmod' => '2013-09-09',
'changefreq' => 'daily',
'priority' => '0.5',
),
array(
'label' => 'Services',
'controller' => 'services',
'pages' => array(
array(
'label' => 'Basic',
'action' => 'basic',
'controller' => 'services',
'class' => 'sub-menu',
'title' => 'Basic Service',
'active' => true,
),
array(
'label' => 'Advanced',
'action' => 'advanced',
'controller' => 'services',
'class' => 'sub-menu',
'title' => 'Advanced Service',
'active' => true,
),
),
),
array(
'label' => 'Contact',
'route' => 'contact',
'lastmod' => '2013-09-09',
'changefreq' => 'daily',
'priority' => '0.5',
),
},
),
// ...
);
```

Visit `/sitemap` for the html version. The `/sitemap/xml` is the XML version for the sitemap. Soflomo\Sitemap uses the default navigation container. If you want to set another container to be rendered, inject this container in the navigation view helper prior to the dispatch of the `Soflomo\Sitemap\Controller\SitemapController`.
4 changes: 2 additions & 2 deletions view/soflomo/sitemap/index.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
<p>The sitemap in XML format can be downloaded <a href="<?= $this->url('sitemap/xml')?>">here</a></p>
</div>

<?= $this->navigation()->menu()
<?= $this->navigation('navigation')->menu()
->setMinDepth(null)
->setMaxDepth(null)
->setOnlyActiveBranch(false)
->setRenderInvisible(true)?>
</article>
</article>
2 changes: 1 addition & 1 deletion view/soflomo/sitemap/xml.phtml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?= $this->navigation()->sitemap()->setRenderInvisible(true)?>
<?= $this->navigation('navigation')->sitemap()->setRenderInvisible(true)?>