Fred and Collections

How would one go about using Collections in Fred? To create a blog for example. Is there any documentation available?

Do you mean the extra Collections?

I don’t see why it would make any difference if you use ‘normal’ MODX resources or resources you edit with Fred.

That’s right, I mean the extra Collections.

I guess the way to go about it is something like this?

  1. Install Collections and do the settings as you would on a MODX site without FRED
  2. Create a normal MODX template with a pdoPage call or similar for the page which will display the news summaries
  3. Create a resource, make it a Collection and assign the template from step 2 to it
  4. Create a FRED template for the individual articles, with [[*pagetitle, [[*publishedon]] and a drop-zone
  5. Create an Article element with a field for data-fred-target=“introtext” and an editable rich-text area

To create articles from the front-end you’d then have to:

  1. Select Collections from the FRED sidebar
  2. Select the resource from step 3 above
  3. Select New Page and assign the template created in step 4 above
  4. Drag the Articles element created in step 5 above to the drop zone of the new page and enter the introtext and content

Did I get it right or is there an easier way? Is there a way in which you wouldn’t have to do the last step 4? Can you make editable fields directly in the Article template somehow?

I’m trying to create an element that lists the collection items, which can be dropped on any page. However, it doesn’t seem like option settings can be used in snippets.

This for example won’t work in an element:

            [[!pdoPage?
                &parents=`{{postparent}}`
                &limit=`{{limit}}`
                &tpl=`articleItemTpl`
                &includeContent=`0`
                &showHidden=`1`
            ]]

Has anyone else had any luck with using options inside snippet calls within FRED elements? @sottwell perhaps?

Also, I’m trying to figure out how to add images to the collection items which can be displayed in the feed. I tried following @sottwell 's excellent guide at Cooking with MODX - Simple Image TV and I see the TV under the Advanced tab when editing the page in FRED. However, the image I select isn’t saved. Did I miss something or is this a bug in FRED?

I think it’s a bug (in the branch for MODX 3).

In the 2.x branch, there is this code that deals with the submitted TV data

This code seems to be missing in the 3.x branch.

I got around this by putting the tv as an editable image in the FRED element. When it’s edited there it gets saved.

<img data-fred-editable="true" data-fred-name="bild" data-fred-target="tv_fredImageTV" class="d-block w-100" src="[[pthumb? &input={{bild}} &options=aoe=1&w=900&h={{ratio}}&dpi=72&q=85&f=jpg&zc={{zoomCrop}}]]" alt="{{ alt }}">

However, I’m still struggling to include the images in the feed. For some reason the tv value doesn’t show up. My FRED element contains this:

                [[!pdoPage?
                    &parents=`29`
                    &limit=`1`
                	&tpl=`articleItemTpl`
                	&includeTVs=`fredImageTV`
                	&tvPrefix=`tv.`
                	&prepareTVs=`1`
                	&processTVs=`1`
                	&includeContent=`0`
                	&showHidden=`1`
                ]]

The articleItemTpl contains this but nothing is displayed:

[[+tv.fredImageTV]]

On a site without FRED I’m pretty sure it would work but not with FRED for some reason. Another bug?