I am using the category layout to feature articles on my front page with joomla 3.3. I am customizing this view so that the article links pull the articles into this page via ajax on click.
This is the relevant code I customized :
HTML :
<h2 class="catView" data-link="<?php echo $this->item->link; ?> #k2Container">
<?php if(isset($this->item->editLink)): ?>
</h2>
jQuery :
$('article.catView h2').click(function(){
var link = $(this).attr("data-link");
$(this).parents().next('.artContainer').slideToggle(500).load(link);
});
This works, I manage to retrieve the data I need and display it correctly.
BUT
I am wondering if this is the correct way to do this, instead of retrieving an other page should I try to retrieve data straight from the data base? is there a "special joomla" way of doing this?
I would rather not rely on a third party extension for this and would like to control and understand this task.