Moving TVs above the Content field in MODX3

Hey all …

I have some TVs that I want to move from the TV tab to the Document tab.

That’s easy enough to accomplish by setting the region to modx-resource-main-left in Form Customization - but I’d like these to appear before [above] the Content field.

In MODX 2.x I think this happened by default - but I’m struggling to make it happen on MODX 3.1 as they always appear below the Content field, regardless of the Region Rank.

I believe there are hidden regions available: modx-content-above and modx-content-below - however selecting these makes the TVs disappear completely.

Any ideas?

modx-content-above does seem to work when I test it.

OK thanks @halftrainedharry … looks like this is an issue with ContentBlocks.

When enabled for a resource, it rewrites the resource manager Document tab, but I think it rewrites it with MODX2 markup … as a result, the modx-content-above and modx-content-below DIVs are not included

With ContentBlocks disabled:

With ContentBlocks enabled:

@markh - are we on the right track here?

ContentBlocks does hide the children of #modx-resource-content > .x-panel-bwrap which it expects to hold the standard content field. It then adds a different modx-panel in the position ContentBlocks should appear, which is configurable by a setting.

It’s certainly possible the DOM in 3.0 is shuffled a bit and that selector needs tweaking, but it doesn’t rewrite the DOM from #modx-resource-content to #modx-resource-settings. So @dejaya your two screenshots seem to be referring to different parts of the part. CB also just hides the children dom (it doesn’t remove it) so you should be able to still find those in devtools with a display:none? Are these special regions in there for 3.0?

Hi @markh - apologies, you’re right - my interpretation was wrong and previous screenshots were misleading.

I see now that the container for the content section is indeed hidden via display: none;

With ContentBlocks disabled:

With ContentBlocks enabled:

These regions certainly exist in 3.1 and work well when ContentBlocks is disabled.

It would be good to be able to place TVs before the ContentBlocks container.

Thanks for replying :+1:

I think the main difference between MODX 2.x and 3.x is, that in 3.x the content is part of the modx-resource-main-left region while in 2.x this was not the case.

3.x

<div id="modx-resource-main-left">
	<div id="modx-resource-content"></div>
</div>

As the TVs always get added after the existing fields in the region, they appear in 2.x after the introtext and before the content and in 3.x only after the content.


modx-content-above and modx-content-below already exist in 2.x, but are not necessary to place a TV before the content field.

Alright, that confirms it’s ContentBlocks that’s hiding too much then. Thanks for debugging it. I’ve logged an issue and we’ll look at addressing that in the next update.

Due the MODXpo I’m extremely swamped though so I’m not sure how long that will take to get done. I’ll post here when an update is out that fixes it.

1 Like

Thanks both as always :+1:

Hi @dejaya
We’ve just pushed through a new release that should fix this for you. :+1:

1 Like

Installed and looking good :+1: many thanks.