Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Menu in frontend #376

Merged
merged 23 commits into from Apr 5, 2019
Merged

Menu in frontend #376

merged 23 commits into from Apr 5, 2019

Conversation

@bobdenotter
Copy link
Member

@bobdenotter bobdenotter commented Mar 30, 2019

Fixes #253

@bobdenotter bobdenotter changed the title [WIP] Menu in frontend Menu in frontend Mar 31, 2019
@bobdenotter bobdenotter requested a review from JarJak Mar 31, 2019
config/bolt/menu.yaml Outdated Show resolved Hide resolved
Loading
public/theme/skeleton/partials/_sub_menu.twig Outdated Show resolved Hide resolved
Loading
public/theme/skeleton/partials/_sub_menu.twig Outdated Show resolved Hide resolved
Loading
public/theme/skeleton/partials/_sub_menu.twig Outdated Show resolved Hide resolved
Loading
public/theme/skeleton/partials/_sub_menu.twig Outdated Show resolved Hide resolved
Loading
src/Menu/FrontendMenuBuilder.php Outdated Show resolved Hide resolved
Loading
src/Twig/RecordExtension.php Outdated Show resolved Hide resolved
Loading
src/Twig/RecordExtension.php Outdated Show resolved Hide resolved
Loading
src/Twig/RecordExtension.php Show resolved Hide resolved
Loading
src/Twig/RecordExtension.php Outdated Show resolved Hide resolved
Loading
@JarJak JarJak changed the title Menu in frontend Sidebar Menu in admin's frontend Apr 1, 2019
@JarJak JarJak changed the title Sidebar Menu in admin's frontend Menu in frontend Apr 1, 2019
tests/php/Configuration/Parser/MenuParserTest.php Outdated Show resolved Hide resolved
Loading
Loading
Loading
tests/php/Configuration/Parser/MenuParserTest.php Outdated Show resolved Hide resolved
Loading
@bobdenotter
Copy link
Member Author

@bobdenotter bobdenotter commented Apr 2, 2019

Rebased

Loading

if (mb_strpos($link, '/') && mb_strpos($link, 'http') === false) {
$content = $this->getContent($link);
if ($content) {
return $content->getExtras()['link'];
Copy link
Member

@JarJak JarJak Apr 2, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just use urlGenerator like here:
https://github.com/bolt/four/blob/master/src/Twig/ContentExtension.php#L199

and then getContent method from here gets unused, which is good because using repository for menu generation is a heavy task.

Loading

src/Twig/RecordExtension.php Show resolved Hide resolved
Loading
src/Configuration/Parser/MenuParser.php Show resolved Hide resolved
Loading
@bobdenotter bobdenotter force-pushed the feature/menu-in-frontend branch from 993a5f5 to 557d26f Apr 3, 2019
@bobdenotter
Copy link
Member Author

@bobdenotter bobdenotter commented Apr 3, 2019

Can't reply inline for some reason, so i'll do it here:

just use urlGenerator like here:
https://github.com/bolt/four/blob/master/src/Twig/ContentExtension.php#L199

and then getContent method from here gets unused, which is good because using repository for
menu generation is a heavy task.

We need Content regardless, because entry/2 needs to get normalised to /entry/lorem-ipsum.

Loading

@JarJak
Copy link
Member

@JarJak JarJak commented Apr 3, 2019

We need Content regardless, because entry/2 needs to get normalised to /entry/lorem-ipsum.

AFAIR link works with either id or slug

Loading

@bobdenotter
Copy link
Member Author

@bobdenotter bobdenotter commented Apr 4, 2019

AFAIR link works with either id or slug

Yes, strictly speaking. But, this way we can make it output the 'canonical' link, and prevent links to non-published or non-existing pages.

Later on, i can add the cachewrapper pattern, and that will make the overhead minimal.

Loading

JarJak
JarJak approved these changes Apr 5, 2019
@bobdenotter bobdenotter merged commit 10edc42 into master Apr 5, 2019
1 check passed
Loading
@bobdenotter bobdenotter deleted the feature/menu-in-frontend branch Apr 5, 2019
@bobdenotter bobdenotter added this to the Bolt 4 beta 1 milestone Apr 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants