Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

Redirecting to Collection after mulitple "Publish" 13 Dec 2012 17:24 #6070

From a Front End collection of all my items, I'm selecting records to publish or unpublish. This works fine, but the component only queues a message about the success - it does not redisplay the collection.

While this is functionally fine, where/how do I set the redirection? I've tried to replicate how the other functions such as save/delete do it, but with no success. Even rebuilding the component with "wrong" layouts configured in the toolbar just so I can find and change it has not been successful.

Please Log in or Create an account to join the conversation.

Re: Redirecting to Collection after mulitple "Publish" 15 Dec 2012 14:16 #6111

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
Strange, it is working for me...

Sure ?
Coding is now a piece of cake

Please Log in or Create an account to join the conversation.

Re: Redirecting to Collection after mulitple "Publish" 15 Dec 2012 14:28 #6115

I created a simple dummy component and left the task properties blank for save/apply, then downloaded the code. I then put in a totally irrelevent view/layout on "Save", and downloaded it again. Using a couple of tools I have to compare files, the full download sets are identical. Changing the property didn't change the code at all.

I'd tried that to try and spot where Cook sets that up so that I could implement it in my now-quite-heavily-modified code.

Please Log in or Create an account to join the conversation.

Re: Redirecting to Collection after mulitple "Publish" 15 Dec 2012 15:04 #6121

Here's a quick recording of what I'm seeing. This layout has had virtually no modification on my end.
beta.iriseducation.org/tmp/CookPublishUnpublish.html

Please Log in or Create an account to join the conversation.

Re: Redirecting to Collection after mulitple "Publish" 15 Dec 2012 15:13 #6122

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
Yeah, I see that.

Again a good catch to fix in 2.0. Thanks.

To write such redirection :

TODO :
In your concerned controller (collection), catch the publish() function.
(also called for 'unpublish' - same function, but different tasks)

1. Call the parent and get the result
2. Copy a redirector (save() for example... in 'item' controller) to understand how to implement it.
3. Switch publish/unpublish cases if you want different behaviors

Explained few times here.

In the same time I will fix it, but not for now, because tasks are in rewriting as well as filters. Anyway. the issue is on the list.
Coding is now a piece of cake
The following user(s) said Thank You: gdpodesta

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Time to create page: 0.099 seconds

A HUGE thank you for all the time and effort you have put into J-Cook it is a timesaver and a training tool all in one
Morgan Leecy - MCSE  

Get Started