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

For starters it's just so easy to design an app in a way that I'm used to i.e. database first then views followed by customization. The fork system is pure brilliance from a developer standpoint as I can override things and still add and update my projects with minimal effort! Truly amazing to be able to build components in Joomla using incremental refinement without having to do everything by hand. Thanks for the great tool! I am so much more productive now than ever and I can't imagine building components any other way!!!!
Dave (Forum)

Get Started