Results 1 to 3 of 3

Thread: Custom Contao content types? Looking for a better way...

  1. #1
    User
    Join Date
    12-11-09.
    Location
    New York, NY USA
    Posts
    87

    Default Custom Contao content types? Looking for a better way...

    Is there a way within Contao to create content types to storage data and then create a views of the data such as a listing page that links to a details page?

    I currently have my own simple PHP program that does this for employee biographies, (I was able to jam it into a Contao template somehow) My code works well enough but I have to go into phpMyadmin everytime I want to add/edit/delete a bio and upload VCF and photo files via my FTP program.

    Would be nice to be able to create a content type that allows for an image upload and then provides a custom listing and details page... not sure about the Vcards but this possibly could be created on the fly from the data within the content type.

    I didn't see a module for this but seems like there should be one.

    Suggestion welcomed,

    thx.

  2. #2
    Experienced user
    Join Date
    08-21-09.
    Posts
    563

    Default Re: Custom Contao content types? Looking for a better way...

    Yes, there are a lot of options that I think would be a good fit. (Really what you are describing is central to the Contao framework, by the way -- storing and retrieving records, list/detail view, etc.).

    1. Catalog is the obvious answer. It is exactly what you are describing. You essentially build a backend interface through it's GUI, defining fields and what not, and it automatically creates and maintains the proper database tables to make it work. Then you create list and details modules as needed. The real power comes when you create your own templates to display the data. It can handle quite a bit. I use it a lot for custom client content -- bios, testimonials, products, etc. Just about anything. It's not officially compatible with 2.11, but I've been using it without problems.

    2. There's a dma_elementgenerator extension for creating custom content elements. Very similar in that you define the fields and field types, and assign a custom template. I haven't seen it updated in a while so I'm not sure what the status is. Used to be one of my favorites, especially when the catalog was a little "overkill".

    3. Write your own backend module. It's easier than it sounds. Trust me, that means a lot coming from me . Most of it is learning how the DCA works as that's how you define fields and table relationships and such. This aspect is decently documented on the website, and there are a couple blog posts about it as well. The more I'm learning, the more I do this instead of relying on an extension. Obviously it gives you a level of control you don't have otherwise. And it's kind of fun to do too. Because I'm not really a trained programmer and only have been learning PHP for a year or two, my main worry is that I'm inadvertently developing something with a gigantic security hole. But the more you learn the framework, the more that work is done for you.

    If you go with (3), you can just write the backend and use the built-in "listing" module to show your records on the frontend. "Listing" module is very underrated -- it has a list/detail setup as well. Like with all the options, it's very powerful when you design a custom template for it. There's also the "zedseries_listing" that's a beefed-up version of it with more features.

    Those are the main ones that I can think of. I'm sure there are other options as well.
    Brian

  3. #3
    User
    Join Date
    12-11-09.
    Location
    New York, NY USA
    Posts
    87

    Default Re: Custom Contao content types? Looking for a better way...

    Yeah, I'm self taught with PHP/MySQL too. I use to do more than I do now. I seem to get lost when diving into other peoples code which these days is more and more object oriented than procedural.

    I think I will look at the catalog extension first.

    Thanks for the tips,

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
  •