Our First Keyword #40
Replies: 3 comments 2 replies
-
Congratulations to you both, Craig and Amanda!!! FYI, when you copy/paste code here, I found out that it was better to paste first, select the code, THEN click the Code <> icon. I took the liberty to reformat your code above. Cheers, |
Beta Was this translation helpful? Give feedback.
-
Hi Jon
We created this keyword to set a views max width. This was before Norm
came up with his _style keyword.
However we still use this:
``_vmxw=1000``
As a shorthand for this:
``_style=[max-width: 1000px]``
We keep using it because it means it's easily identifiable amongst all our
_style keywords on a view and it's a few less characters to type as we use
this a lot, on nearly all views and we can adjust them individually.
Do not use the code I posted originally , it won't work, as it is very out
of date. We have since updated it to accept ktlRoles andultiple
instances. I will post the latest code here on Monday.
I have started to look at your code but haven't tried it yet I'll let you
know about it in Knack forum on Monday.
Craig
|
Beta Was this translation helpful? Give feedback.
-
Hi Jon There are 2 bits of code you need to add to the KTL if they are not there already
With this code added you can add custom Field Keywords & custom View keywords. The setViewMaxWidth function is below:
The setViewMaxWidth will allow you to have different widths of view for different user roles and allow you to use it as many times in the view as needed e.g.
Hope this makes sense any questions and I'll be happy to help. Craig |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi @cortexrd
Just thought I'd let you know that we have just made our very first app specific keyword. _vmxw "View Max Width". This accepts a number as a parameter. This is the function to make it work:
Thank you Norm this was really easy to do because of KTL.
Craig
Beta Was this translation helpful? Give feedback.
All reactions