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

TOPIC:

Edit button in item view 13 Jun 2016 13:19 #14048

Hi, great work on this tool. Very useful.

Been stuck on an issue for a while now. I need to be able to add an edit button to the item view on the front end.

I have read something about adding a form to the item view however this then shows both the fly an form on the same page.

Created a separate form view in items but cant find a way to link to it for editing.

Any help would be greatly appreciated.

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

Edit button in item view 13 Jun 2016 16:37 #14059

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
I try to answer you with what I understood.
You would like a 'edit' task button on the item FLY page. Correct ?

I help you with the code, because you are new here so I write it for you.

Just add a toolbar button in the view :
Fork you view file (FRONT / ITEM). (view.html.php), the function displayXxxx(), where Xxxx is the alias name of your FLY template.

In this function you will find the toolbar definition.
Do not copy it all in your fork, just do :
protected function displayXxxx($tpl = null)
{
	// Keep the call of the original code, and fork AFTER
	parent::displayXxxx($tpl);

	// Define the CUSTOM task button, because Jooma do not propose it in native (who wants to PR that ?)
// TODO : Enter the name of your view in the first parameter before the '.'
// TODO : The last parameter should be a language string.
	CkJToolBarHelper::custom('[ViewName].edit', 'edit', 'edit', 'Edit');
}

I even tested it and it works for me.
Coding is now a piece of cake

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

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

I jumped and started to work on a demo component... but 2 days later this demo component became the real component. I just showed today the end result to my customer and he turned to me and said... "this is more than I expected"... All of this is because Cook did cut about 70% of my work and provided me more ways to improve the usability of the component. The end result was 17 tables all related between than to generate a full dashboard for the travel agents. Thanks for Cook developers for such great tool. This component would not be possible to be done at short time with all the features in it
Griiettner (Forum)  

Get Started