Page 1 of 1

I want to build my webpage based on data in a database

Posted: Thu Jul 02, 2009 9:25 am
by Ben M
Hi there,

I've been struggling for a while and can't figure out how to proceed.

I want to have a database, where I can enter all relevant data. My website should be able to categorize the data from the database and display it.

Example of what I would like:

I want to enter 4 records in a database:

Brand    Type
Ford      Mustang
Ford      F150
Dodge    Viper
Chrysler  Voyager

On my website I would like to see a treestructure looking like this:

Chrysler (1)
Dodge (1)
Ford (2)

So, automatically a counter should count how many Ford's there are in the DB.

By clicking on Ford, the tree should open and display the detailrecords.

Is this possible at all?

Thanks in advance,

Ben

Re: I want to build my webpage based on data in a database

Posted: Thu Jul 02, 2009 10:48 am
by blast2007
Check similar request here

regards
blast

Re: I want to build my webpage based on data in a database

Posted: Thu Jul 02, 2009 11:14 am
by Ben M
Exactly what I need. I have managed to setup a new module by useing CTL.

But how do I get the contents of this module on a page? (I'm pretty new to CMS, so it might be a stupid question)

Thanks for your support!

Ben

Re: I want to build my webpage based on data in a database

Posted: Thu Jul 02, 2009 12:11 pm
by blast2007
- Create new module with CTL

- Install new module

- Create a new page.

- Turn off WYSIWYG

- Put this code in the page

Code: Select all

{cms_module module="yourmodulename" [options...] }
As options I mean listtemplate... etc

For all options check module help section.

Re: I want to build my webpage based on data in a database

Posted: Thu Jul 02, 2009 12:20 pm
by Ben M
Wow, you're fast  :o

Thanks !!!

Ben

Re: I want to build my webpage based on data in a database

Posted: Mon Jul 06, 2009 9:55 am
by Ben M
Hmm, I must be doing something wrong.

I have applied the suggested solution. I have data that should appear, organized on 3 levels. So first select level A, then from the selected level A, select level B, and finally level C.

But I want it to appear like some sort of tree, in my menu.

The way it appears now, I see level A on the left. I select one.
Then all possible B levels appear on the right. I pick one.
And then all C levels appear on the right and I pick one.

I don't want anything to appear on the right, just in my menu.

Hope this all makes sense, can't really find another way to describe it.

Ben

Re: I want to build my webpage based on data in a database

Posted: Mon Jul 06, 2009 1:24 pm
by blast2007
I think you need something like a "expandable nested tree menu".
It wouldn't be too difficult to implement with a custom template (and maybe an UDT).