One question as to the lower 2 blocks. Are they news items, random items, teasers, or something else?
-
MODX Staff
- 12,272 Posts
I think all docs will be just parts form other pages in the site. Enter @DOCUMENT and a few TVs I think.
Ryan Thrash, MODX Co-Founder
Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
In fact you can use Snippet to call the document by their id and return all the values in that doc (using getDocument API), and later you can use chunk to work as a template, so that you can customize it using placehlder and getChunk API.
Hope that helps, it’s a little bit harder to approach, but it delivers more flexibility in my point of view.
Hope that helps, and please choose the best and easiest solution for your needs, remember, the more you have flexibility in the system, the more you will use the system in effectively.
Sincerely,
Wendy Novianto
thanks for the answer Wendy Novianto.
getDocument API sounds really complex, I’m a graphic designer, i have some experience with cms but at the level of cut and paste and add tags (actually i can see some php code and know what is happening there) and i m new in MODx.
So isn’t a simple way to call another document in other document? like: [[document ID 3 etc]]
could be nice to do a home page with information of documents inside a site.
Answer to Mark:
could be the descriptions or summary of another document inside the site (a document in modx tree)
I create a new snippet and put this code:
$id = isset($id)? $id: $modx->documentObject[’id’];
// paginatation enabled or disabled
$field = isset($field)? $field : "pagetitle";
// paginatation enabled or disabled
$result = $modx->getDocument($id,$field);
return $id;
Then i put [[getdoc? &id=6 &field=`pagetitle`]] in a document
and only display the number of the id, i try changing the field to another parameter (example: content) and still saw the number.
Laughs! I copied and pasted the wrong code!
Go get the new code in the first post of that thread.
Thanks, now is working
now i need to know how to apply a css style, i think via chunk (?)