HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS, which is now in beta. ocPortal 9 will be superseded by Composr 10.

Head over to compo.sr for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.


Options/Defaults for Search Block?

Login / Search

 [ Join | More ]
 Add topic 
Posted
Rating:
#60510 (In Topic #13138)
Avatar

Well-settled

Hi there,

I'd like to use the main_search block and found that comcode pages are not searched by default. How can I include comcode pages by default and secondly, how can I include the forums as well? I do not need or want to search all possible content types, just a few, but those few without having to use the advanced search. I guess there are block parameters to include multiple zones and content types, but the Advanced Pages tutorial didn't help.

Have a nice one,
Peter
Back to the top
 
Posted
Rating:
#60511
Avatar

Does the Add Block tool tell you? That's more up to date nowadays.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#60512
Avatar

Well-settled

The Add Block tool allows me to restrict to just one hook type, and its advanced settings allow adding of additional search fields to the advanced search. The code for a default block looks like so:

Code

[block input_fields="content=Search for" zone="_SEARCH" sort="relevance" days="-1" direction="DESC" conjunctive_operator="AND"]main_search[/block]
Long shot: I think I'm missing a parameter here, something like "hooktype=comcode_pages,downloads,news". Does anything like that exist? If it doesn't and there is no other way: Can I change the default ticks/unticks on the advanced search page to include comcode pages by default?


Last edit: by Lowlander
Back to the top
 
Posted
Rating:
#60533
Avatar

Hi,

In the Add Block tool, it's true that it will only let you select one. However actually you can use comma separation on the limit_to field that that sets. I suggest you add one block for each content types, so you can see all the codes, then pull the codes together into limit_to via comma-separation.

We'll work on the usability here.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#60558
Avatar

Well-settled

Chris,

a comma separated list with the limit_to parameter did the trick. Thanks alot!

I didn't have to create search blocks to determine the possible content type codes, as the codes appear in the block wizard's pulldown list and can easily be written down or remembered from there.
Back to the top
 
There are too many online users to list.
Control functions:

Quick reply   Contract

Your name:
Your message: