Subscribe: RSS
  • I'm new to the forum, and a relative newbie to MODX. I've used it for a couple simple projects in the past, but it's been a while.

    I'm considering MODX for an upcoming project and I'd like to get an idea of how I should tackle a particular challenge and if MODX is the right tool (I think it is). Let me offer some brief background on the website: My client offers expedited passport and visa services. For a given service (e.g. china tourist visa, brazil business visa) they provide a list of required items for that particular service. So the requirement is that they can add new services and respective required items as needed. Here's a simplified version of how the outputted html should look:

    <h1>Service Title</h1>
    <p>Service description</p>
    
    <h2>Required Items</h2>
    
    <h3>Required Item 1</h3>
    <p>item description</p>
    
    <h3>Required Item 2</h3>
    <a href="path-to-file.pdf">Conditionally Rendered Download Link</a>
    <p>item description</p>
    
    <h3>Required Item 3</h3>
    <p>item description</p>
    


    I picture the service being the parent resource with it's own necessary template variables (service title, service description), and the required items would be child resources with their own respective TVs. Then I could use an Add-on like renderResources to list the child resources.

    My main question is am I on the right track or am I going to need some custom development? I think I'm on the right track, but I want to make sure before committing. Please forgive my lack of MODX knowledge, and thanks for the help.

    Other Considerations


    • Note that one of the items includes a link. I need to be able to render a link if one is provided for a given resource.
    • The required items resources should not be individually accessible via a unique url. It should be hidden in the regard, but available in a list of the parent resource.
    • It looks like a job for getResources (if I'm understanding you, renderResources is not what you want).

      Does the data for your example page come from a single resource (and its TVs) and its immediate children (and their TVs)? If so, it should be fairly straightforward.

      If you will have a large number of resources, doing this with one or two custom snippets would give you faster page loads, but I'd try it with getResources first.

      One tip -- you'll get significantly faster page loads if you can use the built-in resource fields instead of TVs for as much information as you can. Their names are arbitrary and the pagetitle, summary (introtext), description, and content fields can be used for anything you want (though some are limited in length).

      Displaying links is no problem.

      To avoid direct links to pages, you can leave them unpublished and use &showUnpublished=`1` in the getResources tag. That will show them in your display, but no one will be able to go to them directly.


      ------------------------------------------------------------------------------------------
      PLEASE, PLEASE specify the version of MODX you are using.
      MODX info for everyone: http://bobsguides.com/modx.html


        MODX info for everyone: http://bobsguides.com/MODx.html
      • Thanks for taking the time to reply.

        Yes, the data would come from a single resource and it's immediate children. There would likely only be 5-10 child resources. I'll definitely use your tip on using only built-in resource fields.

        Thanks again, I'm going to test things out a bit and see how it goes.