You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have many custom web parts that render out author contributed content that is set in the properties pane. In many cases, we need this content to be searchable, so we expose these properties in propertiesMetadata() and define their type (plain text, html, link, etc). This works really well, but where we are running into issues is the scenario where we have other web part properties that might be used to disable a group of properties, resulting in differences in how the content is rendered.
For example, you may have a property toggle that shows another set of web part properties, which will render on the page and we would want to be searchable. However, if those properties have content in them and the toggle is disabled, we have no way of removing it from propertiesMetadata conditionally. In that step in the web part lifecycle I can't seem to access other properties so I have no way of checking whether or not the property in question should be searchable.
Is there another way to achieve this that I'm not understanding? If not, then it would make sense to me that one of the following is done.
Add the ability to access other property values in propertiesMetadata. This would let us conditionally add a property based on values of other properties set by the author.
Have a flag that can be set on the web part property itself to indicate that it should be ignored from search. Initially I thought maybe it should respect the disabled flag in this way, but after thinking about it I can imagine there are scenarios where you might want to disable a property, but still have its value searchable. Alternatively, maybe there's another flag that could be set to force disable search index on a property, regardless of whether it's defined in propertiesMetadata or not.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
We have many custom web parts that render out author contributed content that is set in the properties pane. In many cases, we need this content to be searchable, so we expose these properties in propertiesMetadata() and define their type (plain text, html, link, etc). This works really well, but where we are running into issues is the scenario where we have other web part properties that might be used to disable a group of properties, resulting in differences in how the content is rendered.
For example, you may have a property toggle that shows another set of web part properties, which will render on the page and we would want to be searchable. However, if those properties have content in them and the toggle is disabled, we have no way of removing it from propertiesMetadata conditionally. In that step in the web part lifecycle I can't seem to access other properties so I have no way of checking whether or not the property in question should be searchable.
Is there another way to achieve this that I'm not understanding? If not, then it would make sense to me that one of the following is done.
Thoughts?
Beta Was this translation helpful? Give feedback.
All reactions