Configuring RedPress for WordPress integration¶
Copy redpress.yml
from the plugin’s config
directory to the Redmine’s config
directory.
Modify the content of this file:
production:
wordpress:
base_url: http://wordpress.example.com
menu:
replace_home: true
global_blog: http://wordpress.example.com/blog
project_blog: http://wordpress.example.com/project/%s
profile_page: http://wordpress.example.com/author/%s
search_page: http://wordpress.example.org/search
share_cookie:
domain: .example.com
path: /
development:
By default WordPress' landing page and blog index is the same page (containing the blog index, actually). But often WordPress users prefer having a different landing page (e.g., with some introduction).
The replace_home
option, if set to true
, will replace the Redmine's home page (pointed to by the "Home" link) by the WordPress' landing page.
If you use the replace_home
option to have the "Home" link point ot the WordPress' landing page, which is not the blog index, you may want to have a special menu item pointing to the blog index as well. In this case (and in the case, when you define a different landing page for WordPress) you need to create a page in WordPress, which will play the role of the blog index.
For this (assuming, that you use the RedWord):
- In WordPress administration open the "Pages" section and click the "Add new" menu item.
- Choose the "Blog" template for the page.
- Assign the page title.
- Optionally, assign the page slug (e.g., to
blog
) and disable comments. - Now open the "Settings" section and click the "Reading" item.
- Choose the just created page as the "Posts page".
- Optionally, choose another page as the "Front page".
Now set the global_blog
option to the URL of the blog index (preferably, use the slug name as in the example above).
For the project_blog
option you also need to:
- Install and configure the WordMine plugin for WordPress.
- Enabled the "Blog" module for the project.
The search_page
option should be used only if you have configured WordPress to provide the search page.
Here is how it can be done:
- In WordPress administration open the "Pages" section and click the "Add new" menu item.
- Use
search
as the slug name of the page. - Assign the title of the page to, e.g., "Search".
- Optionally, disable comments.
Use the URL of this page for the search_page
option.
Why a system file for configuration?¶
You may ask, why did I decide to use a system file for configuration, and not the "Configure" page of the plugin...
There were several reasons for this:
- Some options are checked by the plugin too early, during its loading, i.e., when the standard plugin configuration can be not loaded yet. Moreover, even the default plugin settings can be unavailable at that stage.
- If the
share_cookie
option is used, the plugin alters the Rails session generation algorithm, what should be done only at the loading stage! - Some options require Redmine restart. Generally, it would be odd to ask the user to restart the application after modifying settings under Plugins -> Configure (what also can't be done from web UI).