-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEATURE] Move HMENU special userfunc example from TSREF (#43)
* [FEATURE] Move HMENU special userfunc example from TSREF refs TYPO3-Documentation/t3docs-screenshots#151 * [FEATURE] Move HMENU special userfunc example from TSREF refs TYPO3-Documentation/t3docs-screenshots#151 Co-authored-by: lina.wolf <[email protected]>
- Loading branch information
Showing
4 changed files
with
770 additions
and
403 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace T3docs\Examples\Userfuncs; | ||
|
||
class CustomMenu | ||
{ | ||
|
||
public function makeMenuArray(string $content, array $conf) : array | ||
{ | ||
return [ | ||
[ | ||
'title' => 'Contact', | ||
'_OVERRIDE_HREF' => 'index.php?id=10', | ||
'_SUB_MENU' => [ | ||
[ | ||
'title' => 'Offices', | ||
'_OVERRIDE_HREF' => 'index.php?id=11', | ||
'_OVERRIDE_TARGET' => '_top', | ||
'ITEM_STATE' => 'ACT', | ||
'_SUB_MENU' => [ | ||
[ | ||
'title' => 'Copenhagen Office', | ||
'_OVERRIDE_HREF' => 'index.php?id=11&officeId=cph', | ||
], | ||
[ | ||
'title' => 'Paris Office', | ||
'_OVERRIDE_HREF' => 'index.php?id=11&officeId=paris', | ||
], | ||
[ | ||
'title' => 'New York Office', | ||
'_OVERRIDE_HREF' => 'http://www.example.com', | ||
'_OVERRIDE_TARGET' => '_blank', | ||
] | ||
] | ||
], | ||
[ | ||
'title' => 'Form', | ||
'_OVERRIDE_HREF' => 'index.php?id=10&cmd=showform', | ||
], | ||
[ | ||
'title' => 'Thank you', | ||
'_OVERRIDE_HREF' => 'index.php?id=10&cmd=thankyou', | ||
], | ||
], | ||
], | ||
[ | ||
'title' => 'Products', | ||
'_OVERRIDE_HREF' => 'index.php?id=14', | ||
] | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
defined('TYPO3_MODE') or die(); | ||
|
||
// Declare static TS file | ||
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile( | ||
'examples', | ||
'Configuration/TypoScript/', | ||
'Examples TypoScript' | ||
); | ||
|
||
// Declare static TS file | ||
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile( | ||
'examples', | ||
'Configuration/TypoScript/HmenuSpecial/', | ||
'Examples: HMENU special userfunc' | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# ************************ | ||
# CUSTOM MENU | ||
# ************************ | ||
lib.custommenu = HMENU | ||
lib.custommenu { | ||
special = userfunction | ||
special.userFunc = T3docs\Examples\Userfuncs\CustomMenu->makeMenuArray | ||
|
||
1 = TMENU | ||
1.wrap = <ul class="level-1">|</ul> | ||
1.NO = 1 | ||
1.NO { | ||
wrapItemAndSub = <li>|</li> | ||
} | ||
|
||
2 = TMENU | ||
2.wrap = <ul class="level-2">|</ul> | ||
2.NO = 1 | ||
2.NO { | ||
wrapItemAndSub = <li>|</li> | ||
} | ||
|
||
3 = TMENU | ||
3.wrap = <ul class="level-3">|</ul> | ||
3.NO = 1 | ||
3.NO { | ||
wrapItemAndSub = <li>|</li> | ||
} | ||
} |
Oops, something went wrong.