There’s so many ways to skin this cat. In modx, you really can do anything. This is one way to do it.
Quote from: nirguna at Sep 06, 2010, 07:09 PM
However these "family stories" are not necessarily visible or accessbible separately
via an URL. I might be able to get these documents to be "hidden" or non public so thats fine.
That’s not a problem. Just set the page to be unpublished. Or just let the content of ’Family Stories Template’ be a snippet that calls the modx $modx->sendErrorPage()
Those are 2 ways you can keep the ’Family Stories’ from being accessible via a URL. You would probably want to turn on Friendly URL paths too.
Quote from: nirguna at Sep 06, 2010, 07:09 PM
lets say that I have a folder called family stories and I have a bunch of
family stories under them.
On the home page I am interested in displaying a random family story.
This requires ONE Document to load a bunch of other documents (family stories) and
iterate through their data. Is this possible? Like $Modx->getDocument or something I would pressume.
You can do a number of things.
- you could use the Ditto snippet
- Since you know php, you could use the api $modx->getAllChildren, then get one of the ids randomly, and $modx->getTemplateVars(array(), ’*’, $random_doc_id)
--
http://wiki.modxcms.com/index.php/API:DocumentParser
Quote from: nirguna at Sep 06, 2010, 07:09 PM
In a way, we are, essentially storing DATA as a DOCUMENT. While it might work,
i would imagine that a better way would be to write a plugin or something that can
maintain DATA + LCRUD operations on the data so that documents can read that
data and display that data as they want. Am I off base here?
Yeah you can do it a million ways. You can create a module so the site owner goes there to update the ’stories’. You could use Jott on the frontend. With modx, the world’s your oyster. This is just one way where you don’t have to do a lot of programming.
MODx really is flexible, so just dig into it, and whatever way you want to do it is possible.