[5.1.6] File-based container content not showing up in edit view

34 views
Skip to first unread message

Michael Petry

unread,
Mar 18, 2020, 1:21:31 PM3/18/20
to dotCMS User Group
Hello everyone,

I was wondering if someone could help me with an issue I'm having with a file-based container I've created in dotCMS.

Essentially the issue is that when I select content to display inside that container, dotCMS doesn't actually render it in the view. I can only see it if I switch it to the live view.

As a test, I've also created a second container directly in dotCMS using the UI with the exact same code I have in the vtl files, and that seems to render content fine in the test view.

If you look at the screenshots I am attaching to this post, you'll see that in Screenshot 1 the upper container (vtl file-based) doesn't render anything in the edit view while the lower one (dotCMS UI-based) does. What's interesting however, is that in the live view, the content for both show up fine.

Has anyone else experience anything like this before?

Thanks,

Mike.


dotCMS-Capture2.PNG
dotCMS-Capture1.PNG

Jonathan Sanchez

unread,
Mar 18, 2020, 7:48:26 PM3/18/20
to dotCMS User Group
Hi Michael,

Could you please share:
1) the template
2) a screenshot of the container in your site browser (vtls)

Thanks,
J

Michael Petry

unread,
Mar 19, 2020, 11:20:20 AM3/19/20
to dotCMS User Group
Hi Jonathan,

Thank you very much for your reply. 

I am using the same template for the dotCMS container and vtl file-based container. Please see the screenshot I have attached.

This is what I have in the VTL files:

\default\application\containers\accordion folder

container.vtl file
$dotJSON.put("title", "Accordion")
$dotJSON
.put("description", "Accordion")
$dotJSON
.put("max_contentlets", 25)
$dotJSON
.put("notes", "Accordion: Generic")
preloop.vtl file
<snt-accor1dion-group multi-expand="false">
genericcontent.vtl file
<snt-accordion class="faq-accordion">
   
<div slot="summary">$headline</div>
   
<div slot="details">
        $copy
   
</div>
</snt-accordion>
postloop.vtl file
</snt-accordion-group>



dotCMS_1.PNG

Falzone, Chris

unread,
Mar 19, 2020, 1:14:01 PM3/19/20
to dot...@googlegroups.com
So, in the editor you are going to get a bunch of extra divs and so forth that might be messing up your nested web component thing.  That is possibly what is happening.

Your not just getting ...

<snt-accor1dion-group multi-expand="false">
  <snt-accordion class="faq-accordion">
    <div slot="summary">ABC</div>
    
<div slot="details">
        COPY1
    
</div>
  </snt-accordion>
  <snt-accordion class="faq-accordion">
    
<div slot="summary">123</div>
    
<div slot="details">
        COPY2
    
</div>
  </snt-accordion>
</snt-accordion-group>

You're getting something more like:


<div dotcms container wrapper>
  <snt-accor1dion-group
 multi-expand="false">
    
<div dotcms content wrapper>
      <div dotcms container controls> ... </div>
      <snt-accordion class="faq-accordion">
        <div slot="summary">ABC</div>
       
<div slot="details">
            COPY1
       
</div>
      </snt-accordion>
     </div>
     <div dotcms content wrapper>
      <div dotcms container controls> ... </div>
      <snt-accordion class="faq-accordion">
        
<div slot="summary">123</div>
        
<div slot="details">
            COPY2
        
</div>
      </snt-accordion>
     </div>
  </snt-accordion-group>
</div>

Might that be why you are not seeing the other contentlet in edit mode?

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dotcms+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/c893b7ea-d025-438f-a35d-db29e795b7bf%40googlegroups.com.


--


Christopher Falzone / Web Developer
https://aquent.com

[ AQUENT ]


Michael Petry

unread,
Mar 20, 2020, 1:21:09 PM3/20/20
to dotCMS User Group
Thanks everyone for your replies! I've got this to work properly after recreating my container velocity files and clearing cache in dotCMS :)

Jonathan Sanchez

unread,
Mar 20, 2020, 7:03:29 PM3/20/20
to dotCMS User Group
Cool, I have done the exercise in my local without no-issues, I was coming to tell you.
I am glad it is working now
Reply all
Reply to author
Forward
0 new messages