Welcome, Guest
Username: Password: Remember me

TOPIC: [CLOSED] Item layout entry point

[CLOSED] Item layout entry point 24 Jan 2012 13:53 #1039

  • M4d3L
  • M4d3L's Avatar
  • Offline
  • Senior Member
  • Posts: 45
  • Thank you received: 7
  • Karma: 3
Last week, I try to create an application. it was working on frontend (form with some basic field).

This week, if I try it into sandbox or download it and install it on my joomla 1.5 website, I can't see anymore the form.

anything change from last week?
The administrator has disabled public write access.

Re: Generation problem? 24 Jan 2012 14:16 #1040

  • M4d3L
  • M4d3L's Avatar
  • Offline
  • Senior Member
  • Posts: 45
  • Thank you received: 7
  • Karma: 3
I think I found the problem.

When generating the default view,

the default layout case is missing.

ex:
function display($tpl = null)
	{
		$layout = $this->getLayout();
		print $layout;
		switch($layout)
		{
			case 'enregistrement':

				$fct = "display_" . $layout;
				$this->$fct($tpl);
				break;
		}

	}

here is the fixed code :
function display($tpl = null)
	{

		$layout = $this->getLayout();
		print $layout;
		switch($layout)
		{
			case 'enregistrement':

				$fct = "display_" . $layout;
				$this->$fct($tpl);
				break;
			default:
			$fct = "display_enregistrement";
				$this->$fct($tpl);
				break;
		}

	}

but maybe add the default view/layout in the entry file of the component.
Last Edit: 24 Jan 2012 14:23 by M4d3L.
The administrator has disabled public write access.

Re: Generation problem? 24 Jan 2012 18:08 #1057

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 985
  • Karma: 140
I think you didn't defined any entry point.

Maybe it was setted up, and you deleted the concerned layout defined as 'Entry point'.

But, tell me ...

From where do you call this layout ?

Which menu ?
- Admin menu ?
- Sandbox menu ?
- Task (New-Edit) ?

Because the layout alias MUST always be present in the url for item layout.

Except for the task toolbar, and you should set it in your controller, her a basic example :
function new_()
{
	if (!$this->can('core.create', JText::_("DEMO120_TASK_NEW")))
		return;

	$vars = array();

	JRequest::setVar( 'cid', 0 );
	JRequest::setVar( 'view'  , 'client');
	JRequest::setVar( 'layout', 'client' );    // <-  HERE 

	$this->setRedirect(Demo120Helper::urlRequest($vars));
}

function edit()
{
	if (!$this->can('core.edit', JText::_("DEMO120_TASK_EDIT")))
		return;

	$vars = array();
	JRequest::setVar( 'view'  , 'client');
	JRequest::setVar( 'layout', 'client' );    // <-  HERE 

	$this->setRedirect(Demo120Helper::urlRequest($vars));
}
Coding is now a piece of cake
The administrator has disabled public write access.

Re: Generation problem? 24 Jan 2012 18:17 #1060

  • M4d3L
  • M4d3L's Avatar
  • Offline
  • Senior Member
  • Posts: 45
  • Thank you received: 7
  • Karma: 3
exemple. if I go into my sandbox menu. I see ... nothing... no form, no submenu.

in my project I only have one item on frontent. no collection. and the item is a form.
The administrator has disabled public write access.

Re: Generation problem? 08 Mar 2012 18:11 #1518

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 985
  • Karma: 140
Is this issue still present ?
Coding is now a piece of cake
The administrator has disabled public write access.

Re: Generation problem? 08 Mar 2012 18:33 #1519

  • M4d3L
  • M4d3L's Avatar
  • Offline
  • Senior Member
  • Posts: 45
  • Thank you received: 7
  • Karma: 3
I think so.
The administrator has disabled public write access.

Re: Generation problem? 08 Mar 2012 18:42 #1520

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 985
  • Karma: 140
Wich Project / Table / Layout ?
Coding is now a piece of cake
The administrator has disabled public write access.

Re: Generation problem? 08 Mar 2012 19:10 #1521

  • M4d3L
  • M4d3L's Avatar
  • Offline
  • Senior Member
  • Posts: 45
  • Thank you received: 7
  • Karma: 3
nvm I mean I think its fixed
The administrator has disabled public write access.
Time to create page: 0.082 seconds

Get Started