Welcome, Guest
Username: Password: Remember me

TOPIC: Edit button in item view

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.
The administrator has disabled public write access.

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

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
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
The administrator has disabled public write access.
Time to create page: 0.065 seconds

Get Started