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.063 seconds

I'm playing around with the new mvc and the FORK feature is FANTASTIC!!! it's saving me a lot of time! you are doing a very good job!!

Tomaselli (Forum)  

Get Started