Could you send me the source code of this example??
here you go
following this thread:
http://modxcms.com/forums/index.php/topic,44506
i suggested the "Module Maker" which you can download here:
http://modx.cmsthingies.com/module_maker.html
support thread:
http://modxcms.com/forums/index.php/topic,39174.0.html
but unfortunately the module installation didn’t work and threw an error. i’m sure there’s an easy fix for this, but the creater of Module Maker hasn’t answered yet. it’s a great addon for sure. In the Module Maker documentation is an example db table that i created via phpMyAdmin in my MODx db. i used this code:
1. create the db table
--------------------------------
CREATE TABLE `test_address` (
`id` int(11) NOT NULL auto_increment,
`forename` varchar(255) NOT NULL,
`surname` varchar(255) NOT NULL,
`address` varchar(255) NOT NULL,
`postcode` varchar(25) NOT NULL,
`town` varchar(255) NOT NULL,
`county` varchar(255) NOT NULL,
`coordinates` varchar(255) NOT NULL,
`telephone_number` varchar(25) NOT NULL,
`website` varchar(255) NOT NULL,
`email_address` varchar(255) NOT NULL,
PRIMARY KEY (`id`)
);
bunk58 suggested then to either use SQLBuddy or the "dbEdit" module which you find here:
http://modxcms.com/forums/index.php/topic,32720.msg199092.html
2. install the module
--------------------------------
i installed Cipa’s version from here:
http://modxcms.com/forums/index.php/topic,32720.msg256471.html#msg256471
-> download:
http://modxrules.com/assets/files/downloads/dbedit.zip
( but you should probably go with ncrosslands version further down that thread:
http://modxcms.com/forums/index.php?action=dlattach;topic=32720.0;attach=10685 )
the dbEdit module is setup to only use and show tables that don’t have your MODx table prefix (usually modx_ ). because i didn’t manage to configure dbEdit to show my non MODx prefix tables, i made those to changes in index.php of the module ( wouldn’t recommend it though, because a client can easily mess with the db ):
http://modxcms.com/forums/index.php/topic,32720.msg216325.html#msg216325
http://modxcms.com/forums/index.php/topic,32720.msg216386.html#msg216386
module installation:
----------------
copy your "dbedit" into assets/modules
..then "Manage Modules" -> "New Module" -> name: dbedit -> copy & paste the content of "dbedit.module.php.txt" into the textarea and under "Configuration" + c&p:
&mod_path=Module path;string;assets/modules/dbedit/ &dbedit_date_format=Date Format (use d,D,m,M,F,n,y,Y as in php date() with simple separator);string;d F Y
in the "Module configuration" field ... now "save" and go back to "Manage Modules" where you see the "dbedit" module and an icon to its left side. click on that and choose "Run Module". after that you might need to clear your cache or log out and in to see the actual module.
now you can choose whatever table is in your MODx db.
Once you selected your "test_address" table by clicking "Add New Table" in the module interface, you’ll be able to configure everything you need and should see a similar interface like on the screenshots from my demo site.
3. install the loopDbChunk Snippet
--------------------------------
to display the records on your website you need to install the loopDbChunk Snippet from here:
http://modxcms.com/forums/index.php/topic,14654.0.html
call it like this on your site:
[!loopDbChunk? &tableName=`test_address` &numLinks=`2` &orderby=`town desc` &chunkName=`address` &perPage=`2` &missingValTxt=`--`!]
the Chunk "address" is (it’s all messy - ignore the inline styles - needed a quick demo

) :
<div class="product_block" style="float:left;margin: 0px 20px 20px 0px;background-color: #ada86f;border: 1px solid #666;padding: 5px;">
<div class="product_desc">
first name: <span class="addresscolor">[+forename+]</span><br/>
surname: <span class="addresscolor">[+surname+]</span><br/>
address: <span class="addresscolor">[+address+]</span><br/>
postcode: <span class="addresscolor">[+postcode+]</span><br/>
town: <span class="addresscolor">[+town+]</span><br/>
coordinates: <span class="addresscolor">[+coordinates+]</span><br/>
telephone: <span class="addresscolor">[+telephone_number+]</span><br/>
website: <span class="addresscolor">[+website+]</span><br/>
email: <span class="addresscolor">[+email_address+]</span><br/>
</div>
<div class="product_details">
<div style="margin-top: 10px;"><img style="border: 1px solid #fff;" src="[+county+]" width="200px" height="200px;"></img></div>
</div>
</div>
now you can add records and the result should look like on my demo site.
hope this make sense. if you’re running into problems give me a shout