Home | Products | Consulting | Hosting | Forums | Support | Order | 1-800-752-0455
  Main
Index
Search
Posts
Who's
Online
Log
In

Home: Products: Listings Manager (Realty Manager & Auto Manager):
Questions about Search and Templates

 

 


onlinemba
New User

Oct 10, 2007, 8:50 AM

Post #1 of 5 (2366 views)
Shortcut
Questions about Search and Templates Can't Post

Hi everyone - This is my first post to the forum.

I was wondering two things:

1. I read in these forums somewhere that the search results template does not support server side includes. In my case I am using PHP to provide a consistent header, side navigation, and footer. Is this still the case? Is there anyone that is getting around this limitation?

2. I love the fact that you can create custom templates. Is there a way to use the same template but with a different page heading? The published pages of the Listings Manager demo seem to accomplish this.

I realize you cannot see everything on the demo. However, if you mouse over one of the categories on the left and then look at the link URL shown in status bar of the browser, it seems to point to search.cgi. But the page headings match the category names.

These two questions are related because if I cannot used PHP includes for navigation, then I want to limit the number of template files that I use.

If I have to create a template for each category just to show the name, that would be 30 templates. That is a lot of maintenance if I add, modify, or delete any of the navigation stuff.

Thanks.


Jake
Staff / Moderator


Oct 11, 2007, 1:37 PM

Post #2 of 5 (2348 views)
Shortcut
Re: [onlinemba] Questions about Search and Templates [In reply to] Can't Post

Hi onlinemba,

Thanks for your post!

Let me answer your questions one at a time:


Quote
1. I read in these forums somewhere that the search results template does not support server side includes. In my case I am using PHP to provide a consistent header, side navigation, and footer. Is this still the case? Is there anyone that is getting around this limitation?


Servers typically require the .php extension in order to execute php code, so if your page URL doesn't have this extension the code will not be executed. I'm not aware of any workaround for this currently, but since I'm not that well-versed in php that doesn't mean there isn't a solution for this. You might want to try tracking down some web sites that deal with php and cgi integration.


Quote
2. I love the fact that you can create custom templates. Is there a way to use the same template but with a different page heading? The published pages of the Listings Manager demo seem to accomplish this.


The Listings Manager demo actually uses a bit of javascript on the "_search_results.html" template to change the heading name from page to page. Let us know if you need the exact piece of javascript used for that and we can provide it to you.

Don't hesitate to contact us if you have any other questions. Smile
-----------------------------------------------------------
Cheers,
Jake Swanson - Product Specialist
support@interactivetools.com


Hire me!
Save time by getting our experts to help with your project. Template changes, advanced features, full integration, whatever you need. Whether you need one hour or fifty, get it done fast with Priority Consulting.



onlinemba
New User

Oct 11, 2007, 4:39 PM

Post #3 of 5 (2341 views)
Shortcut
Re: [Jake] Questions about Search and Templates [In reply to] Can't Post

Jake,
Thanks for replying.

I do have the .php extension enabled for LM and currently use php to include header, left column, right column, and footer code in my templates. My question was more about using it with the search templates.

I am very interested in the javascript code to change the heading name from page to page. This would help greatly for template management purposes. In fact, this javascript solution should pretty well nullify my first question.

If you could send me the javascript code, that would be great.

Thanks.


Jake
Staff / Moderator


Oct 13, 2007, 12:34 PM

Post #4 of 5 (2301 views)
Shortcut
Re: [onlinemba] Questions about Search and Templates [In reply to] Can't Post

Hi onlinemba,

Thanks for your reply!

The reason why using PHP code on search results pages is problematic is because your server relies on reading the ".php" extension in order to execute PHP code. If this isn't there, the server doesn't know that it needs to resolve PHP code on the page which is what happens when the search engine is used. I wasn't too clear about this in my first reply - sorry about that!

To set up the javascript code to add the page heading, you'll want to add the following chunk of code between the <head></head> tags on your _search_results.html template file:


<script>
var qsParm = new Array();
var query = window.location.search.substring (1);
var parms = query.split('&');
for (var i=0; i<parms.length; i++) {
var pos = parms[i].indexOf('=');
if (pos > 0) {
var key = parms[i].substring(0,pos);
var val = parms[i].substring(pos+1);
qsParm[key] = val;
}
}
</script>


Next, you'll want to add this block of code where you'd like the heading text to appear:


<script>
if (qsParm['lfield4_keyword']) {
var encoded = (qsParm['lfield4_keyword']);
var pageTitle = unescape(encoded.replace(/\+/g, " "));
document.write (pageTitle);
}
else {
document.write ("Our Product Listings");
}
</script>


Note that this example pulls the heading from the keyword submitted for the "lfield4_keyword" part of your original serach string. If you need to reference a different field, just change the field number.

Don't hesitate to contact us if you need anything else. :)
-----------------------------------------------------------
Cheers,
Jake Swanson - Product Specialist
support@interactivetools.com


Hire me!
Save time by getting our experts to help with your project. Template changes, advanced features, full integration, whatever you need. Whether you need one hour or fifty, get it done fast with Priority Consulting.



onlinemba
New User

Oct 13, 2007, 8:27 PM

Post #5 of 5 (2277 views)
Shortcut
Re: [Jake] Questions about Search and Templates [In reply to] Can't Post

Jake,
Thanks a million. It works perfectly. Easy instructions too Smile.

 
 
 


Search for (options)
Products
CMS Builder
Article Manager
Realty Manager
Listings Manager
Order Now
Services
Priority Consulting
Hosting
Support
Online Documentation
Support Forums
Support Homepage
Company Info
12 reasons to choose us!
Meet the team
Monthly newsletter
Contact Us
Toll Free: 1-800-752-0455
Phone: (604) 689-3347
Sales | Support
Conditions of Use | Privacy Policy | Copyright © interactivetools.com 2008
#201 - 2730 Commercial Drive, Vancouver BC Canada V5N 5P4