Problems, need help? Have a tip or advice? Post it here.
18 posts Page 1 of 2
Hi, KK!

If any other person can also help - please, do not hesitate & welcome.

Here we have custom queries with students and courses.
viewtopic.php?f=5&t=8581&p=16352&hilit=cms%3Aquery+query#p16352

Let's assume we now have students, courses and grades. Example task is to query all students, who take math and print them out by performance grade - from best student (10 points) to a not so good one (0 points). This should be easy - fetch students who take math and just feed cms:pages with a list of id's of students and then order by grade.

Well, now the real thing:
Let's assume, we have boys who take math and girls who take math. How to print out the list of boys and girls combined, according to their grade?

Basically, I have here 2 lists of ids from 2 templates. Now is to sort them by custom_field (grade) but I just feel running in a circle here.
Any hint is much appreciated! Thank you.
Join COUCH:TALK channel here https://t.me/couchcms_chat
Ryazania — a framework to boost productivity with Add-ons viewtopic.php?f=2&t=13475
Support my efforts to help the community https://boosty.to/trendo/donate
Hi,

Maybe not a good solution, but what about setting a variable 1 to list of boys and a variable 2 to list of girls by page id and a variable 3 to 1+2, and then filter a list from the page id's of variable 3
I load frameworks and write bugs on top of them, after that I rearrange the code so that it looks like a cool product.
Tomarnst wrote: Hi,

Maybe not a good solution, but what about setting a variable 1 to list of boys and a variable 2 to list of girls by page id and a variable 3 to 1+2, and then filter a list from the page id's of variable 3

Now, we have a list of id's with template names (saved specially). And we can also query each id's grade one by one. Any idea how to then sort it out?
Join COUCH:TALK channel here https://t.me/couchcms_chat
Ryazania — a framework to boost productivity with Add-ons viewtopic.php?f=2&t=13475
Support my efforts to help the community https://boosty.to/trendo/donate
Hi,


Now, we have a list of id's with template names (saved specially). And we can also query each id's grade one by one. Any idea how to then sort it out?

I'm not sure I understand this ... isn't the orderby tag working ?
I load frameworks and write bugs on top of them, after that I rearrange the code so that it looks like a cool product.
Not applicable, unfortunately.

List of girls, taking math:
girls_template (1): id1, id3, id5, id6

List of boys, taking math:
boys_template (2): id18, id 22, id 25

--
each ID has a performance grade. Let's sort'em and print out in a 1 list :)
Join COUCH:TALK channel here https://t.me/couchcms_chat
Ryazania — a framework to boost productivity with Add-ons viewtopic.php?f=2&t=13475
Support my efforts to help the community https://boosty.to/trendo/donate
well i see ... I was thinking i would be possible to print out a list of pages from id's that don't take in account the different templates.

Anyhow maybe much easier to setup an template students with folders one for boys and one for girls. I assume those templates are almost the same. Instead of using templates for this.
I load frameworks and write bugs on top of them, after that I rearrange the code so that it looks like a cool product.
What if they are related to each other?
Join COUCH:TALK channel here https://t.me/couchcms_chat
Ryazania — a framework to boost productivity with Add-ons viewtopic.php?f=2&t=13475
Support my efforts to help the community https://boosty.to/trendo/donate
What if they are related to each other?


They are not allowed to get married ..... :lol:

As far as I can understand your setup ...

You have :

- template classes (like math)
- template boys
- template girls


what is the relation between boys and girls ?
I load frameworks and write bugs on top of them, after that I rearrange the code so that it looks like a cool product.
Probably one smart boy helps a few blondes with math. One to many and without much effort one to one.
Join COUCH:TALK channel here https://t.me/couchcms_chat
Ryazania — a framework to boost productivity with Add-ons viewtopic.php?f=2&t=13475
Support my efforts to help the community https://boosty.to/trendo/donate
:lol:

Maybe something like this is closer to a solution.
Code: Select all
   
<cms:templates>
    <cms:if (k_template_name eq 'boys.php') && (k_template_name eq 'girls.php')>
      <cms:pages masterpage=k_template_name>
       
        orderby  custom_field  boys and girls stuff

      </cms:pages>
    </cms:if>
</cms:templates>
I load frameworks and write bugs on top of them, after that I rearrange the code so that it looks like a cool product.
18 posts Page 1 of 2