Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Section
show-titlefalse
titleDescription

This tip shows the use of search functions in queries based on macros of the projectdoc Toolbox for Confluence.

Search functions provide values to pass into searches that are dependent on the context. In this tip you will learn how to refer to the current user and the current date.

...

Section
titleJournals

For this short introduction of search functions our use case is journals. Suppose Jane and John want to work together and share their professional journals. Each journal is organized in years and days. Each day is a page in the year journal. Each day page collects events the journal owner wants to remember. Jane and John also use a common set of subjects, categories, and tags to organize their events.#

Tip Box

The free extension projectdoc Developer Diaries provides the blueprints to run journals.

Please note that this doctype add-on requires the projectdoc Toolbox and the free Core Doctypes to be installed.



Section
titleUser Function

Suppose Jane and John use the same view on their work. They craft a page with a couple of display tables and some links to sites that are currently interesting for their work. This page should also collect a number of days from the current user's diary.

This is what the Display Table Macro looks like in the macro editor.

Since every page has the user's full name as the value of the Author property, the currentUser function can be used to render the full name (by the use of the "fn" argument) and compare it in the search with the property value.

Tip Box

For more information on date functions and it use of formats and increments, please refer to User Functions in Search Tips.


Note Box

In case you need to step in your team members shoes use Remote Control Feature. Remote Control allows you to override parameters of a referenced page.

In our use case you would need to override the Where parameter:

  1. Add the identifier "events" to the Display Table Macro
  2. Use the Wiki Link macro
    1. Reference this page (the page where the Display Table Macro is on)
    2. Add a label (e.g. "Jane's view")
    3. Add as Request Parametersevents:where=$<Author>=[Jane]

The tip Remote Control shows how to use the feature in more detail.


...