We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 53196
    • 2 Posts
    Very new to MODX and could not find this answer in forums.
    Helping a client make some minor changes to their site and the person who created the site used MODX.
    I've been able to figure out quite a bit, but for some reason I can't get a new location element I added to show on the front end of the website.
    I even cloned an existing good element and modified it, but no luck.
    Any input is greatly appreciated.
    Location element not showing up is Tampa Florida.
    I attached screen shots of the element on the back end. Thanks-
      • 30585
      • 833 Posts
      Can you paste the markup of your Location template here? Can you also show a screenshot of the "Elements" tab, showing the content of the Templates Variable section? Looks like you only need to add some Template Variable tags to display your location info.

      Assuming the case he used Title cases in the names of the Template Variables, the following
      [[*Address]] [[*City]] should display the address and the City.

      You can read more about Template Variables here => https://docs.modx.com/revolution/2.x/making-sites-with-modx/customizing-content/template-variables
        A MODx Fanatic
        • 38783
        • 571 Posts
        Your Tampa Resource does not appear to belong to any Resource Groups. It would be worth comparing it to others that work correctly to see it should belong to one.

        There is a comma in the url (resource alias) which might cause problems?

        Looking at all the other locations, they are Containers. I can't see what they contain, but I wonder if the site is using Containers with other Resources that contain the Location Data and the Containers are pulling the location data using getResources or something similar?

        As Treigh says, seeing some of the code would be useful.
          If I help you out on these forums I would be very grateful if you would consider rating me on Trustpilot: https://uk.trustpilot.com/review/andytough.com

          email: [email protected] | website: https://andytough.com
          • 53196
          • 2 Posts
          Thanks for the replies. I've made some more adjustments, but still no luck.
          Here is the Location Template code:
          [[$head]]
          <div id="body_bg">
          [[$header]]
          <div id="main" class="clearfix" role="main">
          <div class="widthwrap">
          <h1 class="page_title">[[getResourceField? &id=`[[UltimateParent? &ignore=`7`]]` &field=`longtitle`]]</h1>
          <div id="content_bg" class="clearfix">
          [[UltimateParent:is=`[[*id]]`:then=``:else=`<h2 class="content_title">[[*longtitle:default=`pagetitle`]]</h2>`? &ignore=`7`]]
          [[$side-menu]]

          <div id="content">
          [[*content]]
          <div id="map"></div>
          <ul id="map-list"></ul>
          <div id="locations">
          [[getResources?
          &tpl=`location`
          &parents=`[[*id]]`
          &includeTVs=`1`
          &sortby=`menuindex`
          &sortdir=`asc`
          &depth=`0`
          &limit=`0`
          ]]
          </div>
          </div>
          </div>
          </div>
          </div>
          </div>
          [[$footer]]
          [[$script-footer]]
            • 30585
            • 833 Posts
            Make sure that getResources is installed (Extras -> Installer) and that the Location page has children that are published. This call:
            [[getResources?
            &tpl=`location`
            &parents=`[[*id]]`
            &includeTVs=`1`
            &sortby=`menuindex`
            &sortdir=`asc`
            &depth=`0`
            &limit=`0`
            ]]

            is telling MODX to list all pages that are children of any document using the location template.
              A MODx Fanatic