Hide Chrome by default Client Web Part App
Can someone please point out if there is a way to turn off the Chrome by default in a Client Web Part App?
I would like the ChromeType to be set to "None" unless otherwise specified in the Web Part settings.
Keith Tuomi | Twitter: @itgroove_keith | Blog:
http://yalla.itgroove.net
Please click "Propose As Answer" if a post solves your problem or "Vote As Helpful" if a post has been useful to you.
Can you please try using
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<ClientWebPart Name="ClientWebPart" Title="SharePointApp1" Description="SharePointApp1 description" DefaultWidth="300" DefaultHeight="200">
<Content Type="html" Src="~appWebUrl/Pages/ClientWebPart.aspx?{StandardTokens}" />
<Properties>
<Property Name="ChromeType" WebCategory="Appearance" RequiresDesignerPermission="true" WebBrowsable="true" Type="enum" DefaultValue="None" PersonalizationScope="user" PersonalizableIsSensitive="false"></Property>
</Properties>
</ClientWebPart>
</Elements>
jaik
Similar Messages
-
Hide footer in List View web part
I've created a custom content type for a custom list (News stories.) I can add the custom list to my page as a list view web part and display only the latest article, but it also displays "1-1" at the bottom of the web part. I'm able to cycle through
the news stories by hitting "1-1" (changes to "2-2", etc...), but I'd like to have the option of taking it out completely.Found how to remove header as well.
<br><style><br
/> tr.ms-viewheadertr {<br /> display:
none<br
/> }<br /></style><br> -
Hide HTML Tags in DataView Web Part
Hi,
I've just added a Data View web part to a Sharepoint 2010 page. However, the data entries show up with inline HTML tags. How can I fix this, to get the web part to display column data without the HTML tags? Pls advise.Hope you have used the attribute "disable-output-escaping" and set it to true.
<xsl:value-of select="$field" disable-output-escaping="yes"/>
Thanks Sandy -
Project Summary Web Part - Can you change the display criteria
Hi
Is there any way I can change the display attributes of the project summary web part so instead of showing Late Tasks (as in the MS Project status indicator), I only show tasks that should have started or tasks that should have finished (so avoiding the
% complete test)
Thanks
SeanHi Sean,
Following on from Guillaume's excellent advice, you also also consider JavaScript or custom web part / app part if the default summary web part does not provide what you need. A couple of simple JavaScript examples can be found here:
Project Information post:
https://pwmather.wordpress.com/2014/06/10/supporting-post-for-projectserver-2013-projectonline-project-fields-displayed-on-project-site-javascript-jquery/
Project Information script:https://gallery.technet.microsoft.com/scriptcenter/Server-Information-ab10fd63
Project Milestones post:
https://pwmather.wordpress.com/2014/05/12/projectserver-project-milestones-on-the-project-site-projectonline-ps2013-sharepoint-javascript-jquery-sp2013-office365/
Project Milestones script:
https://gallery.technet.microsoft.com/scriptcenter/Server-Milestones-f8be71b8
Project on a page post:
https://pwmather.wordpress.com/2014/10/26/project-on-a-page-for-microsoft-projectonline-ps2013-javascript-jquery-office365-sharepoint/
Project on a page script:
https://gallery.technet.microsoft.com/scriptcenter/Online-Server-on-a-page-1b1f14f5
Test these on test sites first before using on production sites etc. to make sure they work for you.
Hope that helps
Paul
Paul Mather | Twitter |
http://pwmather.wordpress.com | CPS |
MVP | Downloads -
Read all projects within Project Online using web part Sharepoint
Hello all. Can we get data of all projects from Project Online in Sharepoint Site? So far as I understand we can get data of list like this:
SPWeb web = SPContext.Current.Web;
SPList issueList = web.GetList("https://tenant.sharepoint.com/sites/demo/Sample Project 1/Lists/Issues/AllItems.aspx");
Do you have any some good tutorial? I am new on web part Sharepoint.
Thanks in advance.Hello,
Yes you can, I would use the ProjectData API if you are not bothered about security (accessing all projects etc.) or if you want the data returned to be accessed controlled use the ProjectServer API. Examples below:
ODATA API (ProjectData):
<PWA site URL>/_api/ProjectData/Projects
JSOM REST API (ProjectServer):
<PWA site url>/_api/ProjectServer/Projects
Regarding guides, just search for SharePoint apps / App part / client web part. Some simple examples of using the APIs mentioned in JavaScript on the Project sites can be seen below:
https://gallery.technet.microsoft.com/scriptcenter/Server-Information-ab10fd63
https://gallery.technet.microsoft.com/scriptcenter/Server-Milestones-f8be71b8
https://gallery.technet.microsoft.com/scriptcenter/Online-Server-on-a-page-1b1f14f5
Paul
Paul Mather | Twitter |
http://pwmather.wordpress.com | CPS -
Updating List View Web Part property in page
I have a List View web part (In the page > Add web part > App > document library name). I need to update the TitleUrl property of this web part through C# code.
The SaveChanges() method below works for my visual web parts, but not for the List view webpart. I get an error saying: Exception has been thrown by the target of an invocation
webpartManager = myPage.GetLimitedWebPartManager(System.Web.UI.WebControls.WebParts.PersonalizationScope.Shared);webPart.TitleUrl = titleURL;webpartManager.SaveChanges(webPart);
I did a casting as below
XsltListViewWebPart listViewWebPart = (XsltListViewWebPart)webPart;listViewWebPart.TitleUrl = titleURL;webpartManager.SaveChanges(listViewWebPart);
(Please note that casting to ListViewWebpart instead of the XsltListViewWebpart gives a invalid cast exception, which is the reason why I cast it to XsltListViewWebpart)
But I get the error at SaveChanges() method.
An exception of type 'System.Reflection.TargetInvocationException' occurred in Microsoft.SharePoint.dll but was not handled in user code
The error description is as below
> at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[]
> arguments, Signature sig, Boolean constructor) at
> System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj,
> Object[] parameters, Object[] arguments) at
> System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags
> invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
> at System.Reflection.RuntimePropertyInfo.GetValue(Object obj, Object[]
> index) at
> Microsoft.SharePoint.WebPartPages.BinaryWebPartSerializer.DoesPersonalizedPropertValueMatchDefaultValue(SPPersonalizablePropertyEntry
> spPersonalizablePropertyEntry, Object value, Control defaultControl)
> at
> Microsoft.SharePoint.WebPartPages.BinaryWebPartSerializer.Serialize(PersonalizationScope
> scope, BinaryWebPartSerializerFlag binaryWebPartSerializerFlags,
> BinaryWebPartSerializerWriter writer) at
> Microsoft.SharePoint.WebPartPages.BinaryWebPartSerializer.Serialize(SerializationMode
> mode, BinaryWebPartSerializerFlag binaryWebPartSerializerFlags,
> SPSerializationBinderBase serializationBinder,
> BinaryWebPartSerializerWriter writer) at
> Microsoft.SharePoint.WebPartPages.BinaryWebPartSerializer.Serialize(SerializationMode
> mode, BinaryWebPartSerializerFlag binaryWebPartSerializerFlags,
> SPSerializationBinderBase serializationBinder) at
> Microsoft.SharePoint.WebPartPages.SPWebPartManager.SaveChangesCore(SPLayoutProperties
> layoutProperties, Boolean httpGet, Boolean saveCompressed, Boolean
> skipRightsCheck, Boolean skipSafeAgainstScriptCheck, WebPartTypeInfo&
> newTypeId, Byte[]& newAllUsersProperties, Byte[]&
> newPerUserProperties, String[]& newLinks) at
> Microsoft.SharePoint.WebPartPages.SPWebPartManager.SaveChangesInternal(SPLayoutProperties
> layoutProperties, Boolean skipRightsCheck, Boolean
> skipSafeAgainstScriptCheck) at
> Microsoft.SharePoint.WebPartPages.SPWebPartManager.SaveChanges(Guid
> storageKey) at
> Microsoft.SharePoint.WebPartPages.SPLimitedWebPartManager.SaveChanges(WebPart
> webPart) at
> WSP.ABC.ABC.ABCWindow.<>c__DisplayClass5.<ChangeWebPartProperties>b__4()
> at
> Microsoft.SharePoint.SPSecurity.<>c__DisplayClass5.<RunWithElevatedPrivileges>b__3()
> at
> Microsoft.SharePoint.Utilities.SecurityContext.RunAsProcess(CodeToRunElevated
> secureCode)
Tried casting back as below
webpartManager.SaveChanges((System.Web.UI.WebControls.WebParts.WebPart)listViewWebPart)
but still the error at SaveChange() is there.
AllowUnsafeUpdates is set to true within this block and code runs in elevated privileges.Hi Ahamed,
According to your description, there is an issue when you try to update the TitleUrl property of a List View Web Part.
For a better troubleshooting, I suggest you do as the followings:
1. Debug your code step by step and make sure every object and variable is valid.
2. Here is a code snippet about update web part property programmatically:
SPWeb web = SPContext.Current.Web;
SPFile file = web.GetFile(HttpContext.Current.Request.Url.ToString());
SPLimitedWebPartManager manager = file.GetLimitedWebPartManager(PersonalizationScope.User);
System.Web.UI.WebControls.WebParts.WebPart webPart = manager.WebParts[this.ID];
((UpdateMeWebPart)webPart).Message = “Test”;
try
web.AllowUnsafeUpdates = true;
manager.SaveChanges(webPart);
finally
web.AllowUnsafeUpdates = false;
Here is a detailed article for your reference:
http://jeremyknight.wordpress.com/2010/11/12/programmatically-update-web-part-properties/
Best Regards
Zhengyu Guo
TechNet Community Support -
Crystal Report Viewer in Sharepoint Page Viewer Web Part
In our SharePoint setup, we have a web part that contains links that either hides or shows three other web parts (page viewer web part). When entering the page, the first web part is shown and the other two are "hidden". Clicking on the links will toggle through these three web parts. Link 1 = Web Part One Visible, Web Part Two and Three Hidden. Link 2 = Web Part Two Visible, Web Part One and Three Hidden. Link 3 = Web Part Three Visible, Web Part One and Two Hidden.
Our problem involves the CrystalReportViewer. We have created a page that allows us to open the last successful instance of a report with the viewer. This works correctly when calling the link directly from IE. When we place this link in either the second or third web part, the report does not show. The viewer borders will appear but the report itself will not. If the .aspx is placed in the first part, the report appears without issue. We do not want the .aspx to be called by the first web part and need it to load in one of the other two. We can get the report to show in the other web parts if you right click on the empty space where the report should be and hit refresh.
What do we need to do to get the report to load correctly in either of the two web parts? We have looked at several options and can not get anything to work. We didnt have this issue when using BOE XI R2 with an .asp opening the reports. Please let me know if more info is needed. We are running BOE XI R3.1 currently.
ThanksWe havent tried that. We changed the link in the web part to access an html page that claims that the report is loading. It states in the html that if the page doesnt load to "click here" which redirects to the crystalreportviewer. Its a temp fix for it. One thing we are looking at is the 64 bit version of the Sharepoint integration kit. That may contain a reportviewer webpart.
Thanks for the reply.
Brian -
SharePoint 2007 custom (VS 2008) solution is upgraded to SharePoint 2013 using (VS 2012). I followed this approach.
I had created new empty project (solution) in SharePoint 2013 using (VS 2012) compiled and deployed successfully. All safe controls are registered in the web.config file. After deploying solution i Restarted IIS also, still getting this error. How to resolve
Error
Web Part Error: A Web Part or Web Form Control on this Page cannot be displayed or imported. The type could not be found or it is not registered as safe. Correlation ID: 5d217c9c-1827-7083-80cd-e095a30befee.
Show Error Details
Hide Error Details
[UnsafeControlException: A Web Part or Web Form Control on this Page cannot be displayed or imported. The type could not be found or it is not registered as safe.]
at Microsoft.SharePoint.ApplicationRuntime.SafeControls.GetTypeFromGuid(Boolean isAppWeb, Guid guid, Guid solutionId, Nullable`1 solutionWebId, String assemblyFullName, String typeFullName, Boolean throwIfNotSafe)
at Microsoft.SharePoint.WebPartPages.SPWebPartManager.CreateWebPartsFromRowSetData(Boolean onlyInitializeClosedWebParts)
<menu class="ms-hide" id="MSOMenu_WebPartMenu"><ie:menuitem id="MSOMenu_Minimize" text="Minimize" title="Collapse this web part." type="option"></ie:menuitem><ie:menuitem
id="MSOMenu_Restore" text="Restore" title="Expand this web part." type="option"></ie:menuitem><ie:menuitem id="MSOMenu_Close" text="Close" title="Close this Web Part. You can still
find it under closed Web Parts section in the insert ribbon. These changes will apply to all users." type="option"></ie:menuitem><ie:menuitem iconsrc="/_layouts/15/images/DelItem.gif" id="MSOMenu_Delete" text="Delete"
title="Delete this Web Part from the page. These changes will apply to all users." type="option"></ie:menuitem><ie:menuitem type="separator"></ie:menuitem><ie:menuitem iconsrc="/_layouts/15/images/EditItem.gif"
id="MSOMenu_Edit" text="Edit Web Part" title="Change properties of this shared Web Part. These changes will apply to all users." type="option"></ie:menuitem><ie:menuitem id="MSOMenu_Connections"
text="Connections" title="Show connections options for this Web Part. These changes will apply to all users." type="option"></ie:menuitem><ie:menuitem type="separator"></ie:menuitem><ie:menuitem
id="MSOMenu_Export" text="Export..." title="Export this Web Part. These changes will apply to all users." type="option"></ie:menuitem><ie:menuitem iconsrc="/_layouts/15/images/HelpIcon.gif" id="MSOMenu_Help"
style="display:none;" text="Help" type="option"></ie:menuitem> </menu>Hi Ashok,
According to your description, my understanding is that you got an error after you re-built a SharePoint 2007 solution with VS2012, and deployed it.
Make sure the Namespace and Type Name are consistent across all files where indicated. Also with matching case sensitivity. Verify web.config file and assembly in GAC or virtual directory bin folder in post deployment.
More information, please refer to the link below:
http://roykimsharepoint.wordpress.com/2013/04/27/classic-web-part-errors/
Here is a similar post for you to take a look at:
http://stackoverflow.com/questions/1689707/sharepoint-web-part-type-could-not-be-found-registered-as-safe
I hope this helps.
Thanks,
Wendy
Wendy Li
TechNet Community Support -
Web Part specific DOM Manipulation. Two identical Script Editor Web Part code blocks.
We have a script editor web part with javascript that references some jquery libraries. The code creates web part properties and hides DIV tag in the web part based on some conditions. It works great until I try to place the same exact
web part / code block on the same page twice. The way we are rolling this out we don' t users messing the code and we want the WP properties UI to be identical on both Web Parts.
Given all this.. is it possible with jquery code to perform Web Part specific DOM manipulation without any conflict with other similar Web Parts and Script editor code blocks on the page? Possible to dynamically change DIV Tag IDs, Jquery Variables
and WP Properties to have the unique web part GUID?
Possible? Any ideas would be appreciated.
demo of issue here:
http://screencast-o-matic.com/watch/coeUlneNT6
Code in question:Hi,
I suggest you debug your code using IE F12 developer tools. Based on your description, you can try to add some conditions base on the web part ID.
Or you can share your full code for further research.
Best Regards,
Dennis Guo
TechNet Community Support
Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
[email protected] -
List View Web Part - Default Chrome Setting
In our environment, the "Default" chrome setting does not display the title or the border on our list view pages. We have tried Oslo and Seattle master pages and neither displays this to the end user. We do see the title in Edit mode, but
not once the page is saved. If we switch it to Title Only, it does display.
Is this the correct behavior? If so, is there an easy way to change the chrome setting to "Title Only" for the list view web parts in one particular web application when a view is created?That is the default behavior. normally, the listview web part is on a page where the title of the library is displayed on the page, which would make it redundant to display it in the web part only. I don't know any way to change this behavior
by default when creating a new view.
Paul Stork SharePoint Server MVP
Principal Architect: Blue Chip Consulting Group
Blog: http://dontpapanic.com/blog
Twitter: Follow @pstork
Please remember to mark your question as "answered" if this solves your problem. -
Provider Hosted App not listed in the App Part or Web Part
What I have done:
I have created developer site collection
in office 365
I have created a provider app in visual
studio, modified appmanifest.xml with the client id, client issue (from developer site) and provided targeted domain
I have deployed web application from the
visual studio into Azure it can be accessible default page
I have published App project into Azure
What I tried:
I have confiured app catalog in the SP 2013
office 365 developer site Central Admin where I can register my apps
I have registered my appfile in the catalog
site collection
I have created another site collection with
team site template and added the app there
I created a web part page and wanted to
insert this app as a web pat in the page it is not appearing/coming in the app part to insert
What I wanted now:
I wanted to insert this app in the site
web part page of any SharePoint 2013 site collection
App
part listed in the Site Content but it is not listed in the web part page " Web part or App Part" containers to insert...
Am I missing something? any one encountered same issue? Any help appreciated.
Regs,
MadhuHi Madhu,
Once you deploy your App, The App will get deployed to the App web rather host web. That is reason you will not be able to find the app either in App part or webpart section of host web.
http://msdn.microsoft.com/en-us/library/fp179925.aspx#IsolatedDomain
My Blog- http://www.sharepoint-journey.com| Twitter
If a post answers your question, please click "Mark As Answer" on that post and "Vote as Helpful -
SharePoint 2013 Client Side People Picker in Content Editor Web Part
Has anyone tried to use the client side people picker in a content editor web part? I have successfully got it to work in IE by adding all the script references and initialize function to the content editor web part. Now the strange part is, the people
picker doesn't render in other browsers, I tried in Chrome, Safari, and Firefox. Any ideas?Below can be used to create people picker in CEWP
<asp:content contentplaceholderid="PlaceHolderAdditionalPageHead" runat="server">
<script src="https://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.6.2.min.js" type="text/javascript"></script>
<script type="text/javascript" src="../Apps/_layouts/15/clienttemplates.js"></script>
<script type="text/javascript" src="../Apps/_layouts/15/clientforms.js"></script>
<script type="text/javascript" src="../Apps/_layouts/15/clientpeoplepicker.js"></script>
<script type="text/javascript" src="../Apps/_layouts/15/autofill.js"></script>
<script type="text/javascript" src="../Apps/_layouts/15/sp.js"></script>
<script type="text/javascript" src="../Apps/_layouts/15/sp.runtime.js"></script>
<script type="text/javascript" src="../Apps/_layouts/15/sp.core.js"></script>
<script type="text/javascript">
<!-- Add your CSS styles to the following file -->
<link rel="Stylesheet" type="text/css" href="../SiteAssets/PeoplePicker/App.css"/>
<!-- Add your JavaScript to the following file -->
// Run your custom code when the DOM is ready.
$(document).ready(function () {
// Specify the unique ID of the DOM element where the
// picker will render.
initializePeoplePicker('peoplePickerDiv');
// Render and initialize the client-side People Picker.
function initializePeoplePicker(peoplePickerElementId) {
// Create a schema to store picker properties, and set the properties.
var schema = {};
schema['PrincipalAccountType'] = 'User,DL,SecGroup,SPGroup';
schema['SearchPrincipalSource'] = 15;
schema['ResolvePrincipalSource'] = 15;
schema['AllowMultipleValues'] = true;
schema['MaximumEntitySuggestions'] = 50;
schema['Width'] = '280px';
// Render and initialize the picker.
// Pass the ID of the DOM element that contains the picker, an array of initial
// PickerEntity objects to set the picker value, and a schema that defines
// picker properties.
this.SPClientPeoplePicker_InitStandaloneControlWrapper(peoplePickerElementId, null, schema);
// Query the picker for user information.
function getUserInfo() {
// Get the people picker object from the page.
var peoplePicker = this.SPClientPeoplePicker.SPClientPeoplePickerDict.peoplePickerDiv_TopSpan;
// Get information about all users.
var users = peoplePicker.GetAllUserInfo();
var userInfo = '';
for (var i = 0; i < users.length; i++) {
var user = users[i];
for (var userProperty in user) {
userInfo += userProperty + ': ' + user[userProperty] + '<br>';
$('#resolvedUsers').html(userInfo);
// Get user keys.
var keys = peoplePicker.GetAllUserKeys();
$('#userKeys').html(keys);
</script>
</asp:content>
<asp:content contentplaceholderid="PlaceHolderMain" runat="server">
<div id="peoplePickerDiv"></div>
<div>
<br/>
<input type="button" value="Get User Info" onclick="getUserInfo()"></input>
<br/>
<h1>User info:</h1>
<p id="resolvedUsers"></p>
<h1>User keys:</h1>
<p id="userKeys"></p>
</div>
</asp:content>
Vishnu -
Hello all,
I have what so far appears to be a fairly unique problem. We are running a multilingual SharePoint 2010 environment with English as the default language and French as the secondary. We have setup the sites in a variance relationship, but the
issue I am discussing happens outside of a variant as well.
We have created a library outside the variant (but within the collection) that the two sites must share. A list view web part was created via Designer to add to each site to provide a quick view into the list. If we are in the libary and switch
to French, then update the column label it will remember the setting (because of the resource file) and maintain it as the language is flipped back and forth. Where it doesn't work is as a web part in a variant or where the language is different.
If the language is different, the out of the box columns work find, but the custom columns (all site columns not library\list columns) remain as the english label. It doesn't matter if within a variant or outside with the browser language changed.
It always reverts back to English. It's like it isn't using the same resource file that was used in the list itself.
I created a custom view and modified it with xslt as per
http://sharepoint.stackexchange.com/questions/50004/how-to-change-column-title-for-a-view-but-not-modify-the-list but this only worked within the list and did not occur in the list view either.
I can't be the first that has come across it, either I am not performing my searches properly, no one has ever documented a fix for this or this is something we just can't fix with OOTB tools. That's the other thing, the solution has to be accomplised
OOTB or with minor client side changes. I can't fire up Visual Studio because they are piloting Office 365 and have put a "No custom code" mandate on for migration.
Thank you all in advance.Ok, I have come up with a solution. I edited the XSLT for the web part on the page. I did the following:
1. Create the variants in the Site Ccollection
2. Create the library outside of the variants.
3. Add all the columns you require for the library. It is very important all the columns are there before you move on.
4. Create a French and English view.
5. Create the list view web part via designer.
6. Add the list view web part to each site selecting the appropriate view to use.
7. Edit the page in SharePoint Designer 2010.
8. Place cursor in the column you wish to modify.
9. Click Design in the List View Tools on the ribbon.
10. Then click Customize XSLT and select Customize Item. Select this option otherwise you will generate a **LOT** of unnecessary XSL code.
11. You are looking for a piece that resembles the following:
<xsl:with-param name="fieldtitle">
<xsl:value-of select="@DisplayName"/>
</xsl:with-param>
12. Modify it by typing in the actual column name you want. You should end up with something like this:
<xsl:with-param name="fieldtitle">
New Column Name.
</xsl:with-param>
13. Now, for this page only, the column will be renamed.
There are some caveats:
1. Doesn’t appear to work in a publishing portal. I think this has to do with how SP stores the pages in this case. In a publishing portal you can only modify the page layout which won’t work as we need to modify the content.
2. If you add another column, you will need to repeat the XSLT modification
Anyways, I hope this helps out any others with the same issue or need as I had. -
Hi All,
I have set "Oslo.Master" as the The default Master Page for the site. I have a page with a List View web part and an InfoPath Web Part connected. When the page loads is it displayed correctly. However, when a record
is selected and the infopath web part is updated, the content on the page shifts (indents) to the right.
Is there something I am missing? Does anyone know how to correct this?
Thanks in Advance!Hi Dwayne,
I could reproduce this, as a workaround, we can use javascript code as below to hide the element in the following image.
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script>
$(document).ready(function(){
$('#contentBox').prev().hide();
</script>
Thanks
Daniel Yang
TechNet Community Support -
Content Search Web Part not work for Office Web Apps
Hi ,
In Content Search Web Part word documents are not able to open in browser,but in document library its working.
Office Web Apps not work in Content search web part
Please help me
Regards
SachinBelow is the display template to open the document in OWA.
<html xmlns:mso="urn:schemas-microsoft-com:office:office" xmlns:msdt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882">
<head>
<title>AdSpace Picture on top, 3 lines on bottom</title>
<!--[if gte mso 9]><xml>
<mso:CustomDocumentProperties>
<mso:TemplateHidden msdt:dt="string">0</mso:TemplateHidden>
<mso:ManagedPropertyMapping msdt:dt="string">'Picture URL'{Picture URL}:'PublishingImage;PictureURL;PictureThumbnailURL','Link URL'{Link URL}:'Path','Line 1'{Line
1}:'Title','Line 2'{Line 2}:'Description','Line 3'{Line 3}:'','FileExtension','SecondaryFileExtension','ContentTypeId','ServerRedirectedURL'</mso:ManagedPropertyMapping>
<mso:MasterPageDescription msdt:dt="string">This Item Display Template will show a 304x100 picture of the item on top. The title and the default item description will display to the bottom of the picture with an additional line that is available
for a custom managed property.</mso:MasterPageDescription>
<mso:ContentTypeId msdt:dt="string">0x0101002039C03B61C64EC4A04F5361F385106603</mso:ContentTypeId>
<mso:TargetControlType msdt:dt="string">;#Content Web Parts;#</mso:TargetControlType>
<mso:HtmlDesignAssociated msdt:dt="string">1</mso:HtmlDesignAssociated>
<mso:_dlc_DocId msdt:dt="string">ZRMVMDDDEAE7-1-215</mso:_dlc_DocId>
<mso:_dlc_DocIdItemGuid msdt:dt="string">583b0835-32ff-4d1c-983f-b6ff4a0ef956</mso:_dlc_DocIdItemGuid>
<mso:_dlc_DocIdUrl msdt:dt="string">http://sp2013-dev-6:7000/sites/adspace/_layouts/15/DocIdRedir.aspx?ID=ZRMVMDDDEAE7-1-215, ZRMVMDDDEAE7-1-215</mso:_dlc_DocIdUrl>
<mso:HtmlDesignConversionSucceeded msdt:dt="string">True</mso:HtmlDesignConversionSucceeded>
<mso:HtmlDesignStatusAndPreview msdt:dt="string">http://sp2013-dev-6:7000/sites/adspace/_catalogs/masterpage/Display Templates/Content Web Parts/Item_PictureOnTop.html, Conversion successful.</mso:HtmlDesignStatusAndPreview>
</mso:CustomDocumentProperties>
</xml><![endif]-->
</head>
<body>
<!--
Warning: Do not try to add HTML to this section. Only the contents of the first <div>
inside the <body> tag will be used while executing Display Template code. Any HTML that
you add to this section will NOT become part of your Display Template.
-->
<script>
$includeLanguageScript(this.url, "~sitecollection/_catalogs/masterpage/Display Templates/Language Files/{Locale}/CustomStrings.js");
</script>
<!--
Use the div below to author your Display Template. Here are some things to keep in mind:
* Surround any JavaScript logic as shown below using a "pound underscore" (#_ ... _#) token
inside a comment.
* Use the values assigned to your variables using an "underscore pound equals"
(_#= ... =#_) token.
-->
<div id="Item_PictureOnTop">
<!--#_
var useWACUrl = !$isEmptyString(ctx.CurrentItem.ServerRedirectedURL);
if(ctx.ScriptApplicationManager && ctx.ScriptApplicationManager.states){
useWACUrl = (useWACUrl && !ctx.ScriptApplicationManager.states.openDocumentsInClient);
var appAttribs = "";
if(!useWACUrl)
if (!$isEmptyString(ctx.CurrentItem.csr_OpenApp)) { appAttribs += "openApp=\"" + $htmlEncode(ctx.CurrentItem.csr_OpenApp) + "\"" };
if (!$isEmptyString(ctx.CurrentItem.csr_OpenControl)) { appAttribs += " openControl=\"" + $htmlEncode(ctx.CurrentItem.csr_OpenControl) + "\"" };
var url = ctx.CurrentItem.csr_Path;
if($isEmptyString(url)){
if(useWACUrl)
url = ctx.CurrentItem.ServerRedirectedURL;
} else {
url = ctx.CurrentItem.Path;
var encodedId = $htmlEncode(ctx.ClientControl.get_nextUniqueId() + "_pictureOnTop_");
var linkURL = $getItemValue(ctx, "Link URL");
linkURL.overrideValueRenderer($urlHtmlEncode);
var iconURL = Srch.ContentBySearch.getIconSourceFromItem(ctx.CurrentItem);
var line1 = $getItemValue(ctx, "Line 1");
var setLineHeightRenderer = function(valueInfoObj)
if(!$isNull(valueInfoObj) && !valueInfoObj.isEmpty)
if(!$isNull(valueInfoObj.defaultValueRenderer))
return valueInfoObj.defaultValueRenderer(valueInfoObj);
else
return valueInfoObj.toString();
else
return " ";
var line2 = $getItemValue(ctx, "Line 2");
line2.overrideValueRenderer(setLineHeightRenderer);
var line3 = $getItemValue(ctx, "Line 3");
line3.overrideValueRenderer(setLineHeightRenderer);
var pictureURL = $getItemValue(ctx, "Picture URL");
var pictureId = encodedId + "picture";
var pictureMarkup = Srch.ContentBySearch.getPictureMarkup(pictureURL, 304, 100, ctx.CurrentItem, "cbs-pictureOnTopImg", line1, pictureId);
var containerId = encodedId + "container";
var pictureLinkId = encodedId + "pictureLink";
var pictureContainerId = encodedId + "pictureContainer";
var dataContainerId = encodedId + "dataContainer";
var line1LinkId = encodedId + "line1Link";
var line1Id = encodedId + "line1";
var line2Id = encodedId + "line2";
var line3Id = encodedId + "line3";
_#-->
<div class="top-content-box" id="_#= containerId =#_" data-displaytemplate="ItemPictureOnTop">
<div class="top-content-img" id="_#= pictureContainerId =#_">
<a class="cbs-pictureImgLink" href="_#= $urlHtmlEncode(url) =#_" title="_#= $htmlEncode(line1) =#_" target="_blank" id="_#= pictureLinkId =#_">
_#= pictureMarkup =#_
</a>
</div>
<h3 id="_#= line1Id =#_"><a class="cbs-pictureOnTopLine1Link" target="_blank" href="_#= $urlHtmlEncode(url) =#_" title="_#= $htmlEncode(line1) =#_"
id="_#= line1LinkId =#_"> _#= line1 =#_ </a></h3>
<span class="content-date" title="_#= $htmlEncode(line2) =#_" id="_#= line2Id =#_"><img class="cbs-Thumbnail" src="_#= $urlHtmlEncode(iconURL) =#_"
alt="_#= $htmlEncode(line1.defaultValueRenderer(line1)) =#_" id="_#= pictureId =#_" />_#=line2=#_</span>
</div>
</div>
</body>
</html>
Basically,ctx.CurrentItem.ServerRedirectedURL is calculated by a managed property ServerRedirectedURL which needs to be included in the display template.
Problem solved.
Nehal Bhandari,ATL, Nagarro Softwares
Maybe you are looking for
-
Disable a test socket during execution (Batch Mode)
We are running a Batch Model with Batch Synchronization. I am wondering if it is at all possible to totally disable one or more of the test socket during execution. I know that the opening screen allows you to choose which sockets are active,
-
Achieving iPhone Native Look-and-Feel
Im currently doing an Iphone tutorial for my final year project. Here's the link for the tutorial that I am doing http://www.oracle.com/technology/pub/articles/huang-iphone.html I have no idea how to start doing the second part of the tutorial; Achie
-
IN UPDATE TASK problem with CRM_ORDER_SAVE
Hello, I'm trying to write a program to update one field on CRM order documents, but i need to run it in background with update task. - I created a function module and called CRM_ORDER_MAINTAIN and CRM_ORDER_SAVE functions in this function module con
-
Revaluation Doc posted in MIRO
Hello SAP Gurus, We have an invoice receipt w/c generated 2 accounting documents. The first accounting doc. is the usual doc w/ vendor line item posting while the other acct. doc contains purely GL accounts. Based on our investigation, these G/L acco
-
Tracking down a periodic delay in a cRIO
Hi Folks, I am having trouble with a mystery process delaying my main loop in a RT system. I am looking for advice on how to debug this problem. Thanks! I have an industrial control project in LabVIEW 2009 SP1. It is running in a 9014 cRIO. The main