Don’t waste time. Go!
(Pictures are in German, if you want them in english as well, let us know)!
Requirement:
Each team / teamsite (http://sp13/teams/it) should have the option to create a news element.
This element has the option where it should be shown. The user has to select this via a dropdown with the values:
- Workspace (sp13/teams/information-technology-workspace)
- Teamübergreifend (sp13/teams/information-technology-workspace) + (sp13/teams)
- Shout (sp13/teams/information-technology-workspace) + (sp13/teams) + (sp13/)
Also each element has to have it’s own pictureURL + pictureURLFavicon field value depending on the department. This should be filled out automatically.
Futhermore I need the shout items in one list so I can get them with REST and modify the view afterwards.
Problem:
If I want to work with SharePoint Designer 2013 Workflows it is quite hard to do all those workflows for all teamsites.
Also it is difficult to get the element updated if I copy the element in all there lists.
My Solution:
I have just ONE list which is called news and created at sp13/ with all the columns I need.
Next I go to the workspace site (teamsite) sp13/teams/information-technology-workspace and add a content editor to the page. Edit the source and added the following script:
Script:
<script type="text/javascript"> var options; function openModalDialog(url) { options = SP.UI.$create_DialogOptions(); options.width = 600; options.height = 650; options.title='News posten'; options.url = url+"?IsDlg=1"; options.dialogReturnValueCallback = Function.createDelegate(null, CloseCallback); //SP.UI.ModalDialog.showModalDialog(options); SP.SOD.execute('sp.ui.dialog.js', 'SP.UI.ModalDialog.showModalDialog', options); } function CloseCallback(result, target) { location.reload(true); //window.location.href = document.URL; } </script> <a onclick="openModalDialog('https://sp13/lists/news/NewForm.aspx');" href="#"><img src="/PublishingImages/icons/plus32_32.png" alt="" style="margin: 5px;"/></a>
With this, I am able to create from the workspace site (the teamsite) a news item in the news list based at sp13/ in a modal dialog!
If we check now the news list we can see, that there is the element and also the workflow fired.
(Simple workflow, just checks the team field and depending on that sets the PicutreURL, PictureURLFavicon and if the link is empty set’s that to the teamsite)
Also I am showing the news item based on the searchresults webpart on my teamsite (filterd by team, crawled property “team” -> managed property “RefinableString00”)
Now if we create a second item and want to publish it to the “Teamübergreifend” we select that in the form.
and it is also added to the news list. You see that the empty link was filled out by the workflow.
We created a second view where we only show the items, if the column “Veröffentlichen” (publish) is “Teamübergreifend” and exported the news list so we can import it in the sp13/teams site. How to export and import an webpart? Check out my other blog post.
Finally the last requirement is to create a news item which has to be shown also on the startpage. So we create a new one and select “shout”.
It also goes into the news list.
Now we use this blog post (Facebook-Like-Button-Style), to display the items which are “shout” items in this kind of view:
At the start page:
And if you click onto the icon or on a other shout news you will be redirected to the shout news overview page which looks like that:
That’s it. One list, three places, not that much to do! I like it.
If you do too, comment it, like it, share it and don’t be afraIT to write me if you have questions.