Welcome, Guest
Username: Password: Remember me

TOPIC: Returning back to the parent collection page

Returning back to the parent collection page 09 Nov 2016 16:50 #14680

  • organicwebs
  • organicwebs's Avatar
  • Offline
  • Premium Member
  • Chris
  • Posts: 133
  • Thank you received: 21
  • Karma: 4
Hi,
For a single table I have a couple collection (list) pages and a single item page.

When I edit an item and click "save and close" I would like to return back to the parent collection page that the item page was originally called from (obviously).

Instead, after "save and close" the default collection list is rendered. This may not be the parent collection that called the item. To make things worse, the Joomla menu item of the original collection is still highlighted - but the default Collection page is rendered, making navigation very confusing for users.

Is there a way to return back to the parent collection list (not the default)?
Just call me Chris :)
Last Edit: 09 Nov 2016 16:51 by organicwebs.
The administrator has disabled public write access.

Returning back to the parent collection page 10 Nov 2016 14:23 #14687

  • liubov
  • liubov's Avatar
  • Offline
  • Elite Member
  • (=) 10 mn and it's ready!
  • Posts: 279
  • Thank you received: 36
  • Karma: 22
Hi Chris,
2 collections (List) == 2 contexts in charge in the Plural view. In the Builder, you have to name/alias your 2 distincts views.
Then, if you create a Link, Task: Edit, and choose Item context (All Layouts / Plural Name / Single Name), the Builder will create the separated Layouts to display.
File: (views/Plural/view.html.php)
The first will be Default, and the others will be named as defined Aliases.
/**
	* List of the reachables layouts. Fill this array in every view file.
	*
	* @var array
	*/
	protected $layouts = array( 'default', 'Alias1', 'Alias2', 'modal', 'ajax');

In that case, if you Edit or add New Item from this List, all the Tasks (Save&Close, Cancel, ...) will redirect to the Parent List (right context)
Last Edit: 10 Nov 2016 14:28 by liubov.
The administrator has disabled public write access.

Returning back to the parent collection page 10 Nov 2016 16:41 #14688

  • organicwebs
  • organicwebs's Avatar
  • Offline
  • Premium Member
  • Chris
  • Posts: 133
  • Thank you received: 21
  • Karma: 4
Thanks for you help, but I don't really understand...

I have two lists - "Device List" (default) and "My Device List". They both open the item form "Device". The Table is called "Devices".

So in the builder, I go to the list/collection "My Device List" > click the properties of the Edit button > and choose on the Layout dropdown All Layouts/Devices/Device Item.

I am aware of the view.html.php file. What do I hack in here?

To clarify - all I am looking for is that the form returns it its parent list on a save or cancel.

Thanks for your help and time. :)
Just call me Chris :)
The administrator has disabled public write access.

Returning back to the parent collection page 10 Nov 2016 19:52 #14690

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
This is a missing part in Joomla.
When your both plural layouts call the same item layout, you might have a limit.
You have to store an historical in the session to know the previous page.
This is a feature I'd like to add in the redirector.

For your knowledge, the redirector after the task execution is located at the end of the task function of the controller.
Coding is now a piece of cake
The administrator has disabled public write access.

Returning back to the parent collection page 19 Nov 2016 10:57 #14699

  • liubov
  • liubov's Avatar
  • Offline
  • Elite Member
  • (=) 10 mn and it's ready!
  • Posts: 279
  • Thank you received: 36
  • Karma: 22
Hi guys!
Just come back nice holidays ...

My idea was to use Jdom 'route' parameter and add the collection Layout (come from...) ex: 'layouts' => 'default'
<td style="text-align:left">
  <?php echo JDom::_('html.fly', array(
      'dataKey' => 'title',
      'dataObject' => $row,
      'route' => array('view' => 'formation','layouts' => 'default', 'layout' => 'formation','cid[]' => $row->id)
 ));?>
 </td>

so when you edit or click a title item, may be it's possible to rewrite the correct redirection in the controler, to display the right collection.
It's was the idea ...

Marc
Last Edit: 19 Nov 2016 17:01 by liubov.
The administrator has disabled public write access.

Returning back to the parent collection page 02 May 2017 13:22 #15093

  • organicwebs
  • organicwebs's Avatar
  • Offline
  • Premium Member
  • Chris
  • Posts: 133
  • Thank you received: 21
  • Karma: 4
Hi,
I was wondering if there any developments with this in the builder?
I was looking for the form to return back to it's parent (the list that called the form). Instead, the form returns back to the default list.
In many projects I use a single form and multiple lists.
I think this is an important feature.
Just call me Chris :)
The administrator has disabled public write access.

Returning back to the parent collection page 02 May 2017 17:46 #15095

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
For the moment nothing on that direction.
The navigation history needs to be stored in session. I didn't worked on that yet.
Coding is now a piece of cake
The administrator has disabled public write access.
The following user(s) said Thank You: organicwebs
Time to create page: 0.135 seconds

Get Started