Confluence include body of most recent child page - include

Is there a macro to insert the body (part of it, whatever) of the most recent child page.
Rationale: I created a page to create meeting minutes as children of it. That top page shows a fancy list of children, the 5 latest modified minutes in reverse order with except. A button to create a new minutes page from the minutes template. Well, very nice things. I'd like that fancy page to display at the bottom the very last minutes page that were entered so that people don't need to open it, a bit like if the top page also plays the role of the 'latest' minutes. Combo!
I found the Insert Page macro, but it lacks any logic. It's just insert that, that being static. Therefore no way to express 'the latest' here, thus that's not it.

Related

Page performance Issue

I have a web page with employee records. In that page, there is a pagination. Each page has 10 rows of data.
I am thinking to implement the pagination in either of two ways.
I am planning to make an ajax call for every 20 pages. So that
whenever i make an Ajax call i will get 200 rows of data in my page.
I will show or hide the data when i click on pagination. After 20th
page, again i will make one more Ajax call to get another 200 rows
of data and i will have that data in my page and again i will do
show/hide to show the page content and so on.
I will make an Ajax call on every page click to get 10 rows of data.
I am not sure which method to choose. If i implement the first method, it might impact page performance. If i choose second option, the number of AJAX calls will be more.
Pls suggest the best one among these two.
Another approach would be to silently pre-fetch the next/prev page. eg. if the user is on page 3, silently pre-fetch page 4 (and page 2), so that when the user clicks on 'next page' the information is most likely there already.
Some care in race conditions needs to be taken with this approach, so that if the user clicks on 'next page' before the results from pre-fetch is returned, you do not make yet another duplicate call, but just spin/wait for the pre-fetch.

How to load Ajax driven data after user clicks browser Back Button

We have a website product that allows users to search rental inventory, view results and then click through to a details page.
On the results page, we also allow users the option to refine their search via bedrooms, bathrooms, price, etc. When the form changes, we do not reload the page, we use Ajax to run a new search query and load the new results into the container.
For example, when the user first did a search, they got back 100 properties. Then they refine their search for 3 bed, 5 bathrooms, view = oceanfront and they get back 10 properties. Once the user finds a property they like, they typically click through to the details page. But, let's say they change their mind and click the browser 'back button'.
When that happens, all of our search params that were loaded via Ajax are now gone and our property count is back to 100 instead of 10.
So what I have realized is any data loaded via Ajax is not being cached in the browser so the original search is loaded not the refined search.
After doing some research, I think using history.pushState() and history.popstate() might be the solution but I'm having trouble wrapping my head around how to implement it for our problem.
Is there a better solution? If not, will history.pushState() work?

Database web frontend php, ajax, js

My skills in Java/AJAX are relatively poor. I am looking for a method or example link, that would enable the creation of a postgresql front end, that displays a record, the user clicks submit to edit the record changes. and Next to view the next one. The record would be shown within the text boxes within the page as it does when it is first created.

Capture which tab was Liked

I know that you can capture the event when a person clicks a "like" button from within a Facebook tab via the edge.create method, but what im wondering is if there is a way to capture when the Facebook like button at the top of a page is clicked, the purpose being to be able to find out which tab within my fan page is generating likes.
When the page reloads i will know that the page IS liked, but i dont know if the like was generated from one tab, or another tab on the same page.
The only solution I can think about which is sufficiently accurate is the following:
Start a session on server side with the first app request.
Remember the like state from the signed_request and the timestamp when it was issued.
Embed a javascript interval in your tab app(s), firing an AJAX request to your server every couple seconds. I think you have go with something between 2 and max 5 seconds.
The AJAX request refreshes only the timestamp in the session.
If the user clicks like on top of the page, now, the whole facebook page gets reloaded - so does your app and you get a new signed request which has the liked state now set to 1.
Have a look at your session > was the state 0 before? Yes? Is the timestamp max. 6-10 seconds old? Yes? Well, its most likely then that the user liked the page while being on the tab.
I hate the solution with the AJAX interval polluting the network (and on a big site with many users this will stress your server), but I can't think of any other solution, because there is no other way to keep track if the user is still looking on your tab. If the interval is too high, the user would be able to navigate away to the wall or info section and like the page there. If he directly returns to your tab after this, you wouldn't be able to track if he left the tab at all...
Another solution would be to listen for the body.unload event and fire a AJAX request to the server, telling you that the user has left the tab, but it is possible that the event never gets fired on certain browsers or the AJAX request is not fast enough to be processed before the tab page unloads. On the other hand would this solution take way less resources of both the users network and your servers performance.
This are just theoretically solutions and have to be tested, first!
I think this could be accomplished like this:
When the like button on top of the page or on the left side are clicked, facebook refreshes the currently displayed tab.
You can capture this refresh if you record the like state from the signed request, and when a tab transitions from not-liked to liked you can count it as a conversion.
This should work, have never used it, and it's better then nothing. You will probably need to add a limit on the user ip address to prevent unlike/like events increasing the counter.
Good luck, and please post here if you find a better solution, this can be interesting.

Update Drupal views argument via AJAX

I have a request concerning Drupal 6.x
I'd like to have this behaviour:
imagine to have 2 columns, on the left a list of nodes (only titles for example) and on the right a view showing just one of the contents on the left.
My idea would be to achieve this with an AJAX-fashion: clicking a link in the list on the left updates the view on the right with the actual node.
Which is the best way to handle this?
My idea is to use Panels, make 2 column panel with 2 views, one (left) filtered on content type, with no arguments, and one on the right which takes in as an argument the node id to be displayed.
But how to link the 2 views with AJAX?
(or, better, how to update the view on the right with an AJAX call?)
is this possible?
Any help or idea is really welcome
Thanks!
Cheers
Mauro
You also can do a quick hack, which is quite flexible, because it allows you to change your views without changing code.
I have had a similar task recently and for your task I would do the following:
for your right column, create a exposed filter (node id) and hide whole exposed filter form using CSS.
using jQuery, attach a click behavior to titles on your left column.
the click behavior takes the node id, finds the attached exposed filter at the right column, enters the node id into the input field and executes form's .submit().
the .submit() triggers the build-into-views well debugged ajax request which refreshes your right column.
this is certainly possible, and not very difficult to do.
Your task can be divided into two main parts:
Providing a 'callback' URL in the Backend that takes a node id (nid) and returns the markup to display the node in the right panel in a format that can be processed by javascript. This will be done in PHP within a normal Drupal module. The main point is not to return a full Drupal page as usual, but only the markup for the node.
Create logic for the Frontend that, when triggered by clicking a link in the left panel, retrieves the new node markup via the URL callback above and replaces the content of the right panel with it. This needs to be done in javascript, using the Drupal javascript API with jQuery.
You can find an introduction and example for AJAX in Drupal here. (This does almost exactly what you want to do, only with images)
You should also look at this more general entry point for JavaScript in Drupal.

Resources