Support community for TTG plugins and products.
NOTICE
The Turning Gate's Community has moved to a new home, at https://discourse.theturninggate.net.
This forum is now closed, and exists here as a read-only archive.
You are not logged in.
Pages: 1
Hello,
I'm looking for a solution to open my web site directly on the "search page" and not the home page. Is it possible?
Also, is it possible to modify the search module? For example: change the color, change the position, add icon…?
How can I do it?
Thank you for your help
Marc
Offline
Your search page can use one of your gallery templates.
The form colors can be styled from Site Info > Typography > Forms. (If you're using the Share Resources with TTG CE4 Pages feature, I believe you'll need to change the form styling in Pages)
You can add an icon using the syntax to add a Font Awesome Icon. do this in ttg-be Publisher settings. Just add it to the Search Title field. (see my search page )
Here's the code to add a magnifying glass search icon: <i class="fa fa-search"></i>
I just created a post about this: http://ttg-tips-and-tricks.barbeephoto. … e-heading/
Changing position would be tricky. You'd likely need to use phplugins to essentially replace the block with your own coded structure.
But take a look at the page structure before and after search results. It gets even more complicated from there.
Ben mentioned in the forum awhile back that he was working on being able to modify the main content area via the Publisher set up. So wait and see what he comes up with.
Rod
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site
Offline
as for having the search page as the home page, probably not. But you can put a search form on your home page.
The way to do that is to look at the page source for your search page. Look for the form, it looks like this:
<div id="search" class="collapse clearfix">
<h2>Photo Search</h2>
<form action="./" method="GET">
<input type="text" id="q" name="q" value=""/>
<button type="submit">Search</button>
</form>
</div> <!-- #search -->
copy that code and insert it in the Page Copy (md) field of your home page. I'd suggest putting it in the sidebar.
You'll need to modify one part of the code. Change this:
<form action="./" method="GET">
to this:
<form action="/search" method="GET">
this assumes your search page is in the root of the site. If not, change the path accordingly.
Rod
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site
Offline
Hello,
I have some difficulties to find the "search page" and the code you've indicate in your post… What file is it please?
Regards
Marc
Offline
Just go to your search page on your site. To view the page source just right click and choose "view page source"
Copy from that. Or simply copy and modify the code I posted above, it's the same.
Rod
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site
Offline
I modified my search page to hide the album search using PHPlugins to replace the block. Here is my function if you are interested:
function ttg_block_top( $style, $path ) {
if (G_PATH == 'SEARCH') {
echo '
<div id="primary-content" class="container_12 collapse clearfix">
<div id="search" class="collapse clearfix">
<h2>Search</h2>
<hr />
<form action="./" method="GET">
<input type="text" id="q" name="q" value=""/>
<button type="submit">Search</button>
</form>
</div> <!-- #search -->
</div>
';
return false;
}
return true;
} // END
You can take a look here (try searching for 'Nassau'). I also increased the max width via custom css:
#search {
max-width: 1140px;
}
Last edited by kmlucy (2015-02-11 22:21:06)
Kyle Lucy Photography
kylelucy.com
Offline
This is a much cleaner way of doing the same thing. This leaves the original search intact, and just hides the unwanted information, as opposed to overwriting the whole search page. With this function, the search term stays in the search bar, and you get a message for 'no photos found'.
function ttg_block_bottom( $style, $path ) {
if (G_PATH == 'SEARCH') {
echo '
<script>
(function(){
if(document.getElementById("content")!=undefined){
if(document.getElementById("content").innerHTML.indexOf("criteria")>-1){
document.getElementById("content").innerHTML="<p><cite>No photos matched your search criteria</cite></p>";
} else {
document.getElementById("content").style.display="none";
}
}
})();
</script>
';
}
} // END
Kyle Lucy Photography
kylelucy.com
Offline
Pages: 1