[pmwiki-users] search results and pagelist
Patrick R. Michaud
pmichaud at pobox.com
Thu Mar 1 19:26:38 CST 2007
On Fri, Mar 02, 2007 at 12:25:15AM +0000, Francis Casson wrote:
> Sorry, I should have made the question clearer - I was already aware of
> most of what you wrote. My question was about how to use a different
> default template for searches than for pagelists. Perhaps a conditional
> markup in the #default PagelistTemplate would do it (something like. (:if
> search:)), or would we need some extra php in config.php?
Oh. In the Site.Search page, add a fmt= parameter to the (:searchresults:)
will use the [[#search]] template when displaying search results. In fact,
(:searchresults:) is just a slightly different form of the (:pagelist:)
directive, so all of the arguments available for pagelists can also be
used for searchresults.
> On 01/03/07, Patrick R. Michaud <pmichaud at pobox.com> wrote:
> > On Thu, Mar 01, 2007 at 11:35:01PM +0000, Francis Casson wrote:
> > > Is there a way to specify a different default PageListTemplate for
> > > searches and pagelists?
> > Yes.
> > The fmt= parameter to (:pagelist:) can specify a page, a section
> > within a page, or a simple section. For example:
> > fmt=PageXYZ - uses all of PageXYZ as the template
> > fmt=PageABC#xyz - uses the [[#xyz]] section on PageABC as the
> > fmt=#xyz - searches for an [[#xyz]] section in the current
> > Site.LocalTemplates, and Site.PageListTemplates,
> > using the first one it finds
> > So, if you want to have customized templates for your site, simply
> > add them to Site.LocalTemplates or as custom pages, and then use
> > the fmt= parameter to refer to them.
> > If you define a [[#default]] template in Site.LocalTemplates, then
> > pagelists and searches will use that template by default. (Note that
> > pmwiki.org does this -- see
> http://www.pmwiki.org/wiki/Site/LocalTemplates .)
> > Hope this helps.
> > Pm
> pmwiki-users mailing list
> pmwiki-users at pmichaud.com
More information about the pmwiki-users