Tag Info

Hot answers tagged

4

Managed to get it working - had to do this in the XSL: <script language="javascript" defer="true"> <xsl:comment> <![CDATA[ $(document).ready( function() { alert('boo'); }); ]]> </xsl:comment> </script>


3

Dave's solution fixes your problem with assumption your data always contains a |. If you want to make your solution a little more robust you could also write this: <xsl:value-of select="substring-before(concat(@Department, '|'), '|')" disable-output-escaping="yes"></xsl:value-of></a> This will also work in the case that the string ...


3

Try using the XSLT substring-before function: <xsl:value-of select="substring-before(@Department,'|')" disable-output-escaping="yes">


3

How to resize the image proportionally via CSS Lets assume the following xsl is used for image rendering in ItemStyle.xsl: <img class="image" src="{$SafeImageUrl}" title="{@ImageUrlAltText}"> </img> then the following Css could be used to resize the image proportionally: img.image { width:150px; height: auto; }


3

The format of the Image with formatting and constraints for publishing is already with the image HTML tags. Ex.: <img alt="" src="Docs/Image.png" style="border: 0px solid" /> So you could try to do the following: <xsl:value-of select="substring-before(substring-after(@ImageField, 'src=&quot;'), '&quot; style')" />


3

Just add the anchor tag with a dynamic link to the bottom of your itemstyle xsl and then wrap it with an xsl:if statement to check the position to see if the last list item is last. <xsl:if test="position() =last()"> <a href="link.aspx">View all items</a> </xsl:if> If you want to make the href dynamic, find a source for the link ...


2

Dean, What you're probably seeing is a result of the complex style structure of SharePoint. Often times, instead of seeing class="theclass" you'll see something like class="firstclass secondclass thirdclass", etc. "firstclass", "secondclass" and "thirdclass" get reused on multiple elements, not just the specific element you're trying to change, so if you ...


2

Not sure if this will help but it certainly dives into the default CSS used across SharePoint. Heather Solomon


2

You have to disable output escaping by adding disable-output-escaping="yes" to the element. It is covered in this post on MSDN. http://blogs.msdn.com/b/ben_hickman/archive/2009/05/22/content-query-web-part-example.aspx


2

In a similar situation for me the key was to set "defer" parameter. I think the right way is <script type="text/javascript" defer="defer"> </script>


2

I would look at this article as a starting point. The long an short of it is that you can go ahead and control what uses see in the Rich Text Editor when adding content to a page. Give it a look Link


2

After editing the master you did the check in publishing the major version?


2

It really depends on how your SharePoint site is branded. An even more necessary dependency is weather or not it should be flexible for both desktop and mobile-device diplay. In which case I recomment making 2 stylesheets or use CSS Media Query (if you're a rather experienced SharePoint brander). I usually disregard the default SharePoint masterpages and ...


1

There is a blog post covering this at http://paylord.wordpress.com/2012/09/28/cqwp-and-xslt-part-1/. Essentially you will need to edit the web part in SharePoint Designer. If you need to reuse it then you can export and import to the web part gallery and it can then be added to pages like any other web part.


1

Since XSLT transformation in SharePoint is invoked on the server side, there's no way to execute JavaScript code before XSLT transformation. How to pass the current Web Url in Content Query web part I assume in your scenario the current site url should be passed into ItemStyle.xsl, there is another way how it could be accomplished. Specify ...


1

This article might give you a pin-point at what you need to do to achieve this. By using jQuery and ECMAscript in addition to the XSLT this should be possible. Haven't tried it myself, but it looks promising. I hope it helps! :) An alternative would be to create a custom CQWP, inheriting the sharepoint CQWP and then provide the userprofile information ...


1

Use: <option value='{$LinkTarget1}'> <xsl:value-of select="@Title"/> </option>


1

Try this: <xsl:variable name="date" select="ddwrt:FormatDate(string(@EventDate), 1033, 1)"/> <xsl:variable name="day" select="format-number(substring-before(substring-after($date,'/'),'/'),'00.')"/> <xsl:variable name="month" select="format-number(substring-before($date,'/'),'00.')"/> <xsl:variable name="year" ...


1

You'd have to update the ItemXslLink on every single one of them - It can be done programmatically, but then you have to run a console job each time an CQWP is inserted on any page anywhere on the site. The best way secure that CQWPs you insert in the future have your custom ItemStyle.xsl, is by downloading an already inserted CQWP, open it and change it's ...


1

You'll have to set the wb.ItemStyle with the item styles template name. Examples: wb.ItemStyle = "Default"; wb.ItemStyle = "ImageLeft"; It does not understand the display names of the item styles. MSND page explaining the different ItemStyles.


1

In order to provide custom ItemStyle.xsl for CQWP the ItemXslLink property should be specified. There are several ways how to specify this property: update web part via SharePoint Designer provision web part. Follow for example this article update web part on page (using SharePoint OM, for example see How to programmatically update content in a SharePoint ...


1

If you want to have just an additional Style to choose from for your CQWP you should not add another ItemStyle.xsl, but try to add another xsl-template to the existing itemstyle.xsl (make a backup before playing with the original one. You just have to copy&paste an existing template like <xsl:template name="TitleOnly" ...


1

Now add a fresh CQWP to your page and then export it. Save the generated file and open it in notepad. Locate property ItemXslLink and replace it with following: <property name="ItemXslLink" type="string">/Style Library/XSL Style Sheets/CustomItemStyle.xsl</property> Locate property ItemStyle and replace it with following:<property ...


1

If you insert the default CQWP throught the UI it will automatically use the ItemStyle.xsl from the Style Library by default. In order to do what you want to do, you'd have to create your own CQWP and add some EditorPart or Toolpart to it in which you include the functionality to be able to choose whatever XSLT file for itemstyles you want. Here's an ...


1

Noticed a post on MSDN related to this very issue. His workaround sounds similar to what you've done, except he makes copies of files into a sub dir: create a new Folder under XSL Style Sheets and just get the copy of both ContentQueryMain.xsl and ItemStyle.xsl to the newly created folder. After that [make changes] for BeginList, EndList, BeginListItem ...


1

Actually it might be easier (also best practice - to avoid overrides by CU, Service Packs, etc.) to have a copy of that file with your own style already in, and provision it via a Module as part of your feature! CQWP is using multiple XSL files (3 actually) stored in the Style Library at the site collection level. You can of course chose to deploy your own ...


1

You could attempt to add your own JavaScript to each page that overrides the "SP.UI.ModalDialog.showModalDialog" function. Something like: SP.UI.ModalDialog.showModalDialog = function (options) { } Don't know how reliable it would be, but it is an option.


1

Somebody already had the same question, check the following URL: Change XSLT for Discussion Board, deploy via VS2010 Regards, Estruyf


1

This is only a work-around, but as I fear it may be what I need to do if I'm only using the ItemStyle.xsl ... I added a new text column to my custom list called Link Text. I then updated the ItemStyle.xsl from the version in the original question to the following: <a href="{$SafeLinkUrl}"> <xsl:value-of select="@LinkText" /> </a> ...


1

Did you try: <xsl:variable name="AssistPrinEmail" select="@AssistantPrincipal1Email"/> To make sure the slots are working without the 'substring-after' selection?



Only top voted, non community-wiki answers of a minimum length are eligible