Browsing Andchir's blog i found an interesting approach of managing resources via module with only three lines of code! :)

It's not perfect, but may be an convenient way of handling many resources without going through the site tree.

okay, let's say your News (or Blog) section is within the container "News" (resource ID 12 in my example). Go to "Modules" -> "Manage Modules" ->"New Module" -> name it e.g. "News" and enter the following code:

$news_id = 12; //ID of your container
setcookie('webfxtab_childPane', 1, time()+3600, '/');
$modx->sendRedirect("index.php?a=3&id=$news_id",0,"REDIRECT_HEADER");

save it, then refresh the page (maybe you need to log out & in), and you'll see a new module section called "News". Click on it and you see the module with all resources listed:

MODx resource module

you can also access the listing by right-clicking the resource in the tree and selecting "Resource Overview". Nested container resources can be accessed by clicking on "View" in the listing.
One drawback of this approach is, that after saving a resource you won't get back to the listing where you started from ... but maybe someone knows how to improve the module-code to fix this.

btw. you can set the number of listed resources for pagination in "Tools" -> "Configuration" -> "Inerface & Features" -> "Number of Results"

anyway, i think this is pretty clever (with only three lines of code!)

cheers, j

ah, almost forgot ... there's also this approach in the making by the japanese MODx community. Ideally this would also include a different caching strategy in order to avoid MODx'es resource limitation.

admin
Gravatar Image
Reply #2 on : Mon August 16, 2010, 17:07:51
hey Mary!

actually i'm looking forward to the solution from the japanese community ...not sure if the above approach is really good for non tech-savey clients, guess i'm just impressed by the result/code ratio :)

j
mary
Gravatar Image
Reply #1 on : Sun August 15, 2010, 21:17:42
Nice one Jan. Should come in handy for clients who don't want to have to deal with the resource tree!
  • Required fields are marked with *.

If you have trouble reading the code, click on the code itself to generate a new random code.