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

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
Ben M
New Member
New Member
Posts: 4
Joined: Thu Jul 02, 2009 9:19 am

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

Post 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
User avatar
blast2007
Power Poster
Power Poster
Posts: 508
Joined: Wed Aug 01, 2007 5:36 pm

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

Post by blast2007 »

Check similar request here

regards
blast
Ben M
New Member
New Member
Posts: 4
Joined: Thu Jul 02, 2009 9:19 am

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

Post 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
User avatar
blast2007
Power Poster
Power Poster
Posts: 508
Joined: Wed Aug 01, 2007 5:36 pm

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

Post 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.
Ben M
New Member
New Member
Posts: 4
Joined: Thu Jul 02, 2009 9:19 am

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

Post by Ben M »

Wow, you're fast  :o

Thanks !!!

Ben
Ben M
New Member
New Member
Posts: 4
Joined: Thu Jul 02, 2009 9:19 am

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

Post 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
User avatar
blast2007
Power Poster
Power Poster
Posts: 508
Joined: Wed Aug 01, 2007 5:36 pm

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

Post 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).
Post Reply

Return to “Developers Discussion”