We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 23299
    • 1,161 Posts
    I seem to be swimming upstream and drowning with my current task...

    I have a site for a business (restaurant) with several locations. Each location has a different location, phone number, hours of operation, etc. I want to build a sidebar system that will have all these fields created with some kind of TV. Once I turn the site over to the owner I want him to be able to enter all this information in pre formatted boxes.

    So if edits the LocationOne page there will be a TV box within the sidebar that looks like something like this:

    Hours

    Lunch
    Monday-Friday:
    Saturday-Sunday:

    Dinner
    Monday-Friday:
    Saturday-Sunday:

    Phone Number:

    Address:

    Map:

    He could then enter the relevant info into each box and the page would create the info (that is styled with a CSS stylesheet.) The fields should not be changed, just the area where he enters the hours, address, etc...

    So, I am guessing this would be some kind if TV within my main page template. I have been messing around with TV’s (sort of new to me) and I am not getting how to create these fields?

    Any suggestions here?

    Thanks
      • 4971
      • 964 Posts
      Template variables are one of the many powerful tools that MODx offers.

      They allow you to create input "fields" of many types where your user admin can
      just fill in the fields to create a new incarnation of a page. They are also powerful
      to have pieces of content that you can move around in your templates to give your site
      a very diverse look.

      Please read http://svn.modxcms.com/docs/display/MODx096/Template+Variables to
      start understanding their power and flexibility and ask away if you have any questions on
      the way...
        Website: www.mercologia.com
        MODX Revo Tutorials:  www.modxperience.com

        MODX Professional Partner
        • 23299
        • 1,161 Posts
        I read that. I wish there were more examples to illustrate all the choices.

        I think I can add picking separate chunks into my TV. At least the individual chunks can then be edited using TinyMCE. Not quite the system I wanted (not as smooth) for the site owner, but it might have to do.
          • 4971
          • 964 Posts
          I hear you. I think all of us want more examples of the use of TVs, but
          they are so flexible that you will be amazed of what people do with them...
          having said that I would do the following for your issue.

          Hours                   
          
          Lunch      
          Monday-Friday:          [*lunchWeekday*]      text type
          Saturday-Sunday:        [*lunchWeekend*]      text type
          
          Dinner
          Monday-Friday:          [*dinnerWeekday*]     text type
          Saturday-Sunday:        [*dinnerWeekend*]     text type
          
          Phone Number:           [*phone*]             text type
          
          Address:                [*address*]           textarea type
          
          Map:                    [*mapCode*]           number type
          


          For each field you create a TV, and set the type. Then you create a chunk that you can name {{locationInfo}} and set all the text and the TVs in a html table. You could have another TV
          named {{sidebar}} and place it in your document template.

          Then your client just has to open the location info document and fill in the TV fields, they look
          like a normal form and voila... you can have a bunch of documents for different locations. Hope this helps.

          PD I assumed that for the map you use a numeric code to embed the map, it could be textarea if
          the embedded code was more complex.
          as
            Website: www.mercologia.com
            MODX Revo Tutorials:  www.modxperience.com

            MODX Professional Partner