Modify/Change the CSR for view page for a POST in a Blog Site.

I am working on CSR to add a button and change the look and feel of like
and comment button for a Blog Site. Currently I am able to achieve
this, and it is functional(Button).
I am using the below (JSLink) code to achieve it.
    (function () {
        var overrideCtx = {};
        overrideCtx.Templates = {};
        overrideCtx.Templates.Fields = { 'Body':{'View': CBody} };
        console.log("Registering CSR");
        SPClientTemplates.TemplateManager.RegisterTemplateOverrides(overrideCtx);
    function CBody(ctx) {
        var ret = ctx.CurrentItem.Body + "<b>" +
    "<button onclick='myfunc(ctx);' type='button' >Report Abuse</button>" + "</b><hr/>" ;
        return ret;
Now I should make it look like this.
is there a way that i can append a button after the Comment button of Image 1, after that manipulating css will be easier.
I tried to override like below,
    overrideCtx.Templates.Fields = { 'PostCategory':{'View': CDate} };
    function CDate(ctx) {
        var ret =  "<br> <b>" +
    "<button onclick='func(ctx);' type='button' >One More Test</button>" + "</b><hr/>" ;
        return ret;
But for my luck it didn't worked at all.
what field should I override in my case. CSR is under documented for
SharePoint please suggest me which field/Tag/View/Whatever is need to
overridden.

Hi,
The Client Side Rendering(CSR) may not be able to meet your requirement as the “Comment” button is not a field in the Post.aspx page, it just work as a button that when we click
on it, the TextBox “Add a comment” will be focused for waiting user input.
A workaround is that we can just apply JavaScript to this page to add elements you want behind the “Comment” button.
For how to find a specific element in a page and inject HTML on a page, you can take a look at the links below for a quick start:
How to find a specific element on a page using JavaScript:
http://javascript.info/tutorial/searching-elements-dom
Listen to the click event of a button:
http://idratherbewriting.com/2013/02/04/events-and-listeners-javascript/
http://coding.smashingmagazine.com/2013/11/12/an-introduction-to-dom-events/ 
Inject HTML on a page:
http://stackoverflow.com/questions/3762385/best-way-to-inject-html-using-javascript
Feel free to reply if there are still any questions. 
Best regards
Patrick Liang
TechNet Community Support

Similar Messages

  • Is there a way to change the CSR for install SSL Certificate for CCMADMIN

    HI there,
    Our customer want a solution for the https failure on CCMAdmin and CCMUser sites.
    For that, I have exported a csr to buy a ssl certificate from verisign.
    The problem is the csr includes fqdn an not just the servername
    But the users just have to type in the servername to reach the server.
    Is there a way to export a csr which include as common name only the server name without changing the domain settings in the cucm?
    thanks
    Marco

    Hi
    You can go to the server via SSH, and enter the 'set web-security' command with the alternate-host-name parameter:
    Command Syntax
    set web-security orgunit orgname locality state country alternate-host-name
    Parameters
    • orgunit represents the organizational unit.
    • orgname represents the organizational name.
    • locality represents the organization location.
    • state represents the organization state.
    • country represents the organization country.
    • alternate-host-name (optional) specifies an alternate name for the host when you generate a
    web-server (Tomcat) certificate.
    Note When you set an alternate-host-name parameter with the set web-security command,
    self-signed certificates for tomcat will contain the Subject Alternate Name extension with
    the alternate-host-name specified. CSR for Cisco Unified Communications Manager will
    contain Subject Alternate Name Extension with the alternate host name included in the CSR.
    Typically you would still use an FQDN, but a less specific one (e.g. ccm.company.com)...
    Regards
    Aaron
    Please rate helpful posts...

  • Changing the default associated view for a related entity

    A question from a peer:
    Hey there
    Do you know how in CRM 2015 to change the default associated view for a related entity?
    Say you are in an Account and from the menu open the opportunities for that account.
    That new pop up window states “Opportunity Associated View” I want to change that to “My Custom View”
    I thought we covered this in class years back but cannot remember

    There are a few ways to get what you want, the easiest being
    Create a document as you want it for a particular site, save it is junk.php or similar and create a new file by saving as this as the proper document name such as index.php
    Use the Dreamweaver template system, i.e. create a template with a .dwt.php extension like template.dwt.php and use that to create new pages.
    There are other ways like creating your own php template system. But you can put that in the too hard basket.

  • How do I set the zoom at a particular level as the default to ensure pages are not too small and that i don't have to change the zoom for each page? in English

    How do I set the zoom at a particular level as the default to ensure pages are not too small and that i don't have to change the zoom for each page? in English
    == This happened ==
    Every time Firefox opened
    == From the beginning

    Some add-ons:
    Default FullZoom: https://addons.mozilla.org/en-US/firefox/addon/6965 (I use this one)
    No Squint: http://urandom.ca/nosquint/
    Also:
    http://support.mozilla.com/en-US/kb/Page+Zoom
    http://support.mozilla.com/en-US/kb/Text+Zoom
    http://kb.mozillazine.org/Browser.zoom.siteSpecific

  • How do I change the default setting from Pages to MS Word for Mac?

    How do I change the default setting from Pages to MS Word for Mac?

    https://discussions.apple.com/message/13008817#13008817

  • How to change the color background in Pages for iPad?

    how to change the color background in Pages for iPad?

    You can find many themes at https://github.com/hdoria/xcode-themes  There's a download zip button on the right side of the page.
    Unzip and and copy the .dvtcolortheme files into /Users/YourUsername/Library/Developer/XCode/UserData/FontAndColorThemes Create the directory if it doesn't exist.
    If you can't find the Library directory you can get to it by using Finder's "Go to Folder..." option under "Go" or press shift + cmd + G then type the path.

  • How to change the width for adf shuttle without modify the skin file

    Dear Professionals
    I haven an ADF Shuttle component in my jsp screen , How can i change the width for the two boxes without modify the skin files.(I know i can do that by skin but what i want to change one shuttle just in one screen not change all shuttles on other screens).
    Regards
    Wish79

    Okay, I didnt try with the trinidad selectmanyshuttle, but this worked for me on the af:selectmanyshuttle..
            <af:selectManyShuttle label="Label 1" styleClass="mycustcss">
              <af:selectItem label="Label1" value="value1"/>
              <af:selectItem label="Label2" value="value2"/>
            </af:selectManyShuttle>
            <af:selectManyShuttle label="Label 1">
              <af:selectItem label="Label1" value="value1"/>
              <af:selectItem label="Label2" value="value2"/>
            </af:selectManyShuttle>        And in my css file, I have
    af|selectManyShuttle.mycustcss::content { width: 800.0px;}
    The first selectManyShuttle came up very wide and the second one came up in the default width..
    Julian.

  • Ask your question.How do I change the template for a pages document

    How do I change the template for a pages document?

    Once you've opened it, the opened document is no longer a template. Edit it as you would any other Pages document.
    If you want to use the edited document as a Template, then , after editing, go File > Save as Template, give the new template a name, and click Save.
    The old template will remain available in the location where you found it; the new one will be in the My Templartes sectionof the Templates Chooser.
    Regards,
    Barry

  • TS3147 how do i change the orientation for documents in pages when printing double sided so that the document opens like a menu?

    how do i change the orientation for documents in pages when printing double sided so that the document opens like a menu?
    write now the document is printing so that when folded the interior of the menu is upside down.

    See also this article about the New Tab page (about:newtab):
    *https://support.mozilla.org/kb/new-tab-page-show-hide-and-customize-top-sites

  • How can I change the language for the Quiz Results page?

    How can I change the language for the Quiz Results (labels on buttons and text labels)? Is this possible only manually each time, or are general settings possible?

    For Quiz Slides you've already added to your project file you will need to change the labels manually.  If you change your Quiz Settings and Master Slides that control the defaults and then add new Quiz Slides, THEN those slides will carry your new settings.

  • How can I change the password for the USER in SAP.

    How can I change the password for the USER in SAP?
    also I want to change the Language and  date Format b/c it's displaying in German language..

    Hi,
    Assuming that User has already his/her user-id and password, and now he/ she wants to change it.
    select the client and provide Log-in credentials. Now, instead of 'ENTER' there is one Tab: 'New Password' (up, left hand). Click it.
    Now, system will ask for new password to change.
    If you are asking from Basis point of view, then T.code: SU01 - User Maintenance.
    Enter User's id and Click Change icon.
    It will lead to Page: Maintain User.
    Here, Select tab: Logon Data
    There is a Sub-Tab: Password.
    Here, key-in change password and SAVE.
    For Language and Date format, contact your Basis-Personnel.
    Best regards,
    Amit

  • Adobe acrobat pro x change the program's default page display to single page view - Windows 8, HP La

    adobe acrobat pro x change the program's default page display to single page view - Windows 8, HP Laptop

    Since there were no answers, I will take a stab at a reponse. For the 2nd method, I suspect you could simply select the print or press job options to get the desired results or turn off "use local fonts" in Acrobat. If you check the font list, the fonts are probably not embedded and that is likely the problem.
    I noticed that you have both Reader and Acrobat installed and that might cause some conflict, but should not be the issue here. If you were to uninstall Reader, you would have to repair Acrobat. The conflict here is that you might have problems with the one opening when you want the other. If it works for you, then don't worry about it.
    For technique 1, I suspect you may be using IE 9 that has apparently been a problem since it came out. I have refused to install it. However, it may simply be that PDF Maker does not work correctly with your browser, or got deactivated and needs to be allowed to run in your browser (IE I am assuming).

  • HT5100 I want to turn off the autoplay feature.  I'd like ITunes to stop after one podcast.  The latest version has changed the default for playback.

    I want to turn off the autoplay feature in iTunes.  I'd like iTunes to stop after one podcast.  The latest version has changed the default for playback.

    Make sure that the system time and date on your computer are set correctly.
    If "I Understand the Risks" is missing then this page may be opened in an (i)frame and in that case try the right-click context menu and use "This Frame: Open Frame in New Tab".
    You can retrieve the certificate and check details like who issued certificates and expiration dates of certificates.
    *Click the link at the bottom of the error page: "I Understand the Risks"
    Let Firefox retrieve the certificate: "Add Exception" -> "Get Certificate".
    *Click the "View..." button and inspect the certificate and check who is the issuer of the certificate.
    You can see more Details like intermediate certificates that are used in the Details pane.
    Note that some firewalls monitor secure (https) connections and send their own certificate instead of the website's certificate.

  • HT204053 i have an apple id on my ipod & another for my macbook & iphone.  how do i change the id for my ipod to match the one for my macbook & iphone?

    i have an apple id on my ipod & another for my macbook & iphone.  how do i change the id for my ipod to match the one for my macbook & iphone?

    To change the ID:
    For iMessage, go to Settings>Messages>Send & Receive (Receive At in iOS 5), tap the ID sign out, sign back in using the other ID.
    For FaceTime, do the same thing in Settings>Facetime.
    For Purchasing, do this in Settings>iTunes & App Stores (Settings>Store in iOS 5).
    For iCloud, you'll have to delete the account, create a new account with the other ID, and migrate your data to the new account.  Before deleting the account, if you have any photos in photo stream that are not in your camera roll or backed up somewhere else save these to your camera roll or you will lose them.  To do this, open the photo stream album in the thumbnail view, tap Edit, tap all the photos you want to save, tap Share, then tap Save to Camera Roll.  Once this is done, go to Settings>iCloud, scroll to the bottom and tap Delete Account. When prompted about what to do with the iCloud data, be sure to select Keep On iPod.  Next, set up a new iCloud account using a different Apple ID (if you don't have one, tap Get a Free Apple ID at the bottom).  Then turn iCloud data syncing for contacts, etc. back to On, and when prompted about merging with iCloud, choose Merge.  This will upload the data to the new account.

  • Input Controls - is it possible to change the font for a combo box

    I have an input Control combo box that is a mixture of english/chinese characters. In Webi I can view the chinese characters correctly if I change the font to MingLIU. Is it possible to change the font for an input control OR to set a default font?

    I am a first-time user of the photo book application in iPhoto.
    I also was a first-time user, so I started using it. Exploring the possibilities, learning my way around.
    Thanks, in advance, for any suggestions someone might have.
    Click the ? icon
    Oops. Sorry, but you're in the wrong forum : iLife > iPhoto

Maybe you are looking for