Tag Info

Hot answers tagged

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

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

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

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

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

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

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

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

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

I have worked with the promoted links webpart and the tile view myself, but don't have example code here with me. What you will have to do may very well be possible by css (actually, try that first!) but from experience I know the tile view is very very rigid. What you want to do is just move the text with CSS. Use some developer toolbar to see the ...


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

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

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> ...



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