Skip to content
This repository has been archived by the owner on Mar 11, 2024. It is now read-only.

Commit

Permalink
Allow to set url:false. Closes #74
Browse files Browse the repository at this point in the history
  • Loading branch information
sylvainjule committed Feb 26, 2022
1 parent c1a391d commit ec4ed15
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion index.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion lib/pagetable.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,10 @@
$permissions = $item->permissions();
$blueprint = $item->blueprint();
$image = $item->panelImage($this->image ?? []);
$url = $item->panel()->url(true);
$url = false;
if($this->url == 'panel') {
$url = $item->panel()->url(true);

This comment has been minimized.

Copy link
@afbora

afbora Feb 26, 2022

Contributor

@sylvainjule Thanks for enhancement 👏 But this line should be like following to override from custom models.

$url = $item->panelUrl(true);

This comment has been minimized.

Copy link
@sylvainjule

sylvainjule Feb 26, 2022

Author Owner

It was, I just changed in in the previous commit as it is flagged as deprecated on the website. Isn't it?

https://getkirby.com/docs/reference/objects/cms/page/panel-url

This comment has been minimized.

Copy link
@afbora

afbora Feb 26, 2022

Contributor

And for preview:

if($this->url == 'preview') {
    $url = $item->previewUrl();
}

This comment has been minimized.

Copy link
@afbora

afbora Feb 26, 2022

Contributor

Oh! You are absolutely right. It escaped my notice. This is bad news for me. What do you think of previewUrl.

This comment has been minimized.

Copy link
@sylvainjule

sylvainjule Feb 26, 2022

Author Owner

I'll update the preview one!

}
if($this->url == 'preview') {
$url = $item->url();
}
Expand Down
2 changes: 1 addition & 1 deletion src/assets/css/theme/_custom.scss
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ $structure-item-height: 40px;
height: $structure-item-height;
padding: 0;
&:not(.cover-image) {
a {
a, span[data-disabled] {
display: block;
width: 100%;
padding: .5rem .75rem;
Expand Down

0 comments on commit ec4ed15

Please sign in to comment.