-
Notifications
You must be signed in to change notification settings - Fork 230
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
[FEATURE] Add argument with page uid for building language menu. #620
Conversation
Hey @danilovq thanks for your PR, but it can't be accepted as it is at the moment. Please see https://github.com/FluidTYPO3/vhs/blob/development/Classes/ViewHelpers/Page/InfoViewHelper.php on how we generally handle a optional pageUid argument. Please amend and force push (no second commit) your PR to include this. |
if (0 === $this->pageUid) { | ||
$this->pageUid = $GLOBALS['TSFE']->id; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please move that whole block to parseLanguageMenu, then you can use pageUid as a local variable in that method
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@danilobuerger I made it as class field because I use it in method getLanguageUrl too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah i didnt see that. in that case make it a method please so its testable
alright i am good with the commit, will test tomorrow except if someone merges first ;-) |
CGL - Please use tabs instead of spaces |
* @return integer | ||
*/ | ||
protected function getPageUid() { | ||
$pageUid = intval($this->arguments['pageUid']); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use $pageUid = (integer) $this->arguments['pageUid']
- we use control structures before functions whenever this is possible.
Hi @danilovq, would you please take a look at the comments above and finish your PR so we can close this issue? If you have questions feel free to ask. Thanks in advance for contributing. Cheers |
|
Good job Anton - thanks! |
[FEATURE] Add argument with page uid for building language menu.
This feature will be helpfull if you need to build language menu for another page, not for current only.