-
Notifications
You must be signed in to change notification settings - Fork 2
Docs: Document how to include Sketches in Reports (FLCRM-20058) #35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
nehilor
wants to merge
4
commits into
v2
Choose a base branch
from
feature/FLCRM-20058-sketches-docs
base: v2
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
4d0a89b
Docs: Add SKETCHURL and sketches examples to Report Builder
nehilor a95075b
Docs: Fix typo in sketches example
nehilor 4b22f05
Docs: Downgrade headings to H2 in sketches example per PR feedback
nehilor 1e4cc11
Docs: Clarify sketch ID usage in example per PR feedback
nehilor File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| --- | ||
| title: Sketches | ||
| excerpt: "" | ||
| deprecated: false | ||
| hidden: false | ||
| metadata: | ||
| title: "" | ||
| description: "" | ||
| robots: noindex | ||
| next: | ||
| description: "" | ||
| --- | ||
|
|
||
| ## Display Sketches in Reports | ||
|
|
||
| In the BODY section, search for `element.isSketchElement`. If it doesn't exist, you can add it to your `RENDERVALUES` loop. | ||
|
|
||
| ```javascript | ||
| <% } else if (element.isSketchElement) { %> | ||
| <div class="field"> | ||
| <h2 class='field-label'><%= element.label %></h2> | ||
| <div class="field-value"> | ||
| <% value && value.items.forEach((item, index) => { %> | ||
| <img class="sketch" src="<%= SKETCHURL(item.mediaID) %>" /> | ||
nehilor marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| <% if (item.caption) { %> | ||
| <p><%= item.caption %></p> | ||
| <% } %> <% }); %> | ||
| </div> | ||
| </div> | ||
| <% } %> | ||
| ``` | ||
|
|
||
| ## Resize Sketches | ||
|
|
||
| You can control the size of sketches in the STYLES section by targeting the `.sketch` class. | ||
|
|
||
| ```css | ||
| .sketch { | ||
| max-width: 100%; | ||
| height: auto; | ||
| } | ||
| ``` | ||
|
|
||
| ## Accessing a specific sketch by its field name | ||
|
|
||
| If you want to display the first sketch from a specific field: | ||
|
|
||
| ```javascript | ||
| <div> | ||
| <% | ||
| // Using the data name of your sketch field | ||
| var sketchId = $my_sketch_field && $my_sketch_field[0] && $my_sketch_field[0].sketch_id; | ||
| %> | ||
| <% if (sketchId) { %> | ||
| <div class='sketch-column'> | ||
| <img class="sketch" src='<%= SKETCHURL(sketchId) %>' /> | ||
| </div> | ||
| <% } %> | ||
| </div> | ||
| ``` | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.