eZ Community » Forums » General » 2012.5 > multisite search engine
expandshrink

2012.5 > multisite search engine

2012.5 > multisite search engine

Thursday 14 June 2012 3:23:08 am - 2 replies

Hi @ all, i installed the ezdemo extension with ezcommunity 2012.05.

how can i bind the search field for a siteaccess???

i have a multisite installation:

www.myurl.com

soniqbookings.myurl.com

djndagemoon.myurl.com

the search results are the same for the 3 siteaccess... what can i do that the search result for soniqbookins looks only notes from node-id: 200?

thanks @ all...

Modified on Thursday 14 June 2012 3:23:42 am by Michael Lo

Thursday 14 June 2012 8:00:25 am

Hi Michael,

If you have a multisite installation, you have to define the root node. In order to do this, you can use this code:

 {def $sub_node_id=ezini("NodeSettings","RootNode","content.ini")}
 <div id="topSearch">
  <form id="searchform" action={"/content/search"|ezurl}>
    {if $pagedata.is_edit}
      <input id="s" name="SearchText" type="text" value="" disabled="disabled" />
    {else}
      <input type="hidden" name="SubTreeArray" value="{$sub_node_id}" />
      <input id="s" name="SearchText" type="text" value=""  />
    {/if}
  </form>
 </div>

 

Pour les membres français de la communauté, la réponse est aussi là :

http://blog.agenceyuzu.fr/eZ-Publish/Astuce-de-la-semaine-2

 

Best regards !

Thursday 14 June 2012 8:19:39 am

Hi Michael,

i summarize you have an ezinstallation with 1 DB and 3 Siteaccesses. Each siteaccess has its own subtree. SA1 has no access not SA2 so if you call   ez.test/sa1/content/view/full/$node_sa2 you get an access denied.

I think the last did not work at the moment on your installation, because you said the search is always the same in sa1, 2, 3.

You should have a look to your roles and policies. If you have a separate anonymous user for each siteaccess you could assign the read roles by siteaccess subtree.

Anonymous1  assign anonymousrole  by subtree sa 1

Anonymous2  assign anonymousrole  by subtree sa 2

Anonymous3  assign anonymousrole  by subtree sa 3

You have to define the anonymous user id in the site.ini.append.php of sa1, sa2, sa3.

 [UserSettings]
 # The ID of the anonymous user, this user will
 # be used for everyone who is not logged in.
 AnonymousUserID=123

If the right are ok - the search should be only show the correct result, even the search will done over the whole tree. But to the limitation to the subtree should be done also.

Hope this post is usefull for you

Cheers Felix

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from