ポップアップ内でフィールド全体を「適切な形式」に変換しようとしています。カスタムポップアップの設定はすべてHTMLで行います。PythonやArcadeなら簡単ですが、ESRIではHTMLで記述する必要があります。CSSを使って変更する方法は見つかりましたが、HTMLウィンドウだけで変更する方法がわかりません。何かアイデアはありますか?
コードはこちらです:
{caution_notes}
Can you expand on what you mean by proper? The image you embedded will display anything thats written/stored in your Caution_Notes field.
What kind of formatting are you hoping to achieve? What kind of information is stored in the Caution_Notes field?
I should have been more clear. The field is about a paragraph in all CAPS. Ideally I would like it to only capitalize after a sentence ends. I'm trying to make it readable by making it 'proper' case. Here is the link to achieve it in JavaScript, Python, VBScript and Arcade: Specify text for labels—ArcGIS Pro | ArcGIS Desktop. Here is the example from the link using 'proper' case.
Proper($feature.NAME, 'firstword')
Python
def FindLabel ( [NAME] ): S = [NAME] S = S.title() return S
VBScript
Function FindLabel ( [NAME] ) FindLabel = UCase(Left([NAME],1)) & LCase(Right([NAME], Len([NAME]) -1)) End Function
JScript
function FindLabel ( [NAME] ) { var str = [NAME]; var iLen = String(str).length; var upper = (str.substring(0,1)).toUpperCase(); var lower = (str.substring(1, iLen)).toLowerCase() return upper + lower; }
For custom popups, there is only the option for HTML. A lot of data is recorded in CAPS so I'm surprised to not see something like this out of the box. Any ideas on formatting?
I'm not the most savvy with writing code but you can do something similar to the last sample with Arcade by creating an expression in the pop up configuration:
Text Functions | ArcGIS for Developers
Create an expression with this:
Proper ($feature.City, 'firstword')
Where in my example, I have a field called City. Then you can use that expression like a field in your custom popup. It will also appear in the table.
Mike
サインインしたメンバーは投稿、更新のフォローなどができます。初めてですか?無料アカウントを登録してください。
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.