I'm curious if there's a way to track every click associated with a post in WordPress? I know I can track views: http://www.wpbeginner.com/wp-tutorials/how-to-track-popular-posts-by-views-in-wordpress-without-a-plugin/
Maybe using Ajax?
Related
I have a list of custom posts, and I want to have a sidebar, wherein the information associated with a post selected from the list to load.
If you insist on using ajax to do this then you will need an API for your WordPress site to call back into. Take a look at http://wp-api.org/. It won't necessarily be easy, but you should be able to get it setup and running and then put a piece of JavaScript in a widget to make the call and display the data.
Be careful, that plugin is under active development.
IMO, it would be easier to do this without ajax. Off the top of my head I would say that you could define a shorttag in your functions.php file and then put it in your widget. If the widget appears on a page with a post, pick up the post id, fetch the meta data, and display it.
Cheers!
=C=
I have a registration form completed and would like to add a profile picture upload. Once the user clicks the browse, he can select the photo. Then he clicks ok/apply/ok and then the photo is reflected in the thumbnail area without page refreshing.
Once the user is happy with all fields input he can submit the form and with it the photo of course.
Anything that does this exists out there already? If not, please provide guidance on how to establish this feature.
Thanks,
I'm not aware of a ready made solution for this but there probably is something :-)
However, with Laravel this is beautifully simple. You've tagged your question ajax but I'll answer this assuming you're going to use an old fashioned server round trip (i.e a form submit).
1) In your template, add a file element to the form. http://laravel.com/docs/html#file-input
2) Add some javascript to the page that detects when a file is selected and shows the preview. Extensive tutorial here: http://www.html5rocks.com/en/tutorials/file/dndfiles/
3) In your controller, handle the file using the Input facade. http://laravel.com/docs/requests#files
I have an AJAX application which come down to 2 views: an overview and an article view. Both views have googletag ad slots.
I know how to load and display google tag ads into these defined slots, but is there a way to clear ads from certain slots?
I'm asking because when i go back from the article view to the overview, I want to clear the ads in the article view. (I know about the refresh option when loading a new article, but due to specific ads which are essentially overlays, this isn't an option).
Basically, I want the opposite of googletag.display('ad-id').
So a user fills out a form then decides to click on a unrelated link that happens to be on the page say to a disclaimer page. Then using internal site navigation (not the browser back button) comes back to the form he was on. The link back is an ActionLink.
What is the best way to keep his data on the form. I figure I'll have to serialize the data and save it. I can do a ajax call before going to the other page. I'm looking for the sexy solution. Something that will handle it on a global scale.
Is this even a standard practice?
HTTP is Stateless. You are trying to bring some Stateful nature it !
If you really want to keep the data, You can keep in the Session variable and access it there. You need to override the click event and (in javascript) send the form data to an action via jQuery ajax post where you store it into Session. You can access it later when you come back to this page.
Do you really want to do that ? I think 80 % people knows that once they click on another link, the data will go away. You could probably show some alert message to ask "Are you sure to leave this page" like stackoverflow does.
I used .Net's dynamic data entity to implement a website that sits on top of my db (see
http://msdn.microsoft.com/en-us/library/ee845452.aspx)
In the List.aspx-View for a table, I am able to sort/filter the data of the gridview. After having clicked on a row's 'Details' link, I would like to provide the user a 'Back' button in the Details-View that navigates the user back to exactly the same filtered/sorted table.
So far, all sorting and filtering information is lost when navigating back to List.aspx.
Any ideas how to implement this feature? Do I need to work with ViewState?
Thanks a lot
Cheers
Chris
have a look at my article here
AJAX History in a Dynamic Data Website this works when using the back button in the browser to navigate back to the List page.