Other display list templates

rafaelscouto 25 Apr, 2019
How can I get different types of watch lists?

I'd like to create my own, but I could not. It would be the attached model.
Other display list templates image 1
healyhatman 25 Apr, 2019
You can do whatever you like, as long as you have the CSS / HTML. Where'd you get that list from?
rafaelscouto 25 Apr, 2019
The image is an example, since the only available forms are:
Tables
Details list
Repeater

It could have a more practical way of creating other views template.
rafaelscouto 26 Apr, 2019
Within functions, I created a "Read_Data", I left with the option "All Matching Records".

In the "View" tab, I created a "Custom_Html", inside it I used {var: read_data.Model.field_name}

In "Events" in Index I put my {view: Custom_Html}

Nothing is displayed
healyhatman 26 Apr, 2019
Well of course not, you need to call the function first.
{fn:read_data}
And THEN you can use your view. Although that {var: call won't work very well, assuming you've entered it literally as you've typed it, you're probably looking for {var.pr:read_data}

Or just
{fn:read_data}
{debug:}
rafaelscouto 26 Apr, 2019
Yes, I called the function!

My Index is like this:

{fn: read_data}
{view: Custom_Html}

Inside the "Custom_Html" I put {var: read_data.Model.field_name}

But nothing is displayed.

With this same configuration, I can see inside the "View" event. But there my "Read_Data" is like "First Matching Record" and it reads according to the "id" chosen.

But in the index I could not read the data, because I do not want to use "Table" but a custom html.
healyhatman 26 Apr, 2019
So if it's a Return All Matching then you can't just use read_data.Model.field_name. You need read_data.index.model.field_name, for example

read_data.0.Model.field_name

Or you need to use a LOOP function, with the custom HTML for the row called each time in the loop.
rafaelscouto 26 Apr, 2019
I do not know how to create a loop
I am not a programmer, although I have a certain notion of how to do things
healyhatman 26 Apr, 2019
Use a LOOP (should be in there under logic), data source should be {var:read_data}. Inside the loop you put the HTML you want, getting the data for each field in the row of the loop using {var:loop_name.row.Model.field}

Then in your index event you would put
{fn:read_data}
{fn:loop_name}
If you want something like the image you've shown you're going to need to add custom CSS to the page.
rafaelscouto 29 Apr, 2019
It's working, thank you!
How can I enter search and paging within this loop?

I would like to create an event calendar.
healyhatman 29 Apr, 2019
search and paging happens in the read data action. If you want an event calendar there are plenty of components you can use to do that for you easier than building your own in CF from scratch.
rafaelscouto 29 Apr, 2019
It really gives more work to make a calendar, but now it's working the way I wanted it to.

My question now is the following, how can I return the values according to the month, only the month.

In my database I have a field with the name of "start_date", where I only record the date. Y-m-d.

I want to display in my loop just for the current month.
healyhatman 29 Apr, 2019
In your where conditions (in your read data)
MONTH(start_date)  = {date:m}
AND
YEAR(start_date) = {date:Y}
This topic is locked and no more replies can be posted.