It seems that I can have a ’link’. When this link is clicked, it can send the visitor to another document/page that has the listing with details that I want to produce.
To me this is saying I do not need a mysql db table named ’motels’ AND therefore do not need to write a ’snippet’ that will query the db table.
you are right. you only have to create a new ressource in your ressource-tree -> ’motels’.
Under this ressource create a ressource for each motel.
For name you can use the field ’pagetitle’. For address, telephone, and website, photo and so on you can create Template-Vars. These are additional fields for ressources. For Detail-Infos you can use the field content.
Then place a Ditto-call in your ressource ’motels’ for listing all motels. You can easy customize this listing with a chunk for the Ditto-items for example ’motelListing’ and use it in your Ditto-call like that: [!Ditto? &tpl=`motelListing` &display=`all`!] for example.
Now you can have links to your motel-Detail-pages very easy. You need just something like that in your Ditto-chunk:
<a href="[~[+id+]~]">[+pagetitle+]</a>
This way you don’t need custom-tables or custom-snippets for this task and its very easy to modify your output for listings and detail-pages.