Rename $pageMetadata to $metadata
This commit is contained in:
parent
a8141746d9
commit
df912a4da0
4 changed files with 15 additions and 15 deletions
|
|
@ -103,7 +103,7 @@ Dette betyr:
|
|||
| Variabel | Type | Beskrivelse |
|
||||
|----------|------|-------------|
|
||||
| `$content` | string | Innholdet som skal vises |
|
||||
| `$pageMetadata` | array | Metadata for siden |
|
||||
| `$metadata` | array | Metadata for siden |
|
||||
| `$pageTitle` | string | Sidens tittel |
|
||||
|
||||
### I list.php
|
||||
|
|
|
|||
|
|
@ -62,9 +62,9 @@ Eksempel:
|
|||
|
||||
```php
|
||||
<article class="page-content">
|
||||
<?php if ($pageMetadata && isset($pageMetadata['title'])): ?>
|
||||
<?php if (!empty($metadata) && isset($metadata['title'])): ?>
|
||||
<header>
|
||||
<h1><?= htmlspecialchars($pageMetadata['title']) ?></h1>
|
||||
<h1><?= htmlspecialchars($metadata['title']) ?></h1>
|
||||
</header>
|
||||
<?php endif; ?>
|
||||
|
||||
|
|
@ -117,7 +117,7 @@ Hvis `/app/custom/` ikke eksisterer, bruker PnP standardmaler fra `/app/default/
|
|||
|
||||
### I `page.php`:
|
||||
- `$content` - Sideinnholdet
|
||||
- `$pageMetadata` - Metadata for siden
|
||||
- `$metadata` - Metadata for siden
|
||||
- `$pageTitle` - Sidens tittel
|
||||
|
||||
### I `list.php`:
|
||||
|
|
|
|||
|
|
@ -1,23 +1,23 @@
|
|||
<article>
|
||||
<?= $content ?>
|
||||
|
||||
<?php if ($pageMetadata && (isset($pageMetadata['tags']) || isset($pageMetadata['categories']))): ?>
|
||||
<?php if (!empty($metadata) && (isset($metadata['tags']) || isset($metadata['categories']))): ?>
|
||||
<aside class="metadata">
|
||||
<?php if (!empty($pageMetadata['categories'])): ?>
|
||||
<?php if (!empty($metadata['categories'])): ?>
|
||||
<div class="categories">
|
||||
<strong><?= htmlspecialchars($translations['categories'] ?? 'Categories') ?>:</strong>
|
||||
<?php
|
||||
$categories = array_map('trim', explode(',', $pageMetadata['categories']));
|
||||
$categories = array_map('trim', explode(',', $metadata['categories']));
|
||||
echo implode(', ', array_map('htmlspecialchars', $categories));
|
||||
?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (!empty($pageMetadata['tags'])): ?>
|
||||
<?php if (!empty($metadata['tags'])): ?>
|
||||
<div class="tags">
|
||||
<strong><?= htmlspecialchars($translations['tags'] ?? 'Tags') ?>:</strong>
|
||||
<?php
|
||||
$tags = array_map('trim', explode(',', $pageMetadata['tags']));
|
||||
$tags = array_map('trim', explode(',', $metadata['tags']));
|
||||
echo implode(', ', array_map('htmlspecialchars', $tags));
|
||||
?>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ These are extracted via `extract()` so they're direct PHP variables:
|
|||
| Variable | Type | Description |
|
||||
|---|---|---|
|
||||
| `$content` | string | Rendered page content HTML |
|
||||
| `$pageMetadata` | array | Full metadata array from `metadata.ini` |
|
||||
| `$metadata` | array | Full metadata array from `metadata.ini` |
|
||||
|
||||
## Additional Variables in list-*.php Templates
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue