Skip to content

fipasoft/mediagoblin-basicsearch

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 

Repository files navigation

mediagoblin-basicsearch

This plugin adds support for displaying media in Gnu MediaGoblin based on simple search queries. In its current state, the search function will query the title and description fields of processed media entries for the exact input phrase (case-insensitive). Multiple search terms are not supported at this time.

This plugin relies on the header_extra template hook which was introduced in the MediaGoblin 0.7.2-dev codebase. If you're running a previous version of Gnu MediaGoblin, the search link will not appear on your instance unless you apply the change in the following commit.

https://gitorious.org/mediagoblin/mediagoblin/commit/aa50cab0dcfcdc3606893b6cbded4227190f8980

Set up the search plugin

  1. Clone the search plugin repository from GitHub.

    $ git clone https://github.com/ayleph/mediagoblin-basicsearch.git
    
  2. Copy the basicsearch folder to your MediaGoblin plugin path.

    $ cp -r mediagoblin-basicsearch/basicsearch /path/to/mediagoblin/mediagoblin/plugins/
    
  3. Enable the mediagoblin-basicsearch plugin by adding the following line to the [plugins] section of your mediagoblin_local.ini file.

    [[mediagoblin.plugins.basicsearch]]
    
  4. Restart your MediaGoblin instance for the config file changes to be effective.

Configure the search plugin

The search plugin adds a search link to the top header bar of the MediaGoblin instance. You may specify the display style of the search link in your mediagoblin config file. There are three options for the search link display style.

  • link displays a normal text link next to the Log In link. This is the default display style.
  • button displays an action button link next to the Log In link.
  • none does not display a link. This is useful if you want to create your own search link in a user_dev template or custom theme.

If you choose to specify the display style, add it to your mediagoblin_local.ini like this.

[[mediagoblin.plugins.basicsearch]]
SEARCH_LINK_STYLE = 'link'

If you choose style none and wish to create your own search link, use the syntax below as a guide.

<a href="{{ request.urlgen('mediagoblin.plugins.basicsearch') }}">
{%- trans %}Search{% endtrans -%}
</a>

About

Search plugin for Gnu MediaGoblin

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 57.8%
  • HTML 42.2%