Hi,
Unfortunately I am unable to simply test this out due to the IT environment I am working in, so apologies for just coming out with a question rather than a 'problem'. I have searched for answers but can't find any.
I am using bootstrap and couch to create a series of announcements on a home page. A clonable template page 'announcements' creates title, body, and link for the bootstrap card. I am then using cms:master page='announcements' to call these, and I have set a limit='12'.
The layout, using bootstrap, organises these cards into a number of columns, which are responsive to screen size (working entirely with vanilla bootstrap breakpoints etc.)
This is fine until we get down to one column (am breakpoint) at which point 12 cards is just too many imo.
Will the following code work??
Can CMS even use that value in the if query? Do I need to somehow set a variable elsewhere on the page for CMS to query? Do I need the "px" in after the "576"??
Again, apologies that I haven't been able to simply test this for myself as I normally would, but hopefully it's an easy question to answer? Whatever the answer, perhaps a small section could be added to the CouchCMS documentation for the 'if' tag to explain how complicated a logic statement we can use?
Thanks in advance!
Anthony
Unfortunately I am unable to simply test this out due to the IT environment I am working in, so apologies for just coming out with a question rather than a 'problem'. I have searched for answers but can't find any.
I am using bootstrap and couch to create a series of announcements on a home page. A clonable template page 'announcements' creates title, body, and link for the bootstrap card. I am then using cms:master page='announcements' to call these, and I have set a limit='12'.
The layout, using bootstrap, organises these cards into a number of columns, which are responsive to screen size (working entirely with vanilla bootstrap breakpoints etc.)
This is fine until we get down to one column (am breakpoint) at which point 12 cards is just too many imo.
Will the following code work??
- Code: Select all
<cms:if screen.width gt '576'><cms:master page='announcements.php' limit='12'><cms:else><cms:master page='announcements.php' limit='6'></cms:if>
Can CMS even use that value in the if query? Do I need to somehow set a variable elsewhere on the page for CMS to query? Do I need the "px" in after the "576"??
Again, apologies that I haven't been able to simply test this for myself as I normally would, but hopefully it's an easy question to answer? Whatever the answer, perhaps a small section could be added to the CouchCMS documentation for the 'if' tag to explain how complicated a logic statement we can use?
Thanks in advance!
Anthony