Picture of Arend Raifsnider
Adding multiple articles to a contentObject
by Arend Raifsnider - Wednesday, 11 November 2015, 8:20 PM
 

Hi,

I'm trying to assign multiple articles to a single contentObject. Here are my steps:

1)  In articles.json, I have two articles (a-10 & a-15) created with the same parentID (co-10)

2) In blocks.json, I have some blocks that are assigned to a-10 and, after that, others that are assigned to a-15

3) In components.json, I have my components assigned to the blocks mentioned above

The reason I've tried to do this is to mimic the demo here, which is using a nice graphic (the one with the origami cranes) that is wider than the other components to create a page break. The way my smart colleague figured out to do this is to create a class with an image and assign it to the articles.

However, my output using this method is very strange. Instead of the articles displaying in order on the page with the page break graphics, my components start stacking on top of one another around the middle of the page. I know they're stacking because, when I adjust my screen size, missing components start appearing. I don't see my page break at all.

Does anyone have a thought on why this has happened, and how to fix it?

Also, is there any way for the source code to be released for the demo I linked to? I'd love to take a look at how some of it was done.

Thanks in advance,

Arend

Picture of Chuck Lorenz
Re: Adding multiple articles to a contentObject
by Chuck Lorenz - Wednesday, 11 November 2015, 9:34 PM
 

Hi Arend,

In principle, what you are proposing to do should work just fine: both the structure of your content elements and the use of classes for backgrounds on articles. I'm sure you've done it, but I'd go over the JSON really carefully.

Just brainstorms to help you in your troubleshooting:
- Can you confirm that you are working with the framework as standalone?
- What type of menu or starter are you using? Is this a single page course? 
- Is your contentObject "_type" assigned "menu" or "page"? 
- Does the page render correctly if the classes are removed from the articles?

Regarding the old demo, my understanding is that it was built with old code that no one sees fit to release into the wild. But ask for techniques to achieve what you like in it. I'm sure the community can offer up some helpful insights.

Chuck

Picture of Arend Raifsnider
Re: Adding multiple articles to a contentObject
by Arend Raifsnider - Wednesday, 11 November 2015, 11:28 PM
 

Hi Chuck,

Good to chat with you again!

Answers to your questions:

- Yes, I'm working with the framework

- This is not a single page course. The sections are linked from the main page.

- My contentObject "_type" is set to "page".

- The page still doesn't render correctly when the class is removed (thought of that one prior to posting)

That makes sense about the demo. I think it was done in v1.1.

Our other thought to achieve the same effect is to try creating a class so that we can just use a graphic component for the page breaks that changes its behavior.

Thanks,

Arend

Picture of Arend Raifsnider
Re: Adding multiple articles to a contentObject
by Arend Raifsnider - Thursday, 12 November 2015, 5:05 PM
 

We got this working. The problem was that we had a height property in our class. Removing that resolved the problem.

Thanks!