Let me start by saying thanks for considering Toolset for your project. What I'm seeing here is fairly complex, and it's difficult for me to definitively say "Yes" or "No" for each piece of the application, and it's very difficult for me to say "this is the best way to set it up". In my experience, it's best to try to replicate any system on a very small scale so that you can see what is or is not possible. When you get stuck, create a ticket to discuss your options for implementing individual features. It's just not practical for us to consider all the possible options and functionality in a single ticket - each answer opens up 10 new questions and the ticket becomes difficult to follow. With that being said, please find my general answers to your questions below. I do encourage you to set up a trial and create individual tickets for each issue so we can explore in more detail.
1- You start with a search bar where you can search for a word in one of the Bible translations in the dropdown menu.
Okay I assume this is a custom search View with text search filter and a custom field filter. To start with an empty result set, you may need to add some custom code. I have a sample you can use:
add_filter( 'wpv_filter_query', 'drop_empty_search_query', 10, 3 );
function drop_empty_search_query( $query_args, $view_settings, $view_id ) {
$ids = array(1, 2, 3);
if (in_array($view_id, $ids)){
if ( isset($_GET['wpv_post_search']) && $_GET['wpv_post_search'] != '' )
{
} else {
$query_args['post__in'] = array(0);
}
}
return $query_args;
}
This code checks the URL parameter wpv_post_search. If the URL param is present, it means some search term has been submitted and results should be displayed. If not, no results should be displayed. We support this filter here in the forum, but customization not directly related to the API might require extra development.
2- you can choose a Bible book from a menu that opens when you click "Bible Book List"
We can help you set up a View that shows all the possible books in a list like this, but using these list items as triggers to show or hide other portions of the screen will require your own custom interface design and code. That falls outside the scope of what we provide here in the forums.
3- Say you chose "Genesis", another menu opens with the specifi number of chapters related to Genesis:
We can help you set up a View that shows all the possible chapters in a selected book, but showing and hiding these elements based on your selections will require custom code.
Here you see a page with the Text of Genesis 9 and version "KJV".
you can then change the version from the dropdown list to "New English Translation (NET)"
It's possible to set up a View that allows the User to filter posts by a custom field, so you could use a custom field on these posts to define a translation version. You would also need some way to limit the results to just the translations of this specific chapter. To do that, you could filter by slug or post title or a different custom field. The links you set up on the main menu can be constructed in a way that directs the User to the correct URL. There are lots of moving parts here, and this answer is very general.
5- you can click on this icon to open a passage comparison tool:
Something exactly like this will require a good deal of custom code that we do not provide or support here in the forums. Here's what we can accomplish:
- Use URL parameters to determine which 2 translations should be displayed
- Use a View to display 2 translations
- Use a View to display a single translation
- Create links to navigate between the comparison layout and the single translation layout
Here's what is not as simple:
- Using a single variable "&version=NIV;KJV" to determine the layout of the page, whether to show a single version or compare two versions. You may need some custom PHP code to help with this. If the URL parameter structure is flexible, we can probably come up with a solution that does not require additional PHP.
where you can compare 2 different translations:
hidden link
and change the translation you want.
I'm not sure I understand what you mean to change the translation you want. If this means that you just want to redirect to the single translation layout with this translation displayed, then this is possible without any custom code.
- shall I create a post per chapter in each translation? this will be thousands of posts.
- shall I create one post per chapter that has multiple custom fields to fill?
Separate posts - this makes searching and filtering posts easier, but there will be more posts in your database and in wp-admin. This can slow down your site as the number of posts grow, but a good caching plugin can help with that problem.
Different custom fields - This approach is less flexible for text-based searching and View filtering, but there will be fewer posts in your wp-admin and database. I recommend setting up some custom search Views to see what you can accomplish and observe the limitations of each approach.
- I know that there is a search bu url parameter in the Views plugin, but how to utilize it in this way?
Views can use URL parameters to define filter conditions without any extra code needed. If you need to access URL parameters outside of PHP you can use this shortcode:
add_shortcode( 'wpv-post-param', 'wpv_post_param_shortcode' );
function wpv_post_param_shortcode( $atts ) {
if ( !empty( $atts['var'] ) ) {
$var = (array)$_GET[$atts['var']];
return esc_html( implode( ', ', $var ) );
}
}
For example, to access the value of the "testing" URL parameter in a conditional or in your page content:
[wpv-post-param var='testing'] (this will print 123 to the screen)
[wpv-conditional if="([wpv-post-param var='testing'] eq '123')"]
do something if the parameter is '123'
[/wpv-conditional]
If you need to do any parsing of URL parameter values beyond simple "equals", this will require additional code that falls outside the scope of our support forum. For instance, in the URL structure you currently use, multiple values are separated by a semicolon like variable=abc;def. This exact URL format isn't supported, but if it's okay to be flexible we could come up with another approach.