How should the lft and rgt columns be set?
Moderator: ooffick
Forum rules
Please use the mailing list here: http://groups.google.com/group/joomla-dev-general rather than this forum.
Please use the mailing list here: http://groups.google.com/group/joomla-dev-general rather than this forum.
-
- Joomla! Apprentice
- Posts: 6
- Joined: Fri May 13, 2011 10:26 pm
How should the lft and rgt columns be set?
Sorry for another post. I'm importing articles and each article belongs to a category. I'm not able to get the categories to work, however, and it appears to be due to my 'lft' and 'rgt' columns in my 'categories' table not being properly set. Any insight into how they work? I've been googling and can't find anything. Thanks.
-
- Joomla! Fledgling
- Posts: 3
- Joined: Wed Jun 08, 2011 11:01 pm
Re: How should the lft and rgt columns be set?
look for nested lists
Paul
Paul
-
- Joomla! Intern
- Posts: 51
- Joined: Tue Jan 26, 2010 10:37 pm
Re: How should the lft and rgt columns be set?
I have figured out that it refers to nested list stuff too. But how is it I would determine a set of numbers for a component I am building and manually entering into the menu on my development box?
-
- Joomla! Fledgling
- Posts: 3
- Joined: Wed Jun 08, 2011 11:01 pm
Re: How should the lft and rgt columns be set?
Hi Jabbott,
the theory is available on wikipedia: http://en.wikipedia.org/wiki/Nested_set_model If you would like to enter it manually, you will have to change the values of the parent nodes as well. Write it out and key it in.
I think the better solution would be to run a script to rebuild the tree structure. Since 1.6 there is a class and method available: http://docs.joomla.org/JTableNested::rebuild/11.1
Here's a script that can be used to rebuild the usergroups in 1.5:
http://forum.joomla.org/viewtopic.php?p=1577433
Paul
the theory is available on wikipedia: http://en.wikipedia.org/wiki/Nested_set_model If you would like to enter it manually, you will have to change the values of the parent nodes as well. Write it out and key it in.
I think the better solution would be to run a script to rebuild the tree structure. Since 1.6 there is a class and method available: http://docs.joomla.org/JTableNested::rebuild/11.1
Here's a script that can be used to rebuild the usergroups in 1.5:
http://forum.joomla.org/viewtopic.php?p=1577433
Paul
-
- Joomla! Apprentice
- Posts: 11
- Joined: Sat Nov 03, 2007 8:16 am
Re: How should the lft and rgt columns be set?
I have an external script that imports our data into Joomla categories.
How do I invoke the JTableNested::rebuild from my external script ?
I guess in more generic words, how do I use Joomla API in my external script ?
Regards,
William.
How do I invoke the JTableNested::rebuild from my external script ?
I guess in more generic words, how do I use Joomla API in my external script ?
Regards,
William.
- stan31337
- Joomla! Apprentice
- Posts: 35
- Joined: Thu Jul 31, 2008 8:30 am
- Location: Marmaris, Turkiye
- Contact:
Re: How should the lft and rgt columns be set?
Hello!
How to call JTableNested::rebuild in a custom component's model?
How to call JTableNested::rebuild in a custom component's model?
-
- Joomla! Apprentice
- Posts: 6
- Joined: Wed Jul 15, 2015 1:39 pm
- Location: Saint John, New Brunswick, Canada
Re: How should the lft and rgt columns be set?
That would be some helpful information.
-
- Joomla! Explorer
- Posts: 428
- Joined: Mon Nov 12, 2012 9:08 am
Re: How should the lft and rgt columns be set?
Hi,
I'm another one looking for an answer....
This might help some of you:
http://joomla.stackexchange.com/questio ... -component
Thanks
I'm another one looking for an answer....
This might help some of you:
http://joomla.stackexchange.com/questio ... -component
Thanks
-
- Joomla! Explorer
- Posts: 428
- Joined: Mon Nov 12, 2012 9:08 am
Re: How should the lft and rgt columns be set?
Hi folks
Here is an example I use successfully with Seblod. This is not Seblod code, exclusively Joomla!'s
Jon
Here is an example I use successfully with Seblod. This is not Seblod code, exclusively Joomla!'s
Code: Select all
// http://joomla.stackexchange.com/questions/5104/programmatically-add-menu-item-in-component
// sorts out the lft rgt issue
$menuTable = JTableNested::getInstance('Menu');
// which menu you want to add to -
$menutype = 'thisismymenusname';
// this is heading menu item but what data you have and require will vary per case - just look at an appropriate row in yr menu table
$menuData = array(
'menutype' => $menutype,
'title' => $table->alias,
'alias' => $table->alias,
'path' => $table->alias,
'type' => 'heading',
'component_id' => 0,
'language' => '*',
'published' => 1,
);
// this item is at the root so the parent id needs to be 1
$parent_id = 1;
$menuTable->setLocation($parent_id, 'last-child');
// save is the shortcut method for bind, check and store
if (!$menuTable->save($menuData))
{
$this->setError($menuTable->getError());
return false;
}
-
- Joomla! Fledgling
- Posts: 1
- Joined: Wed Mar 09, 2016 5:14 am
Re: How should the lft and rgt columns be set?
Hi,
Go for this.. May be it will work for you..
http://bj.zemplate.com/protostar-respon ... ht-columns
Thank you
Go for this.. May be it will work for you..
http://bj.zemplate.com/protostar-respon ... ht-columns
Thank you
Last edited by pe7er on Wed Mar 09, 2016 6:38 am, edited 1 time in total.
Reason: Manual signature has been removed
Reason: Manual signature has been removed
-
- Joomla! Explorer
- Posts: 428
- Joined: Mon Nov 12, 2012 9:08 am
Re: How should the lft and rgt columns be set?
Hi yugtia
The left (lft) and right (rgt) columns you refer to are to do with the template and how it gets rendered, using conditional statement to determine the column widths for left, right, and content columns.
This post is referring to the lft and rgt columns in the database for menu items
Jon
The left (lft) and right (rgt) columns you refer to are to do with the template and how it gets rendered, using conditional statement to determine the column widths for left, right, and content columns.
This post is referring to the lft and rgt columns in the database for menu items
Jon