[All Adaptavist Apps]

Page tree

I can't seem to find the answer in the documentation...how would I limit

{builder-search}

to searching only within a specified space?

Cheers,

Jamie

  • No labels

14 Comments

  1. Unknown User (amoran)

    That's not possible, builder-search is a pass-through to the atlassian code. If you want to restrict the search to a space then use the older search-box macro

    1. Unknown User (jmuir)

      Hi Alain,

      Thanks for the response, I had it in my head I could only use Theme Builder macros. Not sure why.

      I'd quite like to opt for the livesearch macro instead - slightly off topic but are you aware if it is possible to remove the 'Searching Space' text above the box?

      Cheers.

      1. Unknown User (mmartineau)

        Jamie,

        I made the following macro that allows to Quick search in All Confluence or in the current space. It's the merge of what I found in the source of the pages and information found on Internet. The quick search doesn't work with the "in this space" option but this code allows you to have the two functions with the same box.

        <form id="quick-search" class="quick-search"  method="get" action="/confluence/dosearchsite.action">
                <fieldset>
                    <legend>Quick Search</legend>
                    <input class="quick-search-query" id="quick-search-query" style="color: black;" type="text" accessKey="q" autocomplete="off" name="queryString" size="20" />
        
                    <div style="color:#000000" class="aui-dd-parent quick-nav-drop-down" ><!-- Quick nav appears here --></div>
        <input type="checkbox" name="searchQuery.spaceKey" value="$space.getKey()" > </input><font size="1" color="black" valign=middle >space only&nbsp;&nbsp;&nbsp;</font>
                </fieldset>
                <fieldset class="hidden parameters">
                    <input type="hidden" id="quickNavEnabled" value="true" />
                            </fieldset>
            </form>
        

        The macro has no body and generates HTML.

        Best regards

  2. Unknown User (jbrown@interthinx.com)

    I am having a problem with the suggestions dropdown. It looks like it is finding suggestions, but there is no text next to the icons. This is what it looks like.

    I am just using the basic macro in my Theme Builder navigation:

    {builder-search}

    As far as I can tell there is no text there. And I have not modified the CSS at all for this.

    1. Unknown User (amoran)

      Looks like you have set the foreground colour to white somewhere, try drag selecting in the box & if the text shows up then you can be sure that this is what you have done.

      1. Unknown User (jbrown@interthinx.com)

        I should have mentioned it, but I tried dragging a selection as well as doing a select all on the page. There was no indication of there being any text with either method. I also did try explicitly setting the color to black without any luck either. That was actually the first thing I tried as I thought maybe the text color was just set to white.

        1. Unknown User (amoran)

          You may be able to use firebug to take a peek at what the actual content is in there ... builder is simply re-using the existing atlassian code, so if it were broken you should expect to see it broken in the atlassian theme as well.

        2. Unknown User (scayla)

          I've already had this kind of problem but it was in IE6.
          If there should be something written inside the dropdown (ie if there is something in the source code), then have a look at the container (a div may be) you've put your {builder-search} in and change its size. If it's a big structure, try changing the sizes of the other containers.

          HTH
          Steeve

          1. Unknown User (jbrown@interthinx.com)

            I am using Firebug, I did look, and there is no text in the suggestions. Here is the code that gets rendered.

            <ol>
            <li class="active">
            <img src="/images/icons/profilepics/default.gif">
            <a href="/display/~admin" class="content-type-userinfo">
            <span title>
            <em style="display: none;">
            <strong></strong>
            </em>
            </span>
            </a>
            </li>
            </ol>

            I did try switching to the default Confluence theme, and it works fine there.

            I have not really changed the structure from the default Builder layout. The search box is in the same table layout (no divs) as the default layout. And this is occurring in all browsers.

            1. Unknown User (scayla)

              I would do the following, trying the builder-search at each step:

              • restart Confluence
              • uninstall and Install Theme Builder
              • move the builder-search from the "menu" to another part (such as "header") in the layout
              • create a new layout based on the default layout and simply insert a builder-search somewhere

              If it works on the default Confluence theme, then it will work with theme builder.

              Furthermore, your screenshot seems to indicate that you have results (one page, one space).

              Try using Charles to see more about the request and the response from the server while you are typing in the search.

              1. Unknown User (jbrown@interthinx.com)

                I managed to track down the issue to the table code that the search macro was in. When I changed it from:

                {td:align=right|valign=middle}

                to:

                {td}

                everything worked fine. I'm not exactly sure why that would cause an issue though...

                1. The right alignment on the td is causing the text in the drop down to be right aligned. The JS quick search menu code iterates through each item and truncates it if too long for the menu - but the right alignment is confusing it, and all the text ends up getting truncated!!!

                  The simple CSS fix is to make sure that all text is left aligned in the quick search form:

                  .quick-search {
                      text-align: left;
                  }
                  

                  You may also want to force the whole menu to butt up against the right edge rather than pushing out to the right of the page, then add this too:

                  .quick-nav-drop-down {
                      right: 10px;
                  }
                  

                  These can be added to your custom CSS but will also be included in the next builder release (4.1.4)

          2. Unknown User (jbrown@interthinx.com)

            If it helps, this is the content for the "Menu" section where this drop down is.

            {table:width=100%|cellpadding=0|cellspacing=0|border=0}
            {tr}
            {td:valign=middle}
            {menubar:id=mainNav}
            {menu}Marketing
            {menuitem}{menulink:home|space=marketing}Marketing{menulink}{menuitem}
            {menuitem}{menulink:home|space=industryRelations}Industry Relations{menulink}{menuitem}
            {menu}
            {menu}Technology
            {menuitem}{menulink:home|space=applicationDevelopment}Application Development{menulink}{menuitem}
            {menuitem}{menulink:home|space=projectManagement}Project Management{menulink}{menuitem}
            {menuitem}{menulink:home|space=techOps}Technical Operations{menulink}{menuitem}
            {menu}
            {menu}Products &amp; Services
            {menuitem}{menulink:home|space=businessDevelopment}Business Development{menulink}{menuitem}
            {menuitem}{menulink:home|space=productManagement}Product Management{menulink}{menuitem}
            {menuitem}{menulink:home|space=ui}User Interface Design{menulink}{menuitem}
            {menuitem}{menulink:home|space=fannieMae}FannieMae{menulink}{menuitem}
            {menuitem}{menulink:home|space=auditServices}Audit Services{menulink}{menuitem}
            {menu}
            {menu}Sales
            {menuitem}{menulink:home|space=accountManagement}Account Management{menulink}{menuitem}
            {menuitem}{menulink:home|space=customerService}Customer Service{menulink}{menuitem}
            {menuitem}{menulink:home|space=implementation}Implementation{menulink}{menuitem}
            {menuitem}{menulink:home|space=insideSales}Inside Sales{menulink}{menuitem}
            {menu}
            {menu}Company Operations
            {menuitem}{menulink:home|space=facilities}Facilities{menulink}{menuitem}
            {menuitem}{menulink:home|space=finance}Finance{menulink}{menuitem}
            {menuitem}{menulink:home|space=operationsService}Operations Service{menulink}{menuitem}
            {menuitem}{menulink:home|space=training}Training{menulink}{menuitem}
            {menuitem}{menulink:home|space=executive}Executive{menulink}{menuitem}
            {menu}
            {menuitem}{menulink:home|space=hr}HR{menulink}{menuitem}
            {menubar}
            {td}
            {td:align=right|valign=middle}
            {builder-search}
            {td}
            {tr}
            {table}
    2. Unknown User (mmartineau)

      Hello James,

      I had the same issue. As my menu bar background was black, I setted the text color to white. These two opotions was setted in the Layout manager (style tab of the Header). When I setted the color text to black again, then the texts appear in the drop down list.

      Best regards