Skip to content

Commit

Permalink
Merge branch 'master' of git.hrzg.de:dmstr/yii2-pages-module
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Stebe committed Mar 31, 2015
2 parents b94464c + 5cc6abf commit 7474ee8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions models/Tree.php
Expand Up @@ -269,6 +269,11 @@ public function createUrl($additionalParams = [])
*/
public static function getSluggedUrl($leave)
{
// pages with children do not get an URL
if ($leave->children(1)->one()) {
return null;
}

if ($leave->route) {

// TODO provide all parents in URL
Expand Down
2 changes: 1 addition & 1 deletion views/treeview/_form.php
Expand Up @@ -334,7 +334,7 @@ function renderContent($part)
</div>

<hr/><h4><?= Yii::t('kvtree', 'SEO') ?></h4>
<?php if ($node->route != '/site/index' && $node->route != null) : ?>
<?php if ($node->createUrl() != null) : ?>
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
<?= $form->field(
Expand Down

0 comments on commit 7474ee8

Please sign in to comment.