We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 23260
    • 30 Posts
    I’ve gone through the docs and I’m a little more confident about using MODx, but I’m still not sure how to use MODx’s power to help me build an application. I’m on my way to write an event calender / venue finder which would be no problem building from scratch (of course, it would be nice to have the user management and search already taken care of) but I don’t know where to begin integrating it into MODx. I guess when there are more Modules / plugins available it will be easier to see this. Anyway, some questions:

    Custom Tables VS. TVs
    It it recommended to create additional tables in the DB (or a separate DB) as we need them? Or should we try to use pages w/ added TVs? When it comes to an event calender we’d need start date, end date, venue etc. From my reading, I see there are some limitions with TV’s (searching, sorting?)

    Um, actually I have to run... I’ll post my other questions this evening. cool

    Discussion on this is much appreciated!

    Phil
      • 25663 MODX Staff
      • 12,272 Posts
      You could make each event be a document and basically adapt the NewsListing snippet to facilitate displaying the calendars...
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 23260
        • 30 Posts
        Okay, thanks Ryan. That was the direction I was thinking of going. The other thing is I was thinking of creating a table of venues for this calender and link up via the ID. I guess I could create a template w/ TV’s for venues (address, phone etc.) but is it possible to create a TV selectbox in the admin page that will allow one to choose from the available venues. Is this what @binding is about?
          • 25663 MODX Staff
          • 12,272 Posts
          No, but that is what Display Widgets are about. smiley
          http://modxcms.com/widgets.html
            Ryan Thrash, MODX Co-Founder
            Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
            • 22303 MODX Staff
            • 10,725 Posts
            To clarify, there are actually two kinds of TV displays, those for rendering in the admin on the manager side (or back-end), and those for displaying the information on the front-end. The input widgets and the output widgets, if you will.

            See http://modxcms.com/creating-a-template-variable.html which gives an example of creating a Drop Down List Menu input widget where admin users could select from a set of predetermined values.
              • 23260
              • 30 Posts
              Thanks to you both for your helpful replies, I clearly need to re-read to TV documentation.

              Cheers:-

              Phil
                • 23260
                • 30 Posts
                Okay, another roadblock shocked

                I decided to use the NewsListing Snippet as a base for a simple events listing. I added 3 template vars to a template called "events". The TVs are: event_start_date, event_end_date and event_venue. Eventually I was planning on adding a template called "venues" (with TVs for address etc) and linking them together based on the event_venue field. Looking directly at the event page, everything looks ok, but the Newslisting snippet can’t pick out the user-defined TVs.

                Template Variables. How do we access these when we are outside the document (er, the document with the TV’s defined). When I searched the forum for similar problems I seen some pretty confusing solutions using arrays, placeholders, database queries..? This may have been resolved already, but if not I propose something simple like $modx->getTemplateVarValue($pageID, $var).

                cheers.
                  • 25663 MODX Staff
                  • 12,272 Posts
                  The TV-related API is a bit weak at this point. There will be a lot of improvements post-0.9.1. Until then, complex, array-driven techniques will unfortunately be your best bet.

                    Ryan Thrash, MODX Co-Founder
                    Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                    • 18397
                    • 3,250 Posts
                    NewsListing 4.0 has tv support
                      • 23260
                      • 30 Posts
                      Fantastic!

                      Thanks Mark laugh