Skip to content

Commit a31ae70

Browse files
committed
Use custom placeholder instead of insert tag like syntax
1 parent f03aa0a commit a31ae70

File tree

4 files changed

+7
-8
lines changed

4 files changed

+7
-8
lines changed

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,18 @@ Show articles within navigation menus.
66
Articles can be configured within the page structure and can be selected per page and module. So it is possible to use
77
different articles for different navigations modules displaying the same page.
88

9-
**The "nav_bbit_navi_art" or another proper customized navigation template is required in order to display the
9+
**The "nav_hofff_navi_art" or another proper customized navigation template is required in order to display the
1010
associated articles.**
1111

1212
**Navigation sublevels can be inserted at the desired position within
13-
the article by using the insert tag {{bbit_navi_art}} in the
14-
article.**
13+
the article by using the placeholder `##hofff_navi_art##` in the article.**
1514

1615

1716
Configuration
1817
-------------
1918

2019
By default, only articles marked as "reference article" are provided as article options. You can disable it if you want
21-
to see all available articles by adding following configuration to your `config.yml`:
20+
to see all available articles by adding the following configuration to your `config.yaml`:
2221

2322
```yaml
2423
hofff_contao_navigation_article:

src/Resources/contao/languages/de/tl_module.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@
99
'Das "nav_hofff_navi_art" oder ein '
1010
. 'selbst angepasstes Navigationstemplate wird für diese Funktion '
1111
. 'benötigt. Im zugeordneten Artikel wird das Insert-Tag '
12-
. '"{{hofff_navi_art}}" durch die nächste Navigationsebene ersetzt.',
12+
. '"##hofff_navi_art##" durch die nächste Navigationsebene ersetzt.',
1313
];

src/Resources/contao/languages/en/tl_module.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@
1111
. 'proper customized navigation template is required in order to '
1212
. 'display the associated articles. Navigation sublevels can be '
1313
. 'inserted at the desired position within the article by using the '
14-
. 'insert tag "{{hofff_navi_art}}" in the article.',
14+
. 'insert tag "##hofff_navi_art##" in the article.',
1515
];

src/Resources/contao/templates/nav_hofff_navi_art.html5

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<?php foreach ($this->items as $item):
33
?><?php if (empty($item['subitems']) && !empty($item['hofff_navi_art'])) $item['class'] = trim($item['class'] . ' submenu');
44
?><?php if ($item['isActive'] ?? false):
5-
?><li class="active <?php if($item['class']) echo $item['class']; ?>"><strong class="<?php if($item['isActive']) echo 'active '; if($item['class']) echo $item['class']; ?>"<?php if (!empty($item['subitems']) || (!empty($item['hofff_navi_art']))) echo ' aria-haspopup="true"'; ?>><span itemprop="name"><?= $item['link'] ?></span></strong><?php if(!empty($item['hofff_navi_art'])) echo ('<div class="sublevel">'), str_replace('{{hofff_navi_art}}', $item['subitems'] ?? '', $item['hofff_navi_art'] ?? ''), ('</div>'); else echo $item['subitems'] ?? '';
5+
?><li class="active <?php if($item['class']) echo $item['class']; ?>"><strong class="<?php if($item['isActive']) echo 'active '; if($item['class']) echo $item['class']; ?>"<?php if (!empty($item['subitems']) || (!empty($item['hofff_navi_art']))) echo ' aria-haspopup="true"'; ?>><span itemprop="name"><?= $item['link'] ?></span></strong><?php if(!empty($item['hofff_navi_art'])) echo ('<div class="sublevel">'), str_replace('##hofff_navi_art##', $item['subitems'] ?? '', $item['hofff_navi_art'] ?? ''), ('</div>'); else echo $item['subitems'] ?? '';
66
?></li
77
><?php else:
88
?><li<?php if ($item['class']) echo ' class="' . $item['class'] . '"'; ?>
@@ -17,7 +17,7 @@
1717
><span itemprop="name"><?= $item['link']
1818
?></span
1919
></a
20-
><?php if(!empty($item['hofff_navi_art'])) echo ('<div class="sublevel">'), str_replace('{{hofff_navi_art}}', $item['subitems'] ?? '', $item['hofff_navi_art'] ?? ''), ('</div>'); else echo $item['subitems'] ?? '';
20+
><?php if(!empty($item['hofff_navi_art'])) echo ('<div class="sublevel">'), str_replace('##hofff_navi_art##', $item['subitems'] ?? '', $item['hofff_navi_art'] ?? ''), ('</div>'); else echo $item['subitems'] ?? '';
2121
?></li
2222
><?php endif;
2323
?><?php endforeach; ?>

0 commit comments

Comments
 (0)