Hi,
I'm using Joomla at the moment trying to create a component that will display an accordion with 10 catalogue items from a database.

The problem I'm having is I'm not quite sure how to create the accordion and connect it with the database so that each row will be displayed in it's own part of the accordion catalogue.

I have stored all my items in the database already. I'm not too sure how to display it when I start to create the accordion with jquery.


How would I fix this so that it displays everything in the database and not just greetings?

function getGreeting()
{
   $db =& JFactory::getDBO();
 
   $query = 'SELECT greeting FROM #__accordion';
   $db->setQuery( $query );
   $greeting = $db->loadResult();
 
   return $greeting;
}

Any help would be appreciated!

Member Avatar for LastMitch

I'm using Joomla at the moment trying to create a component that will display an accordion with 10 catalogue items from a database.

There's actually plugin for that:

http://extensions.joomla.org/extensions/extension-specific/virtuemart-extensions/virtuemart-products-display/19273

Even if you created from scratch by using accordion with jquery you still need to configure it to make it work on Joomla. That's 2 steps.

Isn't much easier to just used a plugin and workaround with it plus it has its own support forum here:

http://www.smartaddons.com/forum/index

if you want to modify the plugin you can always post a question on there. It's only 1 step.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.