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

TOPIC:

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

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 :)

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

Last edit: by organicwebs.

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

  • liubov
  • liubov's Avatar
  • Offline
  • Elite Member
  • Elite Member
  • (=) 10 mn and it's ready!
  • Posts: 279
  • Thank you received: 36
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)

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

Last edit: by liubov.

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

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 :)

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

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

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
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

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

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

  • liubov
  • liubov's Avatar
  • Offline
  • Elite Member
  • Elite Member
  • (=) 10 mn and it's ready!
  • Posts: 279
  • Thank you received: 36
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

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

Last edit: by liubov.

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

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 :)

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

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

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
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 following user(s) said Thank You: organicwebs

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

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

  Merci d'avoir présenté ce service web générateur de composant joomla. L'interface est très conviviale on a le plaisir du drag&drop et c'est assez rare pour être signalé. Je souhaite que ce projet connaisse un fort succès votre réalisation est méritante.
Yann Gomiero (AFUJ - France)

Get Started