Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi, I have a blockgrid item which changes layout on the front end depending on the number of columns set in the backoffice. e.g.
I want to replicate this in a custom backoffice view, but cannot find how to get the columnSpan layout setting from the block in Angular.
I have logic like so:
{{wide = block.layout.columnSpan == 12; ""}} <div ng-if="wide == true"> -- wide layout code here - </div> <div ng-if="wide != true"> -- narrow layout code here - </div>
If tried all sorts of variations around the theme of 'block.layout.columnSpan' but can't inspect the json for 'block' to determine the correct syntax.
Can someone please point me in the right direction.
regards
John
what is going wrong? pretty sure it is block.layout.columnSpan
from blockgrid example
<button class="card" ng-class="{'--medium': block.layout.columnSpan === 6}" type="button" ng-click="block.edit()" ng-focus="block.focus">
Thanks Huw,
I'll strip back my code to bare bones to see what's happening. May start with just the example from the blockgrid package.
I'll post again once I've tried.
Cheers
Hi Huw,
That works as expected. Thank you again.
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Finding the column span of a blockgrid item in a custom back office view
Hi, I have a blockgrid item which changes layout on the front end depending on the number of columns set in the backoffice. e.g.
I want to replicate this in a custom backoffice view, but cannot find how to get the columnSpan layout setting from the block in Angular.
I have logic like so:
If tried all sorts of variations around the theme of 'block.layout.columnSpan' but can't inspect the json for 'block' to determine the correct syntax.
Can someone please point me in the right direction.
regards
John
what is going wrong? pretty sure it is block.layout.columnSpan
from blockgrid example
Thanks Huw,
I'll strip back my code to bare bones to see what's happening. May start with just the example from the blockgrid package.
I'll post again once I've tried.
Cheers
John
Hi Huw,
That works as expected. Thank you again.
Cheers
John
is working on a reply...