hi all,
I would like to list the articles of a specific section (with several cats) created by the logged user.
since the columns displayed should be article_title, category_title, edit link the following query should be used:
I have:
DBMRL 1:
Table: #__content
Model ID: Manage_Articles
Load Data / Enable Associations: yes
Associated Models: Categories
WHERE statement:
<?php $user =& JFactory::getUser(); ?>
Manage_Articles.catid = Categories.id
AND Manage_Articles.created_by = '<?php echo $user->id; ?>'
AND Manage_Articles.sectionid = '2'
ORDER BY Categories.title, Manage_Articles.title
Enable Pagination: bottom
Limit: 5
DBMRL 2:
Table: #__categories
Model ID: Categories
Fields:id,title
Load Data: yes
Enable Associations: no
using print_r2($form->data)
reveals a list of content item data with sectionid=2 with associated id /title from the categories table followed by a list of all categories in all available sections
is this what I am suppoed to get? why the list of all cats?
I would like to list the articles of a specific section (with several cats) created by the logged user.
since the columns displayed should be article_title, category_title, edit link the following query should be used:
$user =& JFactory::getUser();
$query = "SELECT a.*, c.title AS category
FROM #__content AS a
INNER JOIN #__categories AS c ON c.id = a.catid
WHERE a.created = '<?php echo $user->id; ?>'
AND a.sectionid = 2
ORDER BY c.title, a.title ";
I have:
DBMRL 1:
Table: #__content
Model ID: Manage_Articles
Load Data / Enable Associations: yes
Associated Models: Categories
WHERE statement:
<?php $user =& JFactory::getUser(); ?>
Manage_Articles.catid = Categories.id
AND Manage_Articles.created_by = '<?php echo $user->id; ?>'
AND Manage_Articles.sectionid = '2'
ORDER BY Categories.title, Manage_Articles.title
Enable Pagination: bottom
Limit: 5
DBMRL 2:
Table: #__categories
Model ID: Categories
Fields:id,title
Load Data: yes
Enable Associations: no
using print_r2($form->data)
reveals a list of content item data with sectionid=2 with associated id /title from the categories table followed by a list of all categories in all available sections
is this what I am suppoed to get? why the list of all cats?