Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to include a read more link on parent page

Dillon Weyer December 11, 2018

I am using the Children display macro for a glossary page I am creating. From a usability perspective, yes the title is a link to the full child page, but on the parent page, it isn't obvious that the text displayed is only a snippet of the full definition. What I was thinking was to include a read more... link on the parent page so that the user is aware that for each term they need to click the link to view the full definition. Any ideas on how I can include this as part of the children display macro or achieve it some other way?

1 answer

0 votes
roman
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 12, 2018

Hi @Dillon Weyer,

there are multiple ways on how to do it.

1. If you have a commercial license for Confluence (above 10 users), you also get access to Confluence’s source code. That way you could create your own custom macro by utilising the original logic with some added functionality.

The downside is that you would have to let your users know that they should use the custom macro, not the built-in one.

2. Again, if you have a commercial license, you could completely re-write the built-in macro and build a custom Confluence out of this just for you.

The downside is that some apps replace default macros with their own implementations that have additional functionality in the spaces where those apps are active (we do this for Scroll Versions app).

3. The best approach would be to use custom CSS or JS on the global or space level that adds or re-writes the links to children pages and adds a text such as "read more". That way the macro is not overwritten, and the changes are applied on the clients (end-users’ computers).

I hope this helps.

Roman.

Dillon Weyer December 12, 2018

 Hi @roman, I am new to confluence so thanks for the assistance. I like idea 3, can you point me to some documentation that can guide me in terms of how I can achieve that option?

roman
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 14, 2018

@Dillon Weyer,

Children macro prints out the list as bullet points. Therefore, if this macro is usually in the same position on the page, it should be possible to traverse through the HTML code with JS or CSS and add a paragraph with ::after.

The custom CSS code can be inserted on a space level in Space Tools → Look and Feel → Stylesheet. 

JS code can only be inserted globally in Confluence: Confluence Admin → Custom HTML.

I don’t have the exact code to share, unfortunately. But I hope this helps you.

Related links

* CSS ::after selector: https://www.w3schools.com/cssref/sel_after.asp
*
 How to use JS in Confluence: https://confluence.atlassian.com/confkb/how-to-use-javascript-in-confluence-313458839.html

Roman.

Like Dillon Weyer likes this
Dillon Weyer December 15, 2018

Thanks very much

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events