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

Implemented: EZP-23289: Add view parameter support to layout module views #284

Closed
wants to merge 1 commit into
base: master
from

Conversation

4 participants
@brookinsconsulting
Copy link
Contributor

brookinsconsulting commented Jan 23, 2012

...the original request view parameters are available to templates within the context of the original request

Hello eZ Community and eZ Crew!

This solution allows normal requests to modules which support the use of the eZModule:STATUS_RERUN feature provided in the default index.php to provide access to the view parameters of the original request for use within any of the templates of the original request.

This allows module views provide within the context of an extension to support view parameters within module views which make use of the eZModule:STATUS_RERUN functionality provided within the index.php.

Without this functionality view parameters are not supported within the context of custom module view extensions using the eZModule:STATUS_RERUN functionality by default.

This poses some problems for custom modules trying to support the same view parameter usage within templates used within one module view's context within another very similar module regardless of the use of the eZModule :STATUS_RERUN functionality.

A prime example this problem is the use of view_parameters within templates used by the content/view module view by default while the layout/set module view's use of the eZModule:STATUS_RERUN functionality currently prevents use of the view parameters provided by the request to layout/set URL.

If you wanted to use the same templates and view parameters for requests to the layout/set module view then this solution may be helpful you and others developers.

Please note that this solution requires no changes to any existing modules, module views or any other code to provide the support desired in the above described use case(s). The problem is isolated to a very specific feature of the eZModule class within the default eZ Publish index file, index.php

This use case can come up when users wish to link to a 'printer friendly' layout of say an 'article' content object (display all pages of an article in one page for example) with the same view parameters as the original request (to view the article using the default pagelayout) URL. Without this solution view parameters are simply unavailable to the templates within this request context.

This is a frustrating inconsistency that leads users to use custom templates, template operators and ultimately GET/POST request variables which are all fine but much less friendly to the view parameter support we have all come to respect, enjoy using and ultimately (good or bad) expect within the template context of most template usage use cases.

The use of GET/POST variables as always is retained after use of the provided pull request, yet additionally if your request provided view parameters, those are also now available for your use within the original requests templates as well.

Additionally if your custom module makes use of the eZModule:STATUS_RERUN feature (like modified copies of the default layout module or other similar such module as an easily understood example) they would automatically have access to the view parameters provided within the context of the original request as well. With no code changes required to your existing module view or templates. Though re-factoring to support this feature within your custom templates may be required to make use of the view parameters that would be then provided / available.

Again we would not request this change for inclusion into eZ Publish master if we did not truly believe that the additions of these improvements represent an important standardization of view parameters support within templates despite the module's use of the eZModule:STATUS_RERUN feature.

Note: Before considering a pull request we took the time to ask more than three other expert eZ Publish developers in the eZ Community to review this patch and share their opinions of the changes. All the eZ Publish developers strongly urged us to send these changes as a pull request back to the eZ Publish master repository. Which we are doing here now with this pull request on their / our combined behalf.

Please let us know directly if there are any further improvements or refinements we can make to this solution / pull request in order to reach approval of these improvements to module view parameter support back into the eZ Publish everyone loves so much.

Thank you for your continued support and support of the eZ Community!

This is our first public eZ Publish / eZ Community related pull request back to the original project master repository please understand if we have made mistakes within the bounds of this our first time making such a request. We seek to help the user and developers but we may make mistakes. Simply help us understand and we will do our very best to improve right away.

Best wishes

Cheers,
Brookins Consulting

Note: Brookins Consulting has long ago (and on more than one occasion) provided a signed and registered CLA with eZ Systems AS

@granitegreg

This comment has been minimized.

Copy link

granitegreg commented Apr 21, 2012

BC,

Thank you for your contribution! I hope it is just the first of many to come. Sorry for the delay on processing this; the Community Project Board is trying to refine the system so things move ahead more smoothly, and of course the current feature freeze period doesn't help. Thanks too for the great documentation explaining the new code.

Peace and all good,
Greg

@brookinsconsulting brookinsconsulting force-pushed the brookinsconsulting:ezmodule-rerun-view-parameter-support branch from bfb41ff to 03bb247 Aug 26, 2014

@brookinsconsulting

This comment has been minimized.

Copy link
Contributor Author

brookinsconsulting commented Aug 26, 2014

Hello,

We have created a new issue ticket about this feature request, you can find it here: https://jira.ez.no/browse/EZP-23289

Cheers,
Brookins Consulting

@brookinsconsulting

This comment has been minimized.

Copy link
Contributor Author

brookinsconsulting commented Aug 26, 2014

Hello,

We have updated and refactored our original pull request commit content to use the very latest version of the code.

You can review our new commit changes here: https://github.com/ezsystems/ezpublish-legacy/pull/284/files

Cheers,
Brookins Consulting

@brookinsconsulting brookinsconsulting changed the title Added support in index.php for eZModule:STATUS_RERUN requests to ensure ... Implemented EZP-23289: Add view parameter support to layout module views Aug 26, 2014

@brookinsconsulting brookinsconsulting changed the title Implemented EZP-23289: Add view parameter support to layout module views Implemented: EZP-23289: Add view parameter support to layout module views Aug 26, 2014

@dbroadfoot

This comment has been minimized.

Copy link

dbroadfoot commented Aug 26, 2014

This is going to help me greatly on a project I'm working on ... thank you!

@brookinsconsulting

This comment has been minimized.

Copy link
Contributor Author

brookinsconsulting commented Aug 26, 2014

Thank you David!

I wish you the very best on your project! Let me know if you have any further questions about this feature.

Cheers,
Brookins Consulting

@brookinsconsulting

This comment has been minimized.

Copy link
Contributor Author

brookinsconsulting commented Aug 26, 2014

Hello,

As we said in our issue ticket description...We'll be brief this time around.

We were verbose in our first introduction of this feature back in 2012 and that didn't help anyone. To read our original introduction please read this pull request title and first comment: #284 (comment)

In short: eZ Publish layout/set module view has lacked view parameter support.
It lacks this support even though the layout/set module view can be used to view existing module views and templates which already expect view parameter support as provided by the content module.

This creates serious template variable conflicts for existing content view templates.
Our simple code improvement brings in layman's terms view parameter support to the layout module indirectly.

It does this by providing view parameters to other module views which make use of eZModule:STATUS_RERUN requests ie: custom modules or modified copies of the layout module in extensions.

Thank you for your continued support!

Cheers,
Brookins Consulting

@lolautruche

This comment has been minimized.

Copy link
Contributor

lolautruche commented Aug 27, 2014

Hi

Not sure I like the approach, as it exposes view_parameters variable directly, including regular content view. So this will probably conflict with normal view parameters.

@brookinsconsulting

This comment has been minimized.

Copy link
Contributor Author

brookinsconsulting commented Sep 7, 2014

Hello Jérôme,

First off, thank you for taking the time to review and comment on our first pull request! It really means a lot to us here at BC.

Second, Some apologies are in order. It's been quite some time since we last tested this patch. And your comments are right.

More over it seems this pull request is no longer needed. View parameters are indeed already available within the layout/set module view pagelayout and content view templates after all.

Either something wonderful has changed in the last two and a half years ago since we last tested or we were mistaken to begin with.

Either way. We will test harder before submitting our next pull request. Thanks again and apologies for the trouble.

So in any case. This pull request can be closed.

Respectfully,
Brookins Consulting

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment