Skip to content

Commit 0e88bca

Browse files
committed
fix(training): standard PDF iframe URL and clarify PDF vs SVG for links
- Point iframe at plain PDF URL (no viewer hash) for native link behaviour - Nova copy: recommend PDF for clickable roadmap links; SVG as static-only Made-with: Cursor
1 parent c58e860 commit 0e88bca

2 files changed

Lines changed: 8 additions & 9 deletions

File tree

app/Nova/TrainingResource.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -157,12 +157,12 @@ public function fields(Request $request): array
157157

158158
Select::make('Roadmap embed format', 'roadmap_embed_kind')
159159
->options([
160-
'pdf' => 'PDF (inline viewer)',
161-
'svg' => 'SVG (paste markup below)',
160+
'pdf' => 'PDF (recommended — keeps clickable links from the file)',
161+
'svg' => 'SVG (static graphic; exports usually do not preserve PDF links)',
162162
'none' => 'None (remove placeholder output)',
163163
])
164164
->default('pdf')
165-
->help('Use [[embed_roadmap_pdf]] or [[embed_roadmap]] in Content where the roadmap should appear.'),
165+
->help('Put [[embed_roadmap_pdf]] or [[embed_roadmap]] in Content where the roadmap should appear. Use PDF when the roadmap must open real URLs from the document.'),
166166

167167
Text::make('Roadmap PDF embed URL', 'roadmap_pdf_embed_url')
168168
->nullable()
@@ -174,7 +174,7 @@ public function fields(Request $request): array
174174
$field->hide();
175175
}
176176
})
177-
->help('HTTPS URL to the roadmap PDF. Used when format is PDF.'),
177+
->help('HTTPS URL to the PDF. Shown in an iframe with the browser’s built-in PDF viewer so links inside the file stay active.'),
178178

179179
Textarea::make('Roadmap SVG', 'roadmap_svg')
180180
->nullable()
@@ -186,7 +186,7 @@ public function fields(Request $request): array
186186
$field->hide();
187187
}
188188
})
189-
->help('Full <svg>...</svg> markup from your design tool. Used when format is SVG.'),
189+
->help('Optional: paste full <svg>...</svg> only for a non-interactive graphic. For clickable resources, prefer PDF above.'),
190190

191191
Text::make('Button text', 'button_text')->nullable(),
192192

resources/views/training/partials/roadmap-pdf-embed.blade.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@
22
'url',
33
])
44
@php
5-
// Strip any fragment from stored URL for the "open in new tab" link.
5+
// Strip any fragment from stored URL for the "open in new tab" link and iframe src.
6+
// Use the plain PDF URL in the iframe so the browser's native viewer keeps link annotations working.
67
$tabUrl = \Illuminate\Support\Str::before($url, '#');
7-
// Native PDF in iframe keeps link annotations clickable (canvas PDF.js viewers do not).
8-
$fragment = '#toolbar=0&navpanes=0&scrollbar=1&view=FitH';
9-
$embedSrc = $tabUrl.$fragment;
8+
$embedSrc = $tabUrl;
109
@endphp
1110
<div class="w-full max-w-full my-6 rounded-xl overflow-hidden border border-slate-200 bg-slate-100 shadow-sm">
1211
<iframe

0 commit comments

Comments
 (0)