We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 46719
    • 11 Posts
    Is there a way to create resources that have no resource alias and are not viewable as a single page? I have some pages that contain small content boxes (each one is a resource) that are only used as teaser, but have no read more link and should never be used as a single page. Second question is, if the parent page where those content boxes are loaded with getResources is completely searchable? So that the texts that come from getResources are also found on this parent page?
    Hope it's clear what I mean. smiley

    Thanks.

    This question has been answered by BobRay. See the first response.

      • 3749
      • 24,544 Posts
      A Resource with no alias could never be displayed by a browser. It sounds like what you're looking for is a Chunk. You put the text in the Chunk and use a chunk tag where you want it to appear in a page.

      [[$ChunkName]]


      If you need to display them with getResources, though, you can't use Chunks. It might work to leave them unpublished and tell getResources to include unpublished resources, but you would have to have a custom snippet to prevent getResources from presenting them as links if other pages in the same list will be links.

      I'm not sure about your second question (search). I generally use Google's site search on my pages. It would definitely find any text as long as it appears on the page. I don't know if any of the MODX search extras would find it or not.

        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 46719
        • 11 Posts
        Thanks for your help, Bob! The problem is, that I cannot use TVs in Chunks like I can use them in resources (e.g. image upload) and I would have to jump between resources and elements tab, which is uncomfortable.

        I am using the getRelated plugin to display related articles and I don't want to display those resources that are only used as small teasers, because there is mostly only a picture, a headline and intro text (no content).

        New idea: is there a way to load only searchable resources with getResources? So I would just deselect searchable in settings tab of those resources I don't want to be loaded.
        • discuss.answer
          • 3749
          • 24,544 Posts
          Yes, you can use the &where property:

          &where=`{"searchable":1}`
            Did I help you? Buy me a beer
            Get my Book: MODX:The Official Guide
            MODX info for everyone: http://bobsguides.com/modx.html
            My MODX Extras
            Bob's Guides is now hosted at A2 MODX Hosting
            • 46719
            • 11 Posts
            So easy! Works, thank you! smiley But a combination with getRelated isn't possible, right?
              • 3749
              • 24,544 Posts
              I've never used getRelated, but it doesn't appear to have a &where property, so probably not.
                Did I help you? Buy me a beer
                Get my Book: MODX:The Official Guide
                MODX info for everyone: http://bobsguides.com/modx.html
                My MODX Extras
                Bob's Guides is now hosted at A2 MODX Hosting
                • 46719
                • 11 Posts
                Unfortunately no like it seems. Thanks anyway for you help smiley
                  • 18373 ☆ A M B ☆
                  • 3,141 Posts
                  Feature requests are of course welcome: https://github.com/Mark-H/getRelated
                    Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

                    Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.