Show the Read more link in the list view webpart using Client side Rendering

Hi,
I have a share point list name as Team.It contains two columns like Role(single line of text) and Name( people and picker).
I want the display the list view webpart like below format using JS Link/Client side rendering concept.
If list contains more than 3 items (display like this)
>TeamMemberName1
>TeamMemberName2
>TeamMemberName3
Readmore... (Read more link should expand all the team members)
If list contains more than 3 items (display like this)
>TeamMemberName1
>TeamMemberName2
>TeamMemberName3
Could you please provide the code.It is very urgent for me.
Thanks for the help!!!

(function () {
    debugger;
    //Create our Namespace object to avoid polluting the global namespace
    var pfh = pfh || {};
    //Define our Header Render pattern
    pfh.renderHeader = function (ctx) {
        var headerHTML = "<ul>";
        return headerHTML;
    pfh.renderFooter = function (ctx) {
        //Define any footer content here.
        var footerHTML = "</ul>";
        return footerHTML;
    pfh.CustomItem = function (ctx) {
        var itemHTML = "<li>" + ctx.CurrentItem.TeamMemberName[0].title; + "</li>";
        return itemHTML;
    //Define any code/function that needs to be run AFTER the page has been completed and the DOM is complete.
    pfh.PostRenderCallback = function (ctx) {
    //Define the function that will register our Override with SharePoint.
    pfh.RegisterTemplateOverride = function () {
        var overrideCtx = {};
        overrideCtx.Templates = {};
        overrideCtx.Templates.Header = pfh.renderHeader;
        overrideCtx.Templates.Footer = pfh.renderFooter;
        overrideCtx.Templates.Item = pfh.CustomItem;
        overrideCtx.onPostRender = [pfh.PostRenderCallback(ctx)];
        overrideCtx.BaseViewID = 98; //Note: We're using BaseView ID 99 to match our override below
        overrideCtx.ListTemplateType = 100;
        SPClientTemplates.TemplateManager.RegisterTemplateOverrides(overrideCtx);
    //Now we load in our override to ensure that this Override is only applied to the intended ListView
    ExecuteOrDelayUntilScriptLoaded(function () {
        var OldRenderListView = RenderListView;
        RenderListView = function (ctx, webPartID) {
            if (ctx.ListTitle == "Test") {
                ctx.BaseViewID = 98;
            OldRenderListView(ctx, webPartID)
    }, 'ClientTemplates.js');
    //Register for MDS enabled site otherwise the display template doesn't work on refresh
    //Note: The ~sitecollection tokens cannot be used here!
    RegisterModuleInit("/_catalogs/masterpage/Display Templates/csr_ovr_RenderListTemplate_Fixed.js", pfh.RegisterTemplateOverride); // CSR-override for MDS enabled site
    pfh.RegisterTemplateOverride(); //CSR-override for MDS disabled site (because we need to call the entry point function in this case whereas it is not needed for anonymous functions)
I am using the above script to render the items.
I am new to the CSR.
Where do i need to include your script in my script.
Please help on this.
Thank you for reply sagar.
Please note that i am not using content search webpart.

Similar Messages

  • How to display dynamic hyper link in list view webpart using xslt ?

    Hello,
    I have changed design layout of list using xslt webpart.
    However, still I am unable to update the hyperlink value for the same.
    I have column named "PageLink" that is having http link value for example "http://google.com"
    I require to display that value over the Title Text and hence I have updated code as below.
    But its not updating href link as per the requirement !
    <xsl:variable name="varPageLink">
    <xsl:value-of select="@PageLink" />
    </xsl:variable>
    <a href="{@varPageLink}" target="_blank" onmouseover="javascript:this.style.cursor='hand';" >
    <xsl:value-of select="@Title"></xsl:value-of>
    </a>
    Can anyone please
    Dipti Chhatrapati

    Hi,
    In my case safelinkurl  == varPageLink
    what I have defined as xsl variable.
    However, by specifying the link value in list as relative URL - my code has worked as per the expectation
    There was fault in link value as this xslt has not accepted absolute URL !
    I hope this finding can help others :) !
    Thank you for your time !
    Kind Regards,
    Dipti Chhatrapati

  • Remove "(More Links...)" from List View Webpart if the list view shows all items

    Hi, I currently have 5 links lists out of which 4 links lists have around 30 odd list items and the rest 1 have just 3 list items. All of this links list are added as ListViewWebPart on a wiki page. All these listview web parts are configured for "Summary
    Toolbar"  and show all the items within the list. 
    My question is, even if the listview web parts are configured to show "All Items" why is it that the ListViewWebPart shows "More Links" on the bottom of the web parts? Is there any OOB way to remove it. I don't want to customize using SPD nor i want to export
    web parts. 
    Thanks, Mayur Joshi

    This, right here, is an example of one of the most annoying things about Microsoft. On the one hand, Microsoft keeps pushing code-free solutions; they want to make it easier and easier for "Content Managers" to manage their own SharePoint sites, Excel spreadsheets,
    etc. etc. without having to bother developers. I am with them on this, to a point. However, they also want to HARD-CODE their options so you HAVE TO USE an OOTB solution to hide it! What is wrong with letting us change the settings of the Web Part, or the
    View, to turn off "More Links"? Why do I have to go to JQuery, or SharePoint Designer? WHY??? Give us an OOTB solution for things like this!
    UPDATE: Here is a fix, but it does require CSS. Add a Content Editor Web Part with this code. The (More Links...) and (More Announcements...) tags both use the id "onetidMoreAnn". You can then export the CEWB as a Web Part and drop it on every page. 
    Again, I would like an OOTB solution, but this will have to do.
    <style>
    #onetidMoreAnn
    DISPLAY: none
    </style>

  • Carousel don't show images, only the page name and a "read more" link

    Good morning.
      I'm trying to get a carousel in my page. I already set a image to one page and on my carousel component, I selected that page.
      When I see the carousel, it shows me the page inputed name and a "read more" link instead of the image.
      Can anyone tell me what's wrong or missed?
      Heres a print screen:
    Thanks.

    What did I do to correct this problem:
       When I create a page renderer component, the same automatically creates a jsp file, with the same name as the component. In my Geometrixx copy sites, there's always a "content.jsp" file in the components, despite of the one with the same name of the component. So, instead of build my pages in the componentname.jsp, i'm doing this is these content.jsp. Just doing this, the carroussel works perfectly. For sure is something that I miss in my own jsp files, but even with the same code (copy > paste), in my jsp the carroussel don't work. Anyway, now I can use it.

  • Contact photos are not showing up in Mail message list, even though the message will link to the contact card in Address Book with the photo in it.

    I'm using Mail 5.3 and Address Book 6.1.3 on X 10.7.5. I want my contact photos to show up in the message list on Mail, but only some of them do, even though the message will link to the contact card in Address Book with the photo in it. I've even tried replacing a photo that doesn't show up with a photo that does show up for a different contact but no luck. I am syncing to one other Mac, an iPhone and an iPad via iCloud.

    I'm using Mail 5.3 and Address Book 6.1.3 on X 10.7.5. I want my contact photos to show up in the message list on Mail, but only some of them do, even though the message will link to the contact card in Address Book with the photo in it. I've even tried replacing a photo that doesn't show up with a photo that does show up for a different contact but no luck. I am syncing to one other Mac, an iPhone and an iPad via iCloud.

  • How do you change the "read more ..." in the Blog page to something else?

    I'd like to change the "read more ..." in the Blog page to say something more relevant to my site. How can this be done?
    I searched the forums and found an earlier response to this question, but I don't quite understand it:
    Find index.xml.gz file (open: Macintosh HD ->
    Applications -> iWeb -> Contents -> Resources -> e.g.
    English.lproj -> Templates -> Blog -> e.g. White
    Blog.webtemplate -> index.xml.gz).
    Open file and edit it in TextEdit. Replace all "read
    more..." with your own text. Delete index.xml.gz file.
    I'm a little confused by this reply. To open the index.xml.gz file within the app, do you navigate there with Terminal.app, unzip it, edit the file with Text Edit, then re-gzip it?
    Second, why do you delete index.xml.gz afterwards?
    And third, will this need to be redone each time iWeb is upgraded?
    Has anyone tried this and know if this is the correct way to change the words, or is there some other way?

    This tedious process actually edits the template xml file within the iWeb application, so that it becomes the default with the template. I haven't done this before, so I'm the wrong person to advise on this.
    I tend to like to do things that are on a simpler scale. You can always make a text box with an opaque background color that matches the blog template background. Then type something else into that text box, like "click here to see more of me" Then position this text box over the standard "read more" and link the text to the blog entry.
    The downside....you'll have to do this (at least position the text box and change the link) each time you add an entry.

  • Want to add one more link in the first screen when user gets into EBP

    Hi All,
    I want to add one more link to the template <b>WELCOME</b> in Internet Service <b>BBPGLOBAL</b>. This is the first screen that the user gets when he logs into EBP.
    The issue is the same screen is different in DEV and TEST environment.
    I verified the code in the template in both systems but they are exactly the same.
    Also, checked the Parameters in the Templates and they too match.
    While going through the code, I found out that MENU_NODE_TAB is used in a repeat loop to verify user has access to the further links.
    But the surprising thing is the code is same in both the systems, but Test evnironment is reflecting the link I want to add in DEV environment.
    Am I missing something??
    Pls let me know.
    Thanks in advance.
    <b>I will reward full points for helpful answers!!</b>
    Regards,
    Sanaa

    Hi,
    In welcome.html there is a ITS code to initialize array with information about transaction (line 87).
    This code is in the loop:
    repeat with idx from 1 to MENU_NODE_TAB-TEXT.dim;
      if( (MENU_NODE_TAB-S_IDENT[idx] == "BBPSC01" && A_GEN_URL<i> == "") ||
          (MENU_NODE_TAB-S_IDENT[idx] == "BBPSC03" && A_GEN_URL<i> == "") || 
          (MENU_NODE_TAB-S_IDENT[idx] == "BBPSC02")                       );
        A_S_IDENT<i>      = MENU_NODE_TAB-S_IDENT[idx];
        A_GEN_URL<i>      = MENU_NODE_TAB-GEN_URL[idx];
        A_OBJECT_ID<i>    = "parent.launchpad.menu.M" & MENU_NODE_TAB-OBJECT_ID[idx] & ".root.name + parent.launchpad.menu.M" & MENU_NODE_TAB-OBJECT_ID[idx] & ".path";
        A_TEXT<i>         = quotFilter(MENU_NODE_TAB-TEXT[idx]);
        A_INTRODUCTION<i> = #WELCOME_SENTENCE6;
        found = 1;
      end;
    end;
    If You want to add this 4 links on begining - extend this array (in line 87):
    <!-- initialize array with information about transaction on startpage -->
    A_S_IDENT[1] = "custom_link1"; A_GEN_URL[1] = "www.google.com"; A_OBJECT_ID[1] = ""; A_TEXT[1] = "google"; A_INTRODUCTION[1] = "google link";
    A_S_IDENT[2] = "custom_link2"; A_GEN_URL[2] = "www.rediffmail.com"; A_OBJECT_ID[2] = ""; A_TEXT[2] = "rediffmail"; A_INTRODUCTION[2] = "redi link";
    A_S_IDENT[3] = "custom_link3"; A_GEN_URL[3] = "www.yahoo.com"; A_OBJECT_ID[3] = ""; A_TEXT[3] = "yahoo"; A_INTRODUCTION[3] = "yahoo link";
    A_S_IDENT[4] = "custom_link4"; A_GEN_URL[4] = "www.greetings.com"; A_OBJECT_ID[4] = ""; A_TEXT[4] = "greets"; A_INTRODUCTION[4] = "greeting link";
    A_S_IDENT[5] = ""; A_GEN_URL[5] = ""; A_OBJECT_ID[5] = ""; A_TEXT[5] = ""; A_INTRODUCTION[5] = "";
    A_S_IDENT[6] = ""; A_GEN_URL[6] = ""; A_OBJECT_ID[6] = ""; A_TEXT[6] = ""; A_INTRODUCTION[6] = "";
    etc.
    <!-- Search for shopping transaction in launchpad -->
    repeat with idx from 5 to MENU_NODE_TAB-TEXT.dim;
    Regards,
    Marcin

  • Blog: how to remove the "Read more..." in entries

    OK, it's probably as simple as can be..but how on earth do I remove / delete the "Read more.." text in my blog? I just can't find it, no matter how I try

    Thank you very much for your help, I appreciate it

  • Is it possible to disable the 'edit layout' link on the record detail page

    Is it possible to disable the 'edit layout' link on the record detail page? Not the homepages, I know there is a switch for that, but I thought there was one for the detail pages?
    I want to disable this as I dont want users saving their own layouts, they must stick to the related sections defined in the default layout. The problem is that if they are to have access to certain related lists when an opportunity is of a certain type but NOT other types. If they have saved the layout (using the 'Edit Layout' link), and change the record type, they will see related sections that have been set to 'Not available' in the default layout (ie step 4) for that 'type'.

    Robbo, at this time it not possible to disable the Edit Layout on the record detail page.

  • Add read more link SharePoint 2013 blog site

    Hi,
    I have blog site in SharePoint 2013. I want to add "Read More" link for all the blog post.
    I found a lot of solution by manipulating through the layouts folder in 15 hive directory.
    But I have no access to the 15 hive directory.
    Is it possible through JavaScript or j query ?
    Please share your suggestion.
    Thank you

    I've used this guide: http://www.learningsharepoint.com/2013/04/07/styling-announcements-with-javascript-using-js-link-in-sharepoint-2013/
    The guide is actually for Announcements but the basic behavior is the same. The code is simple to modify even by a beginner.

  • RSS Screensaver - "read more" link disappears

    There is, or atleast there was, a link "read more" right below the headlines that were sweeping the screen in screensavers RSS mode.
    One day few weeks ago it just wasn´t there. By then the problem was fixed, cause I had to re-instal whole system 10.4.7 for some other reason. After re-instal screensaver functioned normally, for couple of weeks, but today it happened again, there is no link ?!?
    It´s not big thing that the link is missing, but like to get it fixed anyway.
    PM G4 MDD   Mac OS X (10.4.7)  

    try:
    var loader:URLLoader = new URLLoader();
    loader.addEventListener(Event.COMPLETE, onLoaded);
    var xml:XML;
    function onLoaded(e:Event):void
        xml = new XML(e.target.data);
        var il:XMLList = xml.channel.item.title;
         var url = xml.channel.item.link[0];
         title0_txt.htmlText = xml.channel.item.title[0];
         link0_txt.htmlText = "<a href="+xml.channel.item.link[0]+">Read More...</a>";  
    loader.load(new URLRequest(rssfeed.xml));

  • My iphone 3g wont load all comments from online newspaper. when I touch the "load more comments" button the little spinning spiral appears then nothing happens. Anyone else have this problem with some online newspapers?

    My iphone 3g wont load all comments from online newspaper. when I touch the "load more comments" button the little spinning spiral appears then nothing happens. Anyone else have this problem with some online newspapers?

    Anything?

  • HT5312 i do not see the Rescue email link under the security questions to reset the questions and answer

    i do not see the Rescue email link under the security questions to reset the questions and answer ?

    You need to contact Apple, either through the link in that article or by phoning them and asking for the Account Security team.
    (82021)

  • The relationships and links between the various SAP database tables

    Hi Gurus,
    I am trying to learn the relationships and links between the various SAP database tables (SAP FI-AA, SAP SD, SAP MM, SAP HR and so on) for correctly extracting data from them. Especially I am expressing an interest in the SAP database tables on SAP FI-AA, SAP SD, SAP MM, SAP HR. Could somebody provide me with documentations about the relationships and links between them. I will be very grateful if somebody can provide me with links.
    Thanks and regards
    Sergey

    hi Sergey,
    try
    http://www.erpgenie.com/abap/tables.htm
    http://www.erpgenie.com/abap/tables_fi.htm
    http://abap4.tripod.com/SAP_Tables.html
    http://abap4.tripod.com/Finance_Tables.html
    http://www.auditware.co.uk/SAP/Extras/SAPTables.pdf
    hope this helps.

  • HT201441 I bought an iphone 4s off of kijiji and the phone is linked to the persons apple id, and i ant get in contact with them. is there a way i can activate my phone without having to jailbreak it.

    I bought an iphone 4s off of kijiji and the phone is linked to the persons apple id, and i ant get in contact with them. is there a way i can activate my phone without having to jailbreak it.

    You won't be able to activate it even if you do jailbrake it.  There's no way around activation lock without the assistance of the prior owner.

Maybe you are looking for

  • System Image Backup programmatically with c++

    Hi, is it possible with C++ to backup the whole system image of your PC, meaning not just coping files, but the whole operating system, with all its programs and files, and to schedule to do it like once a week, including all the drives specified, I

  • ITunes will not install on Windows 8?

    It might be my computer, but I know all of the hardware specs meet the requirements for iTunes. My installation always gets stuck on installing Apple Application Support. I've tried everything I know. Getting another download, trying to work with the

  • How to use protect and protect

    how to use protect and endprotect for two different element. iam using one element for 'tax' and one for 'item total' i wnt to print two elements in one page only.

  • How to get good quality slideshow?

    Hello Im in a true war with Photoshop 6 Elements and Premiere 6 Elements to build a photo slideshow DVD to be played in a common DVD player on a LCD TV All photos were taken at least with 6 MB size and in 16:9 format, and edited in Photoshop 6 Elemen

  • FORMATTING ERROR when executing smartform with message SSFcomposer  159

    Hi all, I have created a custom smartform.When i execute it in tcode SMARTFORMS,i get the error "FORMATTING ERROR" "GRAPHIC CANNOT BE DISPLAYED". I have a image file(LOGO) which is used in this Smartform.However this problem is faced only in the QUAL