Hello,

I have installed SBP module with Search by Page Paths submodule.
I have a few pages the content of witch is coming from the views - block display. These pages are not indexed. The block is in Content region.
If I add the url of the Page display (not the url of the page containing the block) to the Search by Path everything is OK.

I tried on a fresh new D6 installation and everything is fine - including content from block views. So the problem is not in SBP.
I spend a lot of time trying to find out how to solve this problem.

If you have any idea please advice what to do!
Thank you!

Comments

jhodgdon’s picture

Status: Active » Postponed (maintainer needs more info)

Sorry, I'm confused... Which URLs have the blocks on them (in the content region), and which ones are you adding to Search by Page Paths?

parvanova’s picture

I am having the view with Block display. This block is added to the content region of the page with path "about-us" .
I created new search environment and then from admin/settings/search_by_page/edit/1/paths/add added "about-us" as new path. Run cron.php. Then searched for the word that appears in the page "about-us" - nothing.
Then created a page display from the same view with url "aboutus" and added as new path. Run cron and the same word appears in the search results. I changed the theme to Garland - the same behavior.

The site has a lot of modules. I know the problem is not in SBP but just don't know where to search for it...

Thank you very much for spending time to even read this!

jhodgdon’s picture

Can you try this with a non-Views block -- create a block from the Blocks admin page, and add it to the Content region of the page, run cron until the search status says everything is indexed, and see if you can search on that? I'm just trying to understand whether this is specific to Views or if there is perhaps a bug in the Search by Page module.

Also, depending on your theme... Make sure you are not adding this to "content bottom" or another region. You really need it to be in the same region of the theme as the main page content... I'm actually not sure that all themes support adding blocks there in Drupal 6.x...

parvanova’s picture

did it.
the words I added in the block did not appear after searching.
I switched to Garland in order to be sure this is not from my theme.
The blocks - the one from views and the one I just created - are in Content region.\

Thanks

jhodgdon’s picture

Category: support » bug
Status: Postponed (maintainer needs more info) » Active

OK, thanks for testing. I'll see if I can reproduce the problem on my test site. Sounds like a bug.

jhodgdon’s picture

Title: Content from block views is not indexed » Index blocks added to content region of page
Version: 6.x-1.5 » 6.x-1.x-dev
Category: bug » feature

I have confirmed what you are seeing.

Unfortunately (and sorry, I had forgotten!), Search by Page in Drupal 6.x currently only indexes the main page content, not additional blocks that are added to the "Content" region of the page. In Drupal 7, there is no real distinction between the "main page content" and other blocks in the "Content" region, but in Drupal 6 there is, and Search by Page is currently only responding to the main page content in Drupal 6.x.

So, I've changed this into a feature request. The only other suggestion I can make for now is to upgrade to Drupal 7.x... although I just tested and I am not sure this feature is working correctly in Drupal 7 either. Sorry! I haven't been doing much with this module lately... I'll just have to look into it...

parvanova’s picture

well,

as I write in the first post, it is not in the SBP.
I tested on a fresh new pressflow installation (this is what is used for that site) and it WORKS!
So there must be something else that prevent SBP to index the content from blocks.
Something in the other modules that are installed. I just don't know how to find out which one. And there are a lot of modules...

Thank you very much for your help and for the great module!

parvanova’s picture

i didn't mention that the site is multilingual.

jhodgdon’s picture

I just discovered something interesting on my Drupal 7.x test site for this: Apparently, the pages are being indexed using the Seven (administrative) theme, not Bartik (which is the site-wide default theme). My node pages have a different block in the content region in Seven than in Bartik, and that block is what is getting indexed. I've file a separate issue on that -- definitely a bug!
#1598710: Wrong theme being used to index pages

I don't think that is the problem for you though, probably, because in my 6.x test site, a static block added to the content region is not getting indexed at all, and I don't have any extra modules or themes enabled.

parvanova’s picture

My apology.
I tested once again and of course you are right - the content from the block is not indexed.
I am sorry that mislead you.
Is there any chance to fix it in v.6? If not is there any workabound?
Thanks

jhodgdon’s picture

The only work-around right now for a particular site would be to add something to the way you theme nodes so that the blocks are being included in the main page content returned by the theme, rather than using the Blocks admin page to add the block to the content region.

