ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Search Results

August 11, 2014 11:53pm

Subscribe [2]
  • #1 / Aug 11, 2014 11:53pm

    garyb

    23 posts

    On the search results page every thing is showing up but the urls (links) are wrong. if I do it this way the links go to no search results.

    <h4 class="text-center">{exp:search:total_results} {total_results}{/exp:search:total_results} Search Results for "{exp:search:keywords}"</h4>
       <dl id="search_results">
        {exp:search:search_results}
        <dt><a href="http://{auto_path}">{title}</a></dt>
        <dd>              
          {if article_excerpt != ''}
         {article_excerpt}         
         {/if}
         
        </dd>
            {/exp:search:search_results}
    </dl>

    If I try it this way, the links got to the index page.

    <h4 class="text-center">{exp:search:total_results} {total_results}{/exp:search:total_results} Search Results for "{exp:search:keywords}"</h4>
       <dl id="search_results">
        {exp:search:search_results}
        <dt><a href="http://{if">{title}</a></dt>
       <dd>              
           {if article_excerpt != ''}
          {article_excerpt}         
                             {/if}
         
         </dd>
            {/exp:search:search_results}
    <h4 class="text-center">{exp:search:total_results} {total_results}{/exp:search:total_results} Search 
    </dl>

    What am I doing wrong?

  • #2 / Aug 12, 2014 7:14pm

    Boyink!

    5011 posts

    {auto_path} uses a per-channel configuration that you can change. Best bet is to set that for each channel to the most specific template that content gets used in.

  • #3 / Aug 12, 2014 7:40pm

    garyb

    23 posts

    I tried that and the right article comes up, but menu and footer are gone.

  • #4 / Aug 12, 2014 7:42pm

    Boyink!

    5011 posts

    Compare the URL of the normal article view and the URL of where the search is sending you.  It should be the same.

  • #5 / Aug 12, 2014 8:13pm

    garyb

    23 posts

    It is the same except it has the article title append to the end of the url.

    index.php/blog/article/article_name
  • #6 / Aug 12, 2014 8:28pm

    Boyink!

    5011 posts

    Search results need to point to a single-entry template.

    Do you have a single entry template for articles?

  • #7 / Aug 12, 2014 8:47pm

    garyb

    23 posts

    Yes it is a single entry template.

  • #8 / Aug 13, 2014 8:01am

    Boyink!

    5011 posts

    Can you post example URLs of both non-search and search-results for a single article?

  • #9 / Aug 13, 2014 3:03pm

    garyb

    23 posts

    I ended up hard coding the menu and foot to the page. That kind of defeats the idea of templates.

    Thank For the help!

  • #10 / Aug 13, 2014 5:19pm

    Boyink!

    5011 posts

    It isn’t necessary - you gave up..😉

  • #11 / Aug 13, 2014 6:00pm

    garyb

    23 posts

    Okay, lol I don’t give up. 😊

    Screen shot of menu on blog page

    page before search

    http://1900tr.com/screens/menu1.png

    http://1900tr.com/screens/footer1.png

    Search result page

    http://1900tr.com/screens/menu2.png

    http://1900tr.com/screens/footer2.png

  • #12 / Aug 14, 2014 8:05am

    Boyink!

    5011 posts

    Do you have a ‘blog’ template group and an ‘article’ single entry template?

     

  • #13 / Aug 14, 2014 11:05am

    garyb

    23 posts

    Yes, and the search results template is in that group.

  • #14 / Aug 14, 2014 11:56am

    Boyink!

    5011 posts

    OK, so I’d recommend reviewing EE’s native way of handling/creating URLs:

    https://ellislab.com/expressionengine/user-guide/urls/url_structure.html

    The search result URL you have - with the url-title appended on the end - is actually correct. Your single-entry template should never load on the site without a valid URL title because that’s how EE knows which entry the template needs to load.  You should have /blog/ as the index templates that shows your list of titles, then once you click through to a specific article it should be /blog/article/article-url-title.  This is how EE wants to work.

    The header and footer templates not showing at those ‘deeper’ urls is a separate issue. Can you post the template code you have in those templates?

  • #15 / Aug 14, 2014 4:56pm

    garyb

    23 posts

    Here are the slices of code not showing up.

    <div class="navbar navbar-default navbar-fixed-top navbar-inverse"  role="navigation">
          <div class="container">
            <div class="navbar-header">
              <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                <span class="sr-only">Toggle navigation</span>
                <span class="glyphicon glyphicon-arrow-down"></span>
                      MENU
              </button>
    
            </div>
            <div class="navbar-collapse collapse">
              <ul class="nav navbar-nav">
                <li><a href="http://{path=site_index}">Home</a></li>
                <li class="dropdown">
                  <a href="#" class="dropdown-toggle">Services <b class="caret"> </b></a>
                  <ul class="dropdown-menu" roll=menu aria-labelledby="dropdownMenu">             
                    <li><a href="http://{path=site/website-design}tabindex=-1">Web Design & Development</a></li>
                    <li><a href="http://{path=site/seo}tabindex=-1">Search Engine Optimization(SEO)</a></li>
                    <li><a href="http://{path=site/content-management}tabindex=-1">Content Management Systems</a></li>
                    <li><a href="http://{path=site/ecommerce}tabindex=-1">E-Commerce</a></li> 
                   <li><a href="http://{path=site/designer}tabindex=-1">What You Should Know</a></li>                               
                  </ul>
                </li>
                <li><a href="http://{path=site/contact}">Contact</a></li>
                <li><a href="http://{path=blog/article}">Blog</a></li>
              </ul>
    
            </div><!--/.nav-collapse -->
          </div>
        </div>

    Social

    <div class="social">
               {site_url}images/phone_sm.png
               <h3 class="ita mp-remove">For A Free Quote
    (941)-753-8320</h3> </div>
             </div>
             <div class="col-lg-6">
             <div class="social follow">
             <h3 class="ita mp-remove"> Follow Us</h3>
                    <a href="https://twitter.com/garyb10%22href=">{site_url}images/twitter.png</a> <a href="https://plus.google.com/+1900tr/"><a href="{site_url}images/google+.pngN9On5ijDO3iK2wJxFCWEL6d0OWYCs7aYtypography_img_src_end_      width=15% height=auto alt= ">{site_url}images/google+.pngN9On5ijDO3iK2wJxFCWEL6d0OWYCs7aYtypography_img_src_end_      width=15% height=auto alt= </a></a> <a href="http://{site_url}index.php/blog/rss%22href="> {site_url}images/rss.png</a>
                </div>

    footer

    <footer>
              <div class="row">
             <div class="col-lg-12 pro">
                
                   Professional Services
                
             </div>
          </div>
          <div class="row">
             <div class="col-lg-3">
                
                   About Tobacco Road Designs
                
                
                   We are located in Bradenton FL. Serving Bradenton, Sarasota, and
                   All of Florida. All of our website designs are custom designs.
                   Never from downloaded templates.
                
             </div>
             <div class="col-lg-3">
                
                   Website Design
                
                <ul class="dlist">
                   <li>
                      User Interface Design
                   </li>
                   <li>
                      Information Architecture
                   </li>
                   <li>
                      Copy Writing & Editing
                   </li>
                   <li>
                      e-Commerce
                   </li>
                   <li>
                      Consulting
                   </li>
                </ul>
             </div>
             <div class="col-lg-3">
                
                   Web Development
                
                <ul class="dlist">
                   <li>
                      Custom Applications
                   </li>
                   <li>
                      (CMS) Content Management
                   </li>
                   <li>
                      Portal Systems
                   </li>
                   <li>
                      Rich Media Development
                   </li>
                   <li>
                      (CRM) Customer Relation Management
                   </li>
                </ul>
             </div>
             <div class="col-lg-3">
                
                   Internet Marketing
                
                <ul class="dlist">
                   <li>
                      SEO
                   </li>
                   <li>
                      SEM
                   </li>
                   <li>
                      Brand Identity Development
                   </li>
                   <li>
                      E-mail Campaign
                   </li>
                   <li>
                      Banner Ads & Traffic Campaigns
                   </li>
                </ul>
             </div>
          </div>
         </footer>
                <div class="row">
             <div class="col-sm-12">
                
                   Copyright © 1996-2014 Tobacco Road Designs All Right
                   Reserved
                
             </div>
          </div>
      [removed][removed]
    [removed][removed]
    [removed][removed]

    Here is an example of how I put them on the template. the removed stuff above is javascript.

    {exp:channel:entries channel="menu"}
    {menu}
        {/exp:channel:entries}
.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases