User Profile
drmrbrewer
Copper Contributor
Joined 5 years ago
User Widgets
Recent Discussions
Custom CSS on a Library page
I've been using row formatting to provide custom styling to a library as described here. I've been referring to the various standard classes, such as "sp-field-severity--severeWarning" mentioned in the example. Now I'd like to go a little further, and add some custom classes of my own, mainly to tailor the hover behaviour more closely to what I want. I would expect this to be a simple case of dropping in some simple CSS code into a folder somewhere. But unless I'm missing something, it seems to be incredibly complicated to achieve... see e.g. here. Is it really that difficult? Surely it really should be a case of specifying some CSS definition like the following?? .my-hover:hover { background-color: green; }2.3KViews0likes7CommentsFormatting to set background colour of entire cell (not just text part)
I am using custom formatting along the following lines: { "$schema": https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json, "elmType": "div", "txtContent": "@currentField", "attributes": { "class": "='ms-Link ' + if(endsWith([$FileLeafRef], '.msg'), 'sp-field-severity--good', '')" }, "customRowAction": { "action": "defaultClick" } } This works fine, except that it only changes the background colour of the text part of the cell. You can see in the following clip that, where the cell is larger (to fit content in other columns), the cell is larger than the textual content: Is it possible to specify a background colour of the entire cell, based on file extension?563Views0likes1CommentReplace column title with an icon (or just hide title text)
I have a custom column where each entry is just a small icon acting as a button to run a flow (this is done via column formatting via json). I'd like to be able to make this column not take up any more space horizontally than the buttons themselves. But I can't seem to resize the column to anything narrower than the title of the column (i.e. column name). I could rename the column use only one or two letters, but this seems like a horrible hack... the column name is used not only as the title in the UI but it's also used like a variable name in power automate flows, so it needs to be descriptive otherwise it becomes very difficult to understand the flow. Is it possible to reduce the column title name (without renaming the column), or replace it with an icon?1.2KViews0likes3CommentsFormat calculated column as hyperlink to navigate like the Name column
I have a calculated column which is populated with content from my custom Subject column, and if that is blank then it falls back to what is in the standard Name column (or a tracked version of that, since Name is bizarrely not available as a column choice in a calculated column). Now I want that to act as a hyperlink in the same way as the Name column, I.e. to move into the folder (if it’s a folder) or open the file (if it’s a file). It’s like a substitute Name column. Is this possible?Solved3.7KViews0likes6CommentsCustom column formatting: get current folder (for hyperlink with relative path)
I am using this article as the basis for applying custom formatting to create a hyperlink from the field value. So the JSON for formatting is something like: { "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json", "elmType": "a", "txtContent": "Project Documents", "attributes": { "target": "_blank", "href": "='https://crescent.sharepoint.com/sites/projects/' + @currentField" } } In the above,@currentField is used to extract the value of the current field/column. And I see from here that it's also possible to use @currentWeb get the main site dynamically rather than hardcode it. What I really need is something similar to get the folder for the current item, so that I can for example then refer to a sub-folder relative to the current folder, rather than relative to the top level, i.e. something like @currentFolder in the below: "href": "=@currentWeb + '/' + @currentFolder + '/my-sub-folder/' + @currentField" Is this possible? Or is there a better way to construct hyperlinks like this that are relative to the current item? The problem with full hard-coded paths (like the following) is that this formatting trick won't work for any folder, only for a specific folder... "href": "=@currentWeb + '/Documents/North Dept/Team A/2023/Reports/my-sub-folder/' + @currentField" And I can't see that using an actual Hyperlink type of column would work for this, because the full path name would need to be used... because it's just a string that is interpreted as a URL? I'd really like the ability to create hyperlinks that are relative to the current folder.1.3KViews0likes0Comments
Groups
Recent Blog Articles
No content to show