×
This forum has been locked. Please submit new Feature Requests on GitHub: github.com/Jensen-Technologies/component-creator-issues/issues
Nested Sets
Yonder Media
Yeni Üye
Posts: 7
9 yıl 9 ay önce #666
Yazan: Yonder Media
Nested Sets, Yonder Media tarafından oluşturuldu
Having used Component Creator quite extensively, one of the things I find myself having to make over and over again, are nested set models. For instance, Nested Sets are used in Joomla's native Category component, allowing n-tiered nesting of categories associated with other categories.
In the Table class, this requires changing it from JTable to JTableNested, and including code in the prepareTable function of the model class (an example is shown below:)
Additionally, then, this requires changes to the View classes and markup output, to correctly show entries as being nested within each other. For this, I've borrowed code from Joomla's Category Component to achieve this.
Whilst I can get this all to work, it would be a really cool feature to have this built-in to Component Creator!
In the Table class, this requires changing it from JTable to JTableNested, and including code in the prepareTable function of the model class (an example is shown below:)
protected function prepareTable($table)
{
jimport('joomla.filter.output');
$db = JFactory::getDbo();
// Specify where to insert the new node.
$parent = @$table->parent_id;
if (!empty($parent))
{
$table->setLocation($parent, 'last-child');
}
else
{
$rootId = $table->getRootId();
if ($rootId === false)
{
$db = JFactory::getDbo();
$sql = 'INSERT INTO #__yomo_ussd_article_category'
. ' SET parent_id = 0'
. ', lft = 0'
. ', rgt = 1'
. ', level = 0'
. ', title = '.$db->quote('root')
. ', alias = '.$db->quote('root')
. ', access = 1'
. ', path = '.$db->quote('')
;
$db->setQuery($sql);
$db->query();
$parent = $db->insertid();
$table->setLocation($parent, 'last-child');
}
else
{
$table->setLocation($rootId, 'last-child');
}
}
# Check that the node data is valid.
$table->check();
# Store the node in the database table.
$table->store();
}
Additionally, then, this requires changes to the View classes and markup output, to correctly show entries as being nested within each other. For this, I've borrowed code from Joomla's Category Component to achieve this.
Whilst I can get this all to work, it would be a really cool feature to have this built-in to Component Creator!
Lütfen sohbete katılmak için Giriş ya da Hesap açın.
RIP Graphics
Yeni Üye
Posts: 16
9 yıl 9 ay önce #667
Yazan: RIP Graphics
RIP Graphics tarafından Nested Sets konusunda yanıtlandı
+1
Lütfen sohbete katılmak için Giriş ya da Hesap açın.
Pete
Bakır Üye
Posts: 24
9 yıl 8 ay önce #700
Yazan: Pete
Pete tarafından Nested Sets konusunda yanıtlandı
+1
Lütfen sohbete katılmak için Giriş ya da Hesap açın.
Andres Maeso
Platin Üye
Posts: 338
9 yıl 8 ay önce #710
Yazan: Andres Maeso
Andrés Maeso
Customer relations manager at Joomla Component Creator.
This email address is being protected from spambots. You need JavaScript enabled to view it.
Andres Maeso tarafından Nested Sets konusunda yanıtlandı
Hi there
We like this feature though it wouldn't be easy to implement. I have added it to our roadmap poll, we will finishit soon to see what features are more interesting to all of our users. Then we will create a roadmap we will follow to improve Component Creator.
Best regards,
Andrés.
We like this feature though it wouldn't be easy to implement. I have added it to our roadmap poll, we will finishit soon to see what features are more interesting to all of our users. Then we will create a roadmap we will follow to improve Component Creator.
Best regards,
Andrés.
Andrés Maeso
Customer relations manager at Joomla Component Creator.
This email address is being protected from spambots. You need JavaScript enabled to view it.
Lütfen sohbete katılmak için Giriş ya da Hesap açın.
Søren Beck Jensen
Yönetici
Posts: 73
9 yıl 7 ay önce #771
Yazan: Søren Beck Jensen
Søren Beck Jensen
Founder, Component-Creator.com
Søren Beck Jensen tarafından Nested Sets konusunda yanıtlandı
Please note that this relates only to nested sets of custom tables. You can always use the Joomla Category field and create as many nested categories you would like.
Thanks to Brian Teeman for pointing this out.
Thanks to Brian Teeman for pointing this out.
Søren Beck Jensen
Founder, Component-Creator.com
Lütfen sohbete katılmak için Giriş ya da Hesap açın.
Ilya Protasov
Yeni Üye
Posts: 9
9 yıl 5 ay önce #876
Yazan: Ilya Protasov
Ilya Protasov tarafından Nested Sets konusunda yanıtlandı
+1
Lütfen sohbete katılmak için Giriş ya da Hesap açın.
Sayfa oluşturma süresi: 0.103 saniye