question

TanzimShaikh-9259 avatar image
0 Votes"
TanzimShaikh-9259 asked MichaelHan-MSFT answered

How can I click on one of the image or document generate using script editor to bring up another page or webpart in SharePoint 2019?

Hello,
We are using SharePoint 2019 and we have a script editor webpart that generates images from PDF book.
Now we want that when the user clicks on any of the book, a page or a section or a webpart should open for him to enter the Ratings and Comments on that book.

Can we achieve this through coding. Please help.
Thank you

office-sharepoint-server-development
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

TanzimShaikh-9259 avatar image
0 Votes"
TanzimShaikh-9259 answered MichaelHan-MSFT converted comment to answer

Hello Michael,

It alerts each book name when I click on the image.
However, I need the comments page to be opened while we are on the same page and the books are in the background. There the user will enter the comment and rating for the book and then close the page (you know like a people picker page, a small window opens in the background and then when done it closes and we return to the previous page).

Note: It is taking me time to post the replies because I am facing the error "Access denied. You don't have permission to access ..." whenever I clicks on the "Post Your Answer" button.

Thank you

· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@TanzimShaikh-9259,

What's your comment page like, is it a list new form page?

For the issue you cannot post the code in the reply, you could submit the feedback here: https://docs.microsoft.com/en-us/answers/content/idea/list.html

As a workaround, you could put your code in a txt file and attach it in the reply.

0 Votes 0 ·

Thank you for the feedback link and for the tip on sending the code.

I managed to get the page from the document library "Edit.aspx" for the particular book so the rating issue has been resolved. Now for the comments page, yes I have one list called "Comments" because it allows "Append" settings for the multi text. So I am trying to bring this page along with the ratings. I do not know what shall I do. I was thinking that if I can click on the image to select it and then have 3 buttons on the top i.e. "Open" "Rating" "Comment", clicking on each will do the job accordingly.

What is your opinion Michael?


Regards

0 Votes 0 ·

@TanzimShaikh-9259,

Why don't you just create a multi text for comments in the document library directly? Thus you don't need the Commnets list. And it's a good choice to put the rating and comments in the same place(document library). You just need to get the document library edit form page "Edit.aspx" for the specific book so both comments and rating issues will be resolved.

Another workaround, you could create a html form with rating and comments. Once the user submit the form. Use JSOM or Rest api to update the list item for the book.

0 Votes 0 ·
Show more comments
MichaelHan-MSFT avatar image
0 Votes"
MichaelHan-MSFT answered

Hi @TanzimShaikh-9259,

You could use js code to add a onclick event on the images, when the image is clicked, call the function to open a page for the user to enter the Ratings and Comments on that book.

For example:

128115-image.png


If an Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.



image.png (6.8 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

TanzimAftab-3194 avatar image
0 Votes"
TanzimAftab-3194 answered

Hello Michael,
I am not able to post replies.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

TanzimShaikh-9259 avatar image
0 Votes"
TanzimShaikh-9259 answered

I think there is a problem in the website accepting any code. I am not able to post any reply when I am using code sample button with the reply.
Please find below the image that was trying to post in my previous reply:

128615-image-for-microsoft-reply.png



5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

MichaelHan-MSFT avatar image
1 Vote"
MichaelHan-MSFT answered

@TanzimShaikh-9259,

Ok, then you could put the comments and ratings in a same list "Comments". For rating, you could enable rating feature in list settings >rating settings.

And you need to set the title of the list item to be the book name.

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@MichaelHan-MSFT

An excellent idea. I shall mark it as the answer.

Thank you

0 Votes 0 ·