It would also be possible to fix this in Search by Page, but I probably will not work on it any time soon -- other projects have higher priority. Sorry! Patches would be welcome, especially if they included tests. :)

parvanova’s picture

Great!
It works. Thank you very much!

NicoDruif’s picture

I just ran into this same problem with the 7.x-1.2 version. I hope the dev version (as jhodgdon says in http://drupal.org/node/1598710) fixes this!

pareen’s picture

Hi,

We're using a Zen as the base theme. As you can see below, we have two sidebars (which have blocks with static content) that we want to include in "search by page". There is a div for content called content-area.

Will it work if we move both the sidebars in the content-area div or will have to do something else?

Isn't there any other way to include blocks in the search index? We're using D6.

  <div id="page-wrapper" class="inner"><div id="page">

    <div id="header"><div class="section clearfix">

      <?php if ($logo): ?>
        <a href="<?php print $front_page; ?>" title="<?php print t('Home'); ?>" rel="home" id="logo"><img src="<?php print $logo; ?>" alt="<?php print t('Home'); ?>" /></a>
      <?php endif; ?>

      <?php if ($site_name || $site_slogan): ?>
        <div id="name-and-slogan">
          <?php if ($site_name): ?>
            <?php if ($title): ?>
              <div id="site-name"><strong>
                <a href="<?php print $front_page; ?>" title="<?php print t('Home'); ?>" rel="home"><span><?php print $site_name; ?></span></a>
              </strong></div>
            <?php else: /* Use h1 when the content title is empty */ ?>
              <h1 id="site-name">
                <a href="<?php print $front_page; ?>" title="<?php print t('Home'); ?>" rel="home"><span><?php print $site_name; ?></span></a>
              </h1>
            <?php endif; ?>
          <?php endif; ?>

          <?php if ($site_slogan): ?>
            <div id="site-slogan"><?php print $site_slogan; ?></div>
          <?php endif; ?>
        </div><!-- /#name-and-slogan -->
      <?php endif; ?>

      <?php if ($search_box): ?>
        <div id="search-box"><?php print $search_box; ?></div>
      <?php endif; ?>

      <?php print $header; ?>

    </div></div><!-- /.section, /#header -->

    <div id="main-wrapper"><div id="main" class="clearfix<?php if ($primary_links || $navigation) { print ' with-navigation'; } ?>">
	
		<div id="navigation"><div class="section clearfix">

          <?php print $navigation; ?>

        </div></div><!-- /.section, /#navigation -->

      <div id="content" class="column"><div class="section">

        <?php if ($mission): ?>
          <div id="mission"><?php print $mission; ?></div>
        <?php endif; ?>

        <?php print $highlight; ?>

        <?php print $breadcrumb; ?>
        <?php if ($title): ?>
          <h1 class="title"><?php print $title; ?></h1>
        <?php endif; ?>
        <?php print $messages; ?>
        <?php if ($tabs): ?>
          <div class="tabs"><?php print $tabs; ?></div>
        <?php endif; ?>
        <?php print $help; ?>

        <?php print $content_top; ?>

        <div id="content-area">
          <?php print $content; ?>
        </div>

        <?php print $content_bottom; ?>

        <?php if ($feed_icons): ?>
          <div class="feed-icons"><?php print $feed_icons; ?></div>
        <?php endif; ?>

      </div></div><!-- /.section, /#content -->

      <?php print $sidebar_first; ?>
	  
      <?php print $sidebar_second; ?>

	  <?php print $content_bottom_left; ?>

	  <?php print $content_bottom_right; ?>
	  
    </div></div><!-- /#main, /#main-wrapper -->

    </div></div><!-- /#page, /#page-wrapper -->

jhodgdon’s picture

Search by Page does not care about your theme's page.tpl.php or html.tpl.php markup. It cares about what gets into the 'content' region of the page in D7, and what gets put into what Drupal defines to be the "main page content" in D6 -- e.g., the output of something like node.tpl.php, or whatever theme template/function is generating the "main page content" (which gets passed to page.tpl.php as $content I think?) -- not the output of page.tpl.php.

jhodgdon’s picture

Issue summary: View changes
Status: Active » Closed (won't fix)

This already works in 7.x and at this point, I am not going to do development on 6.x features of this module. Sorry.