Recent Topics

1 Oct 09, 2005 07:01    

I have a Main Page that's the entry point of [url=www.thechristianalert.org]my website[/url].

In there, I have a "News Blog" & links to "Recent Blogs"

I'm using 3 blogs:
1. - In the News - "used as CMS to add news stories to main page without having to create an HTML page every time a news story gets posted."
2. - The Blog - traditional blog - daily takes
3. - Book Reviews, etc...
4. - more Blogs ("CMS Functionality") will be added later.

In the Main page, I want to put a "Global Blog Search box" that would search all of the blogs for content similar to the Search Box that is found on every Blog.

Is this doable?

2 Oct 12, 2005 04:18

Hello esanchez,

I think it's doable.

If you click "Blog" from your main page, it appears that you're taken to a "Blog ALL" page (Blog #1 in b2evo, that shows ALL of the categories in EACH of your blogs and ALL of the posts - in chronological order - from ALL of your three blogs: "The Blog", "In the News" and "Bibliography")

If you do a search on "Google Cicero's" (using the "some word" radio button) from that [Blog ALL] page ... you turn up 4 blog entries:

1) Daily Bible Verses - on your cell phone
2) Augustine's Confessions
3) Muslims and the people of the book in history
4) Augustine's Confessions

(2 & 4 look like a repeat, but they're different times ... maybe you know what's going on there? Just looked odd to me.)

The point is: They're posts from DIFFERENT blogs. ("Augustine's Confessions" is a [Bibliography] Blog entry and "Daily Bible Verses" is a [In the News] Blog entry.

Isn't this what you want to achieve, but on the MAIN page instead?

We don't make use of a "Blog ALL" (it's turned off for us) so I'm not sure the action ... but it seems to me that all you need to do to achieve this is copy the code for the Blog ALL search and put it into the main page wherever you want.

If you're in the "In the News" blog, the code for the search form looks like:

<form name="SearchForm" method="get" class="search" action="http://www.thechristianalert.org/blog/index.php?blog=6">

so it limits the searching to ONLY blog #6.

On the Blog ALL page, the code for the search <form> looks like:

<form name="SearchForm" method="get" class="search" action="http://www.thechristianalert.org/blog/index.php">

so it doesn't limit the searching to a particular blog. You'll have to have a look at the actual PHP code for the search form, but it seems possible that you COULD change the code in the _main.php file so that NO MATTER WHAT BLOG YOU'RE IN ... YOU'RE ALWAYS SEARCHING THROUGH ALL the blogs.

THIS is the action that I would want, if I had multiple blogs. (Why limit a search to just one blog?)

The PHP probably uses a b2evo variable that "senses" what blog is currently open and then limits the search to just that blog. But by replacing it with the final HTML code (as shown in the source) ... you could ADD that action to your main page and CHANGE the action for all your blogs!

I can't test this, because we don't use a "Blog ALL", but it seems to me that it would achieve what you want.

Hope this helps.

-stk

3 Oct 12, 2005 05:41

Thanks a lot for your help. I'll give this a try.

The sample code looks pretty simple but I'll repost if I have any other problems.

4 Oct 12, 2005 15:12

The code posted is ONLY for the <form> tag ... you'll still need all the surrounding stuff too, but that should just be a straight copy of what's already there.

All you're really doing, is hard-wiring the "ACTION" location, rather than letting b2evo "sense" which blog it's on.

Let me know if it works.

-stk

5 Oct 13, 2005 05:40

Hi stk,

I did as you suggested and it works pretty nice now.

Basically as you suggested, I copy the search code from Blog_All and put it on my homepage. This will allow searching all blog content.

Thanks for the tip.

The code is below (copy & pasted from blog_all)

<div class="bSideItem">
<h3 class="sideItemTitle">Search Blogs</h3>
<form name="SearchForm" method="get" class="search" action="http://URL/blog/index.php">
<input type="text" name="s" size="30" value="" class="SearchField" /><br />
<input type="radio" name="sentence" value="AND" id="sentAND" checked="checked" /><label for="sentAND">All Words</label>
<input type="radio" name="sentence" value="OR" id="sentOR" /><label for="sentOR">Some Word</label>
<input type="radio" name="sentence" value="sentence" id="sentence" /><label for="sentence">Entire phrase</label>
<input type="submit" class="button" name="submit" value="Search" />
<input type="reset" class="button" value="Reset form" />
</form>
</div>

6 Oct 13, 2005 15:47

esanchez,

Glad it worked for you! :D

-stk

7 Oct 21, 2005 14:09

I'm trying to do the same thing here.
esanchez I would be interested in seeing the exact code you used on the main page. Particularly the content of this line

<form name="SearchForm" method="get" class="search" action="http://URL/blog/index.php">

I can see from your blog that it works but I can't make it work here.

Thanks.


Form is loading...