Results 1 to 2 of 2

Thread: How can I create dynamic CONTAO pages?

  1. #1
    New user
    Join Date
    09-18-14.
    Posts
    9

    Default How can I create dynamic CONTAO pages?

    So I'm developing this website on CONTAO CMS and I have many information in database tables created by me. [eg: I have database table named Country with 2000 records in it].

    Then in CONTAO I have the page called Record (alias: record.html) in which I want to display information about one record at a time (depending on which one was requested). I thought of something like this http://path.com/to/my/page/record.html?id=201 and the information displayed should be of the 201st record in the table.

    The problem is that I don't know how to achieve that in CONTAO.

    I also used this CONTAO insert tag: {{file::myfile.php?id='someid'}}. It works, in myfile.php i get the someid and query the database for the information needed. The problem of this solution is that I don't know how to pass the ID from the browser URL inside this CONTAO TAG.

    Looking forward to any solutions you can provide!

  2. #2
    User Andreas's Avatar
    Join Date
    07-11-09.
    Location
    Mönchengladbach
    Posts
    499

    Default

    Quote Originally Posted by Devilish1208 View Post
    ...The problem of this solution is that I don't know how to pass the ID from the browser URL inside this CONTAO TAG...
    Maybe it's better to not develope if you don't know how to do this.

    If you put your own code into your php file you should not use inserttags in there. Use
    PHP Code:
    $this->replaceInsertTags('{{KEY::VALUE}}'); 
    Or even better don't use inserttags at all as you can fetch everything with the Contao php framework. Search for contao, manual, cookbook, models, methods, api, keynotes, pdf...
    Use Contao php framework methods to i.e. get the GET variables.

    Try to play around with this:
    Add your DB table to your Contao DB. Try the front end module "listing" to show your datasets in front end.
    Web-Development, Freelancer, Burgtech, XHTML, HTML5, CSS, PHP, Javascript, MooTools, MySQL and more
    Amazon wishlist

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •