How to generate Facebook Share buttons to dynamically fetched content? - facebook-javascript-sdk

Here we have an article on how to add share buttons to a web page and it works:
https://developers.facebook.com/docs/plugins/share-button/
But on my website, I have a "Load more" button to fetch content dynamically and I have no idea how to add a Share button to newly generated items.
Obviously adding this div does not make any effect so I probably need to call some Facebook function to the newly created divs.
<div class="fb-share-button"
data-href="https://www.your-domain.com/your-page.html"
data-layout="button_count">
</div>
Is anyone aware what is the name of this magic function?

OK, found the solution here:
https://developers.facebook.com/docs/javascript/examples#dialogs
It shows how to trigger a share popup. It also gives more control over the look of the share button which is also what I've been looking for.

Related

Make a sidebar that allows to navigate in one page

I would like to know if Docusaurus has the following feature. For example in https://themes.3rdwavemedia.com/demo/prettydocs/start.html, the content of the document is in one page. When we scroll down, we see the change in the sidebar. Whereas in Docusaurus, it seems that we need to click on "Next" to see the next part and the change in the sidebar.
Is it possible to make a sidebar in Docusaurus that allows to navigate in one page?
(I'm new to Docusaurus. I have posted the same question in Discord app, but nobody replied.)
Docusaurus maintainer here. There's no way to achieve this now without reimplementing such logic in your own docs plugin. Why not just write all your docs on a single page? The table of contents on the right will be the same as the left table of contents in the website you linked.

Reusable Pentaho dashboard side-bar

I have added a side bar like this one onto a CDE dashboard.
https://bootsnipp.com/snippets/featured/responsive-navigation-menu
Now the sidebar needs to be on every page listed on the menu.
What is the best way to go about this?
I could copy it on every single dash board - it works but it's not great especially if I need to change stg ex-post.
Create an "index" page with the side bar and an iframe to display the "sub" dashboards?
Create a widget (I tried but no success so far)
Custom component?
I think I solved the problem by using jquery load like these guys did.
Include another HTML file in a HTML file

SharePoint 2010 Site Customization: Removed breadcrumb and now receiving errors

I removed the following fields from the "s4-titletext" cell using the Manage Content Regions in SPD:
PlaceHolderSiteName
PlaceHolderPageTitleInTitleArea
PlaceHolderPageDescription
And I added "SharePoint:SPLinkButton... Visible="False"
I have published this template and have set it as the Default Master. It displays fine but when I add a web part (not in SPD), I get the error "You must specify a value for this required field" and it will not let me add/remove the web part or change any list. What did I do wrong in my customization? I followed the instructions on this post. I used Option 2 to hide the words. The reason I removed the fields is because I want to stretch our banner across the whole page and I didn't want to leave the space where the bread crumb would have been. My "s4-titletext" area looks like the pictures on the top of the page, only banner is stretched all across the top of page. I can not add a link to my page due to it being on a private server. I have asked other SharePoint experts and they are stumped as well. Thank you for your help on this.
Instead of setting visible="false", getting hiding the control using a CSS class. Set the control's class to something like 'hiddenClass' and then define your class style.
.hiddenClass{display: none;}
Customizing SharePoint masterpages is a pain since they're so sensitive. You have to use this method when hiding a lot of the out of the box controls.
Some placeholders need to be on the master page, if you remove it it will cause errors in some of the scrips.
What I recommend to you is create a hidden div and inside of it put all the placeholder you want to hide, like the example bellow.
<div style="display:none">
<asp:ContentPlaceHolder ID="TitleZone" runat="server"></asp:ContentPlaceHolder>
<div>

asp:Fileupload does not work in ajaxToolkit:AccordionPane

I am using asp:FileUpload in ajaxToolkit:AccordionPane but it always shows HasFile=false.
I am not using any update panel. The structure of the page is as below.
MAster page-->Master page-->.aspx page-->User control-->User control-->AccordionPane-->File upload control.
I have also set Page.Form.Attributes.Add("enctype", "multipart/form-data"). still it shows HAsFile=false.
How can I upload image file?
Till now there is one solution in my view... having another small page with only fileupload controll and call it as popup on button click - and place the button inside accordion pane.
its just a way-around... still looking for proper solution....

Where can I read how to make web notifiers such as the StackExchange at the top left side of StackOverflow screen?

I'm not even sure what the name of that is to be able to make a search... but I would like to make those kind of things. Facebook has that too with the messages, notifications and friends requests. Thanks
I'm not sure if you expect anyone to give you a complete tutorial with source code included? :) You should probably do some digging around yourself, since a concrete answer on this could mean to write a few pages :)
How can you dig around?
Thé tool for a job like that is Firebug (IMO).
With bigger tasks like these it makes sense to try to split it up in smaller pieces.
Let's say you go for a widget like the user profile popup on SO.
you need some HTML to display in a popup: right click on any html element on the popup and click the 'inspect element' menu item. This brings you to the HTML tab in firebug. This allows you to figure out how the HTML is structured
you need some CSS to style that popup: when you're browsing the html structure, you might already have noticed that on the right side of it is the CSS that is applied to the active element
you might want to use some animation effects: for that you could use jquery. Have a look here to find out more on which effects are available and how they can be triggered. Fading is used in the profile popup on SO.
then you might ask yourself the question where SO get's that html structure from, right? To find out more about which server calls are made you can use the 'NET' tab in Firebug. (When you hover over your user name (only the first time?), then you should notice there's a call made to something like: http://stackoverflow.com/users/profile-link-stats?_=someLongNumberHere
In firebug you can then inspect the request and response. You should notice that the response is some HTML structure. This HTML structure is then inserted into the DOM.
Sooooo you can kinda glue it all together now:
the user hovers over his user name
the hovering triggers a server call (see step 4): use jquery hover to attach a handler to the user link. (subsequent hovers don't trigger that server call, so there needs to be a check to see if that profile popup was already loaded or not)
when the server call successfully returns (see jquery get), the returned html is inserted into the DOM and a fadeIn effect is triggered.
it seems a mouseout is used to fadeOut the popup
I HOPE this is the answer you were looking for. It took me a while ;)
You probably need to check out stackapps