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

Allow browse start node id to be specified in the template #2

Merged
merged 3 commits into from
Dec 3, 2018

Conversation

pkamps
Copy link
Member

@pkamps pkamps commented Nov 27, 2018

  • placeholder -

@@ -156,7 +156,9 @@
{undef $loop_count}
{/if}
{if and( not( $is_dynamic ), not( $is_custom ) )}
{def $start_browse_node_id = first_set( ezini( $block.type, 'ManualBlockStartBrowseNode', 'block.ini' ), 2 )}
Copy link
Member

Choose a reason for hiding this comment

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

I wouldn't default to "2", because this changes the behavior. Instead, only output the hidden input field if the INI value is set.

(eZContentBrowse has its own INI fallback.)

Technically this is also a BC break if you have an override of block/edit/edit.tpl already. You would lose the ManualBlockStartBrowseNode effect. I would have put the fallback ManualBlockStartBrowseNode logic into PHP:

if( $http->hasVariable( 'start-browse-node-id' ) )
...
elseif( $blockINI->hasVariable( $block->attribute( 'type' ), 'ManualBlockStartBrowseNode' ) )
...

... then the template just has a commented out hidden input field for a developer to use or not.

@peterkeung
Copy link
Member

+1

@pkamps
Copy link
Member Author

pkamps commented Dec 3, 2018

Upstream pull request:
ezsystems#82

@pkamps pkamps merged commit abe9b38 into master Dec 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants