how to repeat ask question box at the footer of all pages
Asked by hung vu:

Hi team,

Can any one show me how torepeat **ask question box** at the footer of all pages. like that:ask question.png  
[](https://community.atlassian.com/t5/Questions-for-Confluence/how-to-repeat-ask-question-box-at-the-footer-of-all-pages/qaq-p/213990?attachment-id=9837){#link_11545c6e993d6d}  
[](/tnckb94959/attachments/tnckb94959/questions-for-confluence-questions/649/1/image2016-6-10%201%3A59%3A29.png){#display_11545c6e993d6d_0}  
[](https://community.atlassian.com/t5/Questions-for-Confluence/how-to-repeat-ask-question-box-at-the-footer-of-all-pages/qaq-p/213990?attachment-id=9838){#link_11545c6e993d6d_0}  
[](/tnckb94959/attachments/tnckb94959/questions-for-confluence-questions/649/2/ask%20question.png){#display_11545c6e993d6d_2}


Answers:
author: Steven F Behnke
body: image2016-6-10 1:59:29.png

I think I was able to successfully recreate this in a User Macro. The "search for existing topics" probably works differently than Atlassian's own.

* <https://confluence.atlassian.com/doc/writing-user-macros-4485.html>

```
## Macro title: ask-question## Macro has a body: N## Body processing: No body#### Developed by: Steve Behnke## Date created: 10/06/2016## Installed by: ???## @param topic:title=Topic|type=string|required=false|desc=Add topics to the question. These tags are space delimited.#if ($!paramtopic.contains(" "))#set ($topicList="")#foreach ($topic in $paramtopic.split(" "))#set ($topicList = $topicList + $topic + ",")#end#set ($stringLength = $topicList.length() - 1)  #set ($topicList = $topicList.substring(0,$stringLength))#end&lt;style&gt;	#ask-question-title {		margin:auto auto auto 0;	}	.ask-question-header {			color: #205081 !important;			font-size: 18pt;	}	.ask-question-related {			font-size: 12pt;	}	#ask-question-submit {			margin:auto 0 10px auto;	}	.ask-question-wrapper {			text-align: center;	}&lt;/style&gt;&lt;div class="ask-question-wrapper"&gt;	&lt;h1 class="ask-question-header"&gt;&lt;strong&gt;Have a question about this article?&lt;/strong&gt;&lt;/h1&gt;	&lt;form id="ask-question-macro" class="aui" action="$req.contextPath/questions/ask" method="get"&gt;		&lt;div class="question-field-set"&gt;			&lt;input class="text" type="text" id="ask-question-title" name="title" title="Question title" placeholder="Ask on Confluence Questions"/&gt;			&lt;input type="hidden" id="ask-question-topic" name="topics" value="$topicList"/&gt;			&lt;input type="submit" id="ask-question-submit" class="aui-button aui-button-primary" value="Ask a question"/&gt;		&lt;/div&gt;	&lt;/form&gt;	&lt;a class="ask-question-related" href="$req.contextPath/dosearchsite.action?cql=type+%3D+%22com.atlassian.confluence.plugins.confluence-questions%3Aquestion%22+and+label+in+($topicList)"&gt;See questions about this article&lt;/a&gt;&lt;/div&gt;
```

comments: author: Steven F Behnke
body: I need to rethink out a bit of this, so I'll update this answer when I have the time. It should probably reference the page ID just like Atlassian's does.


author: hung vu
body: Dear `Mr.Steve Behnke`,

Thank you so much !!! It really help me.

But one minor thing, I see the below link not go to page list all questions related to the topics:

*`<a ``class``=``"ask-question-related"` `href=``"$req.contextPath/dosearchsite.action?cql=type+%3D+%22com.atlassian.confluence.plugins.confluence-questions%3Aquestion%22+and+label+in+($topicList)"``>See questions about ``this` `article</a>`*

On Atlassian page, I hover the link and see it look like that: [https://answers.atlassian.com/tags/{topicName}](https://answers.atlassian.com/tags/407724495)

when click on that link it go to page [https://answers.atlassian.com/questions/topics/{topicId}/{topicName}](https://answers.atlassian.com/tags/407724495)

Can you modify your macro like that ?

Thanks.


author: hung vu
body: I try 2 ways:

1) insert link like [`$req.contextPath`/tags/{topicName}](https://answers.atlassian.com/tags/407724495) but It not work. It show "page not found".

Maybe there are some handler behind. I dont know.

2) insert link like: [`$req.contextPath`](https://answers.atlassian.com/tags/407724495)[/questions/topics/{topicId}/{topicName}](https://answers.atlassian.com/tags/407724495)

problem here is I don't know how to get topic Id by topic name (currently I have only topic name based on page Id)


author: Steven F Behnke
body: Yeah I'll try and update it when I have the time. I'm not certain the best way to get the topic ID yet.


author: Thomas Krause
body: Atlassian Answers seems to have an additional Url handler (without the need to add the topicid) that Confluence Questions does not have but should definitely also get.


author: Steven F Behnke
body: Yeah I haven't found a clean way to handle it yet. Not sure if the API just isn't doc'd or what.


author: hung vu
body: by the way, i use confluence server version, not confluence cloud.

Thanks again.


author: hung vu
body: Hi Steven Behnke,

I want to add on Confluence pages of document Space or KB Space.

I see there is Create from template macro that can support create Ask Question button on every page. But it's not satisfy my requirement which auto create new topic (=pageid) and set topic for that question.

Can you show me how to add macro/addon like image above ?

thanks.


author: Steven F Behnke
body: Hi! Couple questions...

* You want to do this on Confluence pages? Or Confluence Questions pages?
* Are you on Confluence Cloud or are you hosting Confluence somewhere else?