backdrop-contrib / views_bootstrap

This module provides a set of styles for the Views module. It allows you to create responsive Bootstrap 3.x components, such as grids, carousels, tabs, and tables, all within the configuration settings of the powerful Views module.
https://backdropcms.org/project/views_bootstrap
GNU General Public License v2.0
0 stars 7 forks source link

Put plugins and templates back into folders like in D7 #11

Closed herbdool closed 5 years ago

herbdool commented 6 years ago

It's just a lot neater and more organized. Plus easier to see if the Backdrop version is same or differs from D7 version.

Radcliffe commented 5 years ago

My attempt to move the files was unsuccessful because I don't quite understand how to specify the new locations in the code. Can someone help?

herbdool commented 5 years ago

You might need hook_theme https://api.backdropcms.org/api/backdrop/core%21modules%21system%21system.api.php/function/hook_theme/1 to register the templates. I'm not sure if it has it already.

Radcliffe commented 5 years ago

I don't know how to do this. The Drupal 7 module has templates in subdirectories, but it does not implement hook_theme. I would be grateful for a pull request.

stpaultim commented 5 years ago

I think I got this. I've submitted a PR https://github.com/backdrop-contrib/views_bootstrap/pull/25 and merged it into DEV branch. I have not tested extensively, but this PR does not break my test view with a views_bootstrap accordion. I edited the views_bootstrap.views.inc file to include the proper location to the template file. See example:

function views_bootstrap_views_plugins() { .... 'theme path' => $module_path . '/templates/thumbnail',

stpaultim commented 5 years ago

OK, I may have merged this into DEV branch prematurely. I'm hearing reports that it may still be broken. Will do additional testing today.

stpaultim commented 5 years ago

Steps to reproduce warning message:

Warning: include_once(): Failed opening '/app/modules/views_bootstrap/templates/table/views_bootstrap.views.inc' for inclusion (include_path='.:/usr/local/lib/php') in include_once() (line 574 of /app/core/includes/theme.inc).

Warning: include_once(/app/modules/views_bootstrap/templates/accordion/views_bootstrap.views.inc): failed to open stream: No such file or directory in include_once() (line 574 of /app/core/includes/theme.inc).

I am still able to generate a view using a views_bootstrap accordion

stpaultim commented 5 years ago

OK, we need some help. the goal was to move all the tpl.php files into a subdirectory. In fact, we have them in individual sub/sub directories. Now that we've done that, we're getting these warning messages that Backdrop can't find the views_bootstrap.views.inc. We left this file in the root directory, but Backdrop seems to be looking for it in individual template directories.

Can anyone offer any advice on whether or not the current file structure for the template files is appropriate and how we should handle defining the paths so that backdrop can find both:

views_bootstrap/views_bootstrap.views.inc AND views_bootstrap/templates/table/views-bootstrap-table-plugin-style.tpl.php

Note: In it's current state, the module is working but we are getting these warning messages.

stpaultim commented 5 years ago

PR #26 seems to resolve the issues. Thanks to @daggerhart !