Multiline values for Patternslib data attributes.#211
Open
thet wants to merge 1 commit into
Open
Conversation
256b794 to
1554c7b
Compare
Split multiple Patternslib data attribute values into multiple lines. Keep it single-lined, if there is only one value.
1554c7b to
6713cd1
Compare
ale-rt
requested changes
May 11, 2026
Member
ale-rt
left a comment
There was a problem hiding this comment.
I like the idea, but it needs some refinements.
I tested it on the ploneintranet code based and spotted this:
$ git --no-pager diff --staged imagebank/browser/templates/app_image_bank_navigation.pt
diff --git a/src/ploneintranet/imagebank/browser/templates/app_image_bank_navigation.pt b/src/ploneintranet/imagebank/browser/templates/app_image_bank_navigation.pt
index 4d261a6a6..8d132ed3f 100644
--- a/src/ploneintranet/imagebank/browser/templates/app_image_bank_navigation.pt
+++ b/src/ploneintranet/imagebank/browser/templates/app_image_bank_navigation.pt
@@ -19,9 +19,12 @@
<a class="pat-inject ${python: 'current' if tab.get('current') else ''}"
href="${tab/url}"
data-pat-inject="
- history: record; source: #directory-image-bank; target: #directory-image-bank &&
- source: #toolbar-functions-area-${view/app_name}::element; target: #toolbar-functions-area-${view/app_name}::element
- "
+ history: record;
+ source: #directory-image-bank;
+ target: #directory-image-bank &&
+ source: #toolbar-functions-area-${view/app_name}::element;
+ target: #toolbar-functions-area-${view/app_name}::element
+ "
tal:repeat="tab view/tabs"
>${tab/title}</a>
</nav>As you can see there is too much indentation before the second source parameter.
Also I am wondering:
- if
&&would deserve a line by its own (I am not really sure about this). - how this will react to json encoded attributes (IIRC Patternslib supports that).
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Split multiple Patternslib data attribute values into multiple lines. Keep it single-lined, if there is only one value.