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

TOPIC:

Displaying the Parent in a Forked Brick 17 Aug 2016 09:03 #14457

Hi Everyone.

I was trying to applying ACL to a formbrick - so that an administrator group could see it - and not a general user. (Before somebody mentions it, I was avoiding copying forms as that duplicates all the custom coding work).

Anyhow - I was going to apply my ACL code to my forked view formbrick.php - and then call up the parent formbrick.php. By calling the Parent (original) - any changes I make in the builder will still have effect.

But - I am having difficulty in calling the parent formbrick.php from with the forked formbrick.php. I'm getting this error...
Fatal error: Call to undefined method JViewLegacy::_parentDisplay()

So is this part of the documentation correct for forked bricks?...



How do we call the original brick from a fork? (Is it possible?)

Cheers
Just call me Chris :)

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

Displaying the Parent in a Forked Brick 24 Aug 2016 21:10 #14483

What I do in a forked view file:
class MyComponentViewView1 extends MyComponentCkViewView1
{
	protected function displayDefault($tpl = null)
	{
	    parent::displayDefault($tpl);
           //other stuff
	}
}

works fine....
Or do I misunderstand?

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

Displaying the Parent in a Forked Brick 25 Aug 2016 11:53 #14487

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
This function in the view apply for the views, not for the brick.

What you can do is to check your ACL in the view displayXxx() function,
And then in the default.php template file, just test the var and switch the rendering or not of the brick.
Hope it helps.

I think the code given in the docs is deprecated now.
You don't need to call _parentDisplay() anymore because it is called automatically in the display() function, you might not need to fork.
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.083 seconds

Real time saver and great Component Builder tool ! I have been developing with J-Cook Pro Component Builder for several months now and can say with all honesty that this product/service is second to none. The product is feature rich and is being improved and added to all the time. Do yourself a favor if you need to build a Joomla! Component then you can do no wrong in trying the product. You will save on time and effort while being able to deliver your project on time. J-Cook pro does the hard work for you you then have the freedom to fully customise the end result for your own needs. 

One word: Awesome.
Edwardcox (JED)
         

Get Started