This sounds interesting for sure.
Author of zero books. Formerly of many strange things. Pairs well with meats. Conversations are magical experiences. He's dangerous around code but a markup
magician.
Blog ✦
Twitter ✦
LinkedIn ✦
GitHub
-
- 73 Posts
I read the entry on Collections in the RTFM, but it isn't quite clear to me how to use Collections to set up a blog. And putting resources in collections, is that only in the backend or does it get populated to the front-end? That's also not quite clear to me.
Is there more information on how to use collections to set up a blog?
-
- 5,888 Posts
Items in a Collections-Container are just Resources.
To turn a Resource-Container into a Collections-Container, you need to change the Resource-type to 'Collection'
Then, you have all Resources in a nice sortable and searchable grid instead of the Resource-Tree.
Additional, you have different settings for fields in the update-page and columns in the grid.
At Frontend, you just use getResources or pdoResources, to list your Items.
-
- 167 Posts
What is the simplest way to migrate from Articles to Collections ?
I tried to change "parent" ID in modx_site_content table : resource appears in "collection container" but the "articles" manager template Still in place...
I don't know if I uninstall Articles extra if articles items will go back as document resources.
[ed. note: johnxx last edited this post 8 years, 7 months ago.]
MODX lover
-
Développeur MODX / Webdesign / Solutions web
I would work out a quickie SQL to set the Articles' resources parent and any other relevant fields WHERE parent = <id of parent Articles resource> and run that from phpMyAdmin or Sequel Pro or whatever your database access method is.
You could get fancy and make a proper MODX function out of it using getCollection to get all of the Articles' children, the loop through them setting the values and saving them. Put the snippet on a resource, and View that resource to run the snippet. If you have a lot of them, use getIterator instead.
It's been a while since I've worked with Articles, so you'll need to take a look at the database and see what settings are given to Articles' children and what settings are given to Collections children. I'm pretty sure that 'hidemenu' is set for Articles but not for Collections, you might want to change that to 0.
-
- 167 Posts
Thank you very much for your reply, starting from this post
http://forums.modx.com/thread/91922/is-collections-the-new-articles?page=2#dis-post-502464 I run :
# switch ArticlesContainer -> CollectionContainer
# the res. ID I want to migrate is 11
UPDATE `modx_site_content` SET `class_key` = replace(class_key, 'ArticlesContainer', 'CollectionContainer') WHERE id=11;
# switch class_key to go back to default document view for children
UPDATE `modx_site_content` SET `class_key` = replace(class_key, 'Article', 'modDocument') WHERE parent=11;
# Change template 49 -> 57
UPDATE `modx_site_content` SET `template` = replace(template, '49', '57') WHERE parent=11;
Quote from: sottwell at Sep 28, 2015, 04:17 PMI would work out a quickie SQL to set the Articles' resources parent and any other relevant fields WHERE parent = <id of="" parent="" articles="" resource=""> and run that from phpMyAdmin or Sequel Pro or whatever your database access method is.
You could get fancy and make a proper MODX function out of it using getCollection to get all of the Articles' children, the loop through them setting the values and saving them. Put the snippet on a resource, and View that resource to run the snippet. If you have a lot of them, use getIterator instead.
It's been a while since I've worked with Articles, so you'll need to take a look at the database and see what settings are given to Articles' children and what settings are given to Collections children. I'm pretty sure that 'hidemenu' is set for Articles but not for Collections, you might want to change that to 0.</id>
MODX lover
-
Développeur MODX / Webdesign / Solutions web
-
- 535 Posts
Quote from: sophieschoice at Aug 02, 2015, 03:18 PMI read the entry on Collections in the RTFM, but it isn't quite clear to me how to use Collections to set up a blog. And putting resources in collections, is that only in the backend or does it get populated to the front-end? That's also not quite clear to me.
Is there more information on how to use collections to set up a blog?
the same here.. too much wp these days.. i thought just installing the extra will output the blog itself..
dont forget to put in Collection Content field something like :
[[pdoResources? &tpl=`blogTpl` &includeContent=`1`]]
blogTpl
<p><strong>[[+pagetitle]]</strong> —
<em>on [[+createdon:strtotime:date=`%A, %B %e, %Y`]]</em></p>
[[+content]]
CTRL+SHIFT+U - Clear Cache
CTRL+SHIFT+H - Hiding Heft Panel
CTRL+SHIFT+N - Fast Create Resource
CTRL+ALT+P - Preview Recource (in edit resorce window)
CTRL+ALT+S - Save