I am pulling the Modx content field into a chunk that is rendered by getImageList.
The content field is referenced in the chunk as [[*content]]. The content stored for this field is rendered, but not wrapped in formatting tags per usual (i.e. h tags, p tags, etc.).
Is there a trick to getting this to work properly?
The getImageList call is very simple:
[[getImageList?
&tvname=`eventDetails`
&tpl=`event_Details`
] ]
There’s nothing tricky in the chunk – just the aforementioned reference to the resource content field and basic HTML.
Please let me know what, if anything, I’m missing – thanks.
your call should be
[[getImageList?
&tvname=`eventDetails`
&tpl=`event_Details`
]]
and could you post your chunk, please.
and please, the output, both, which you get and which you would like to get instead.
Hi Bruno -
The call’s formatting was changed when I added it to this post, if that is the reference of you comment. Thanks.
The event_Details chunk is
<div class="eventItem__detail eventItem--date"><span class="eventTitle">[[+name]]</span><br><span class="eventDate">[[+date:strtotime:date=`%a %b %d, %Y`]] | [[+date:strtotime:date=`%l:%M%p`]]</br>[[+location]]</span></div>
<div class="eventItem__detail eventItem--imageRow">
<div class="eventItem__detail eventItem--image"><img class="eventImage" src="[[+image]]" alt="[[+name]]"></div>
<div class="eventItem__detail eventItem--description">[[*content]]</div>
</div>
The output shared below is the div.eventItem–description containing the content field - this is the element copied directly from the HTML. The line breaks reflect the editor view on this resource:
<div class="eventItem__detail eventItem--description">This is a bunch of descriptive content about the concert event. This is a bunch of descriptive content about the concert event. This is a bunch of descriptive content about the concert event. This is a bunch of descriptive content about the concert event. This is a bunch of descriptive content about the concert event. This is a bunch of descriptive content about the concert event.
This is a bunch of descriptive content about the concert event. This is a bunch of descriptive content about the concert event. This is a bunch of descriptive content about the concert event.
This is a bunch of descriptive content about the concert event.</div>
The below screen shot is the visual output:
The HTML lacks the wrapping tags normally inserted by the editor (tinyMCE), which is what the browser view deomnstrates.
does it work when you put [[*content]]
outside, without the getImagelist - call?
maybe its the RTE, which strips the tags allready?
Now I’m really confused. I removed ```[[*content]]`` from the getimagelist call and placed it directly into the template. It’s output does not include the formatting tags.
If I view the HTML of the content field from the resource page, I can see that the field value has been wrapped in p tags.
I use the [[*content]]
field in other templates in the way – and have been doing so in MODX for oh I do’t know 10+ years.
Totally confused as to why now tags are being stripped.