pnp / sp-dev-fx-webparts

SharePoint Framework web part, Teams tab, personal app, app page samples
http://aka.ms/spfx-webparts
MIT License
2.04k stars 3.86k forks source link

is it possible to use crawled or managed Properties in pnp/sp-dev-fx Modern Script Editor Webpart? #1736

Closed sankara2020 closed 3 years ago

sankara2020 commented 3 years ago

Sample: Script editor web part for modern pages built in React https://github.com/pnp/sp-dev-fx-webparts/tree/master/samples/react-script-editor

Hi @wobba I created a html/js gantt chart and would like to use a sharepoint list to update it. is it possible to use crawled or managed Properties in the Modern Script Editor Webpart, like you can with the modern search result webpart? I tried using handlebar expressions ( {{title}}, but that doesn't seem to work. image

Thanks

ghost commented 3 years ago

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

hugoabernier commented 3 years ago

@sankara2020 not sure about the script editor web part, but have you tried the content query web part to use a handlebar template around crawled search results? You can find it in this repo.

sankara2020 commented 3 years ago

I'm also using JavaScript in the script editor to control the chart. Currently I'm manually updating the code that's why i would like to use crawled or managed Properties from a share point list. Update the list: updates the gantt & bar chart on the page. I've just had a look at the content query web part, don't think that will work in this case.

sankara2020 commented 3 years ago

thanks for the suggestion though!

wobba commented 3 years ago

@sankara2020 the script wp is just that. You get the content and you render it. If you want to use handlebars you have to load it. The web part is nothing but a shell and has no special logic built-in.

sankara2020 commented 3 years ago

@wobba hi, what do you mean by load the handlebars? I already have my html/ js content, how do i then load the handlebars?

wobba commented 3 years ago

{{}} is handlebar notation and a separate UX framework. See https://handlebarsjs.com/.

hugoabernier commented 3 years ago

Closing this issue due to no recent activity. Feel free to open a new issue if you continue to experience difficulties.