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

Conversation

@bobdenotter
Copy link
Member

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
public/theme/skeleton/partials/_sub_menu.twig Outdated Show resolved Hide resolved
public/theme/skeleton/partials/_sub_menu.twig Outdated Show resolved Hide resolved
public/theme/skeleton/partials/_sub_menu.twig Outdated Show resolved Hide resolved
public/theme/skeleton/partials/_sub_menu.twig Outdated Show resolved Hide resolved
src/Menu/FrontendMenuBuilder.php Outdated Show resolved Hide resolved
src/Twig/RecordExtension.php Outdated Show resolved Hide resolved
src/Twig/RecordExtension.php Outdated Show resolved Hide resolved
src/Twig/RecordExtension.php Show resolved Hide resolved
src/Twig/RecordExtension.php Outdated Show resolved Hide resolved

@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

@bobdenotter

This comment has been minimized.

Copy link
Member Author

commented Apr 2, 2019

Rebased

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

This comment has been minimized.

Copy link
@JarJak

JarJak Apr 2, 2019

Member

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.

src/Twig/RecordExtension.php Show resolved Hide resolved
src/Configuration/Parser/MenuParser.php Show resolved Hide resolved

@bobdenotter bobdenotter force-pushed the feature/menu-in-frontend branch from 993a5f5 to 557d26f Apr 3, 2019

@bobdenotter

This comment has been minimized.

Copy link
Member Author

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.

@JarJak

This comment has been minimized.

Copy link
Member

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

@bobdenotter

This comment has been minimized.

Copy link
Member Author

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.

@JarJak

JarJak approved these changes Apr 5, 2019

@bobdenotter bobdenotter merged commit 10edc42 into master Apr 5, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@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
Projects
None yet
2 participants
You can’t perform that action at this time.