This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

dab69574
dab69574

Hi, severe newbie here. I used the builder plugin for the first time, and made Books and Chapters in the database, made models, backend menus and controllers. So far everything works, but when I try to print my data on the frontend I get blanks. I use the Builder component Record List in my page and {% component "bookList" %} but I only get blank <li> entries. I made 3 test data Books and 2 test Chapters and the Record List component returns the correct number of blank lines for each one. I tried asking for every column and it's all the same. I did a {{ dump(bookList) }} and I can see the object and it's properties. I suppose I could get what I want using a php loop but I feel I'm close and would be better off getting it to work like it should. On a related note, how can I make a foreign key relationship between my books and chapters?

dab69574
dab69574

Okay i solved it. There was nothing wrong with my controller definition, it was the way I was using the Builder Record List component. I was putting integers into the Display Column field instead of the names of the columns, D'oh! I also found out that you can add multiple Record List components with different aliases to display different columns. But the output can't be interleaved, so all of one column in a list will be displayed, then all of another. However, the iteration method works well for this: {% for record in records %} {{ record.name }}<br /> {{ record.skinny }}<br /> {{ record.body }}<br /> <hr> {% endfor %} Each column can have it's own custom markup, like a bold name and an italic skinny for example.

My next problem is that my record.body column puts out html tags like this: <style type="text/css"> * { box-sizing: border-box; } body {margin: 0;} </style> <div><p id="i06b">Insert your text here</p></div> Instead of outputting usable html, it's like it was inside a <pre> tag. I specified the grapesjs widget to edit that column. How can I get my output to be actionable html instead of plain text?

1-2 of 2

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.