Skip to content

Commit

Permalink
feat: add entry link
Browse files Browse the repository at this point in the history
  • Loading branch information
michtio committed Sep 6, 2022
1 parent 2b24ae3 commit 7be5e3b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/services/ShortlinkService.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public function handleRedirect(): void

// check if our hostname is not one of the existing Craft sites, if so redirect
// TODO add !array_intersect
if(array_intersect($needle, $baseUrls)) {
if(!array_intersect($needle, $baseUrls)) {
// check if query string should be stripped or not
if (!Shortlink::$settings->redirectQueryString) {
$path = UrlHelper::stripQueryString($path);
Expand Down
6 changes: 5 additions & 1 deletion src/templates/dashboard/index.twig
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@
<span class="text-gray-600">{{- shortlink.shortlinkUri -}}</span>
</div>
<div class="col-span-3 flex items-center">
<span class="text-gray-600 break-all">{{- shortlink.destination -}}</span>
{% set entry = craft.entries().id(shortlink.ownerId).one() %}
<span class="text-gray-600 break-all">
<a class="go" href="{{- entry.cpEditUrl -}}" title="{{- entry.title -}}" target="_blank" rel="noopener">{{- entry.title -}}</a>

</span>
</div>
<div class="hide md:flex items-center">
<span class="text-gray-600">{{- shortlink.httpCode }}</span>
Expand Down

0 comments on commit 7be5e3b

Please sign in to comment.