Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

The Admin's Advent Calendar - The Lost Days 1 - 11

adventskalender.png

Because of size restrictions for articles on the Community platform, I had to remove the first days of the Admin's Advent Calender 2017  

Here they are again:

 

11.png

Do you export your Confluence pages to pdf? And do you know that you can customize the look and feel of your exported content?


This is the first part of the pdf export options package. It will be continued in more of the other packages until Christmas Eve :-)

11-christmas-tree-pdf.png

First: Page Orientation
Sometimes you want to export a page with a wide table to pdf. It would be great, if the page would use the landscape format.

Set this in the PDF Export Stylesheet of your space:

http://<your-confluence-url>/spaces/flyingpdf/viewpdfstyleconfig.action?key=<your-space-key>

And add the following to the PDF Stylesheet:


@page
{
/*A4-sized pages in landscape orientation are 297 mm wide by 210 mm long*/
size: 297mm 210mm;
}

Second: Page Breaks
Exporting more than one page usually results in a pdf document where the page breaks do not correspond to the page breaks of your Confluence pages. Force the pdf export to set a page break before each new Confluence page with the following PDF Stylesheet:

.pagetitle
{
page-break-before: always;
}

Third: Page Numbering
Do you need page numbers on your PDF? Here's how to do that:

Add this to your pdf Stylesheet:

#pageNum:before 
{
content: counter(page);
}

And this to your PDF Space Export Footer:

<span id="pageNum"/>

13 Days left...

 

10.png

Lazy Sunday #2 - package number 10 reveals a second candle, nothing else. No macros and no tips today. Light the candle and enjoy the day with your friends and family!

10-kerzen.png

It’s also time for decorating your home. Get all your Christmas hodge podge from the  attic or the cellar or buy some new decoration, as much as you can. The more decoration you have, the more likely Santa will find your home  :-)

Just 14 days from now...

 

09.png

Talking of macros... Do you want to know, which macros your users really like and which ones are not used at all? Maybe you pay a lot for an app and it is hardly ever used? 

09-search.png

How can you research the usage of macros in your Confluence instance? Just look at the page "Macro Usage" in your Confluence Administration Dashboard:

http://<your confluence url>/admin/pluginusage.action

But, be careful. This view might be disenchanting. Don't be disappointed, if the people in your kingdom don't use your super awesome, amazing and extremely expensive app with all these great macros. Maybe they just don't know that it exists. Make some noise, trainings and advertising, then the macro usage will increase, I'm sure :-)   

15 Days left...

 

08.png

 

Once upon a time, the admin's people wanted to highlight table cells including the text "NOK" (no, it's not Norwegian Krone, but short for Not OK). They didn't want to add the color manually, it should happen on the fly.

08-santa-norway.png

You already know, the admin loves user macros, so he wrote another one:

Macro Body Processing: No macro body

## @noparams

<style type="text/css">
td.rotfaerben{
background: #F6DFD4;
}
</style>

<script type="text/javascript">
AJS.toInit(function(){
AJS.$("td").filter(function() {return $(this).text() == "NOK";}).addClass('rotfaerben');
});
</script>

Save the macro and then add it to your page containing the table. Now, every table cell that includes "NOK" will be colored.

16 Days left...

 

 

07.png

The admin built a macro called "Baustelle". This is German for "Construction Site".  It is based on a regular Confluence panel, embedding a construction site picture and a text. The code looks like that:

Macro Body Processing: Rendered

## @noparams

<ac:structured-macro ac:name="panel">
<ac:parameter ac:name="bgColor">#f4e0a4</ac:parameter>
<ac:parameter ac:name="titleBGColor">#f4e0a4</ac:parameter>
<ac:parameter ac:name="title">!Startseite:bilder^underconstruction.png! &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;In Arbeit</ac:parameter>
<ac:parameter ac:name="borderWidth">0</ac:parameter>
<ac:rich-text-body>$body</ac:rich-text-body>
</ac:structured-macro>

The image "underconstruction.png" is attached to a page "bilder" in the space "Startseite". This page is used as an image storage. Every occurence of the Baustellen-macro is using the central image. Why not surprising your users now and then with a new seasonal picture?

07-underconstruction.png

17 Days left...

 

06.png

 

December, 6th is the Nikolaus day in the admin's kingdom. It is said, that the Nikolaus is visiting every house and puts some sweets into every boot he can find. So children (younger and older and even grownups) put their boots and shoes out of the closet and hope, the Nikolaus fills them with some chocolate at night.

06-boots.png

Here's your chocolate for Nikolaus day: As an admin, are you tired of answering questions like "what kind of permissions has user Thomas in space ABC"? Then you can easily give your user a self-service page, where they can lookup granted permissions in their space (even if they are no space admins).

You need to use groups for granting permissions. Add your users into some space-related groups, maybe a group for writing, another one for just viewing or commenting and grant the permissions to the groups instead of single users.

Then, add a page to your space, e.g. "Permissions in space ABC", add one "User List" macro to the page for every group you use in that particular space, add some comments to the info page and save it. On such a page, your users are able to research, whether another user is granted access to a space. If you don't want that information going public, add some page restrictions to the page.

18 Days left...

 

05.png

 

Today's package contains a very small, but very useful hint. The admin experienced, that hardly noone knows, that you can click the mousewheel the same way as you can click the left and right mouse button.
And what's the big benefit? Click on a link with the mousewheel - the target page will open in a new browser tab! Tadaa!

If your people ask once again, how they can open a linked page in a new browser window, tell them the secret of the mousewheel! 

05-maus.png

19 Days left...

 

04.png

Monday morning, users complain about being kicked out of Confluence after they came back from Christmas Shopping. It takes definitely too long to get all the presents for the whole family...

04-bag.png

So, here's how you give them more time until they have to login again:

Find the file /confluence/WEB-INF/web.xml in your installation directory
Set the session-timeout from 60 to anything you like - this is the value in minutes that the server-side session stays valid while a user is not active anymore (for example when he is going Christmas shopping).
But don't set the value too large, the sessions will never be removed and you could get into trouble with your serverside memory then.

20 Days left...

 

03.png

 

Today, it's Sunday. The admin is not working. But anyway, he opens the next package: 

03-lebkuchenmann.png

Have a nice day, relax, have some tea and a gingerbread and do not even think of trying out any new user macros today! 

 21 Days left...

 

02.png

 

Have you ever wanted to welcome your user on your Confluence page by name? Not just "Hi, dear lovely user, nice to see you", but "Hi, Santa, nice to see you"?
Then this user macro is for you:

## @noparams

#set($username=$action.getRemoteUser().getFullName())
#if($username && $username.length()>0)
$username,
#else
dear lovely user,
#end

Put the macro on your page like this: Hi, {macro} nice to see you

02-santa.png

22 Days left...

 

01.png

 

So, today is December 1st. Let's open the first package.

Opening the first package reveals a small macro for displaying big, large and yellow tooltips:

 

tooltip2.png

How is this implemented:


First, you have to add a user macro with the following code:

Macro Body: rendered

## @param tip:title=BigTooltip|type=string|required=true

<span class="link">
<a href="javascript&colon; void(0)">
<font face=verdana,arial,helvetica size=2>$body</font>
<span>$paramtip</span>
</a>
</span>

Then, add the following to your space stylesheet:

span.link a span {
display: none;
}

span.link a:hover span {
display: block;
position: absolute;
margin-top: 10px;
margin-left: -10px;
width: 300px; padding: 5px;
z-index: 100;
color: #000000;
background: #FFFFAA;
font: 15px "Arial", sans-serif;
text-align: left;
text-decoration: none;
}

Add the macro to your page, edit the tooltip-text (you can use the usual HTML-tags for linebreaks or formatting the text) and finally put the hover-text as content into the macro. That's it.

23 days left...

kugeln.png

 

1 comment

Nicolai Sibler
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 6, 2021

Hi @Thomas Schlegel ,

thanks a lot for this!

We're using the nice little user macro from #2 (welcoming the current user) for some time now and we're enjoying it a lot!

There's a limitation I just wanted to leave here just in case:

When you're wrapping the user macro with a Multiexcerpt Macro and display the content on another page with the Multiexcerpt Include Macro, it may happen that you'll see some random user name instead of yours if you both have enabled cache in Multiexcerpt's configuration in the admin console and didn't tick the very checkbox in the Include Macro.

 

Cheers and Happy Holidays!

Best,

Nicolai

Comment

Log in or Sign up to comment
TAGS
AUG Leaders

Atlassian Community Events