Hello everyone,
I have a quick question regarding Bootstrap and a Drupal theme I am developing and planning to add to drupal.org. The theme uses Bootstrap, and I was wondering what the rules are regarding including the Bootstrap CSS and JS files within the theme itself. Is this acceptable to do? Or do I need to leave it out and instruct users to manually download it and add the files in the necessary folder within the theme like I have seen some other Bootstrap themes on drupal.org do?
Thank you very much.
Brad
Vielen Dank für Ihre Nachricht. Zurzeit bin ich abwesend und werde ab dem 15. Oktober 2012 wieder für Sie da sein.
In der Zwischenzeit steht Ihnen Herr Ivan Schmid - ivan.schmid(a)comvation.com - gerne zur Verfügung.
Freundliche Grüsse
Urs Löhnert
Hy!
Altough key in hook_menu is 'page callback', it does not mean
page.tpl.php. Rather you're changing content for <?php print
render($page['content']); ?> inside page.tpl.php
You could use hook_theme_registry_alter to change the location of this template.
function mymodule_user_dashboard_theme_registry_alter(&$theme_registry) {
$path = drupal_get_path('module', 'mymodule_user_dashboard');
// Alter the path for page.tpl.php
if (isset($theme_registry['page'])) {
$q = explode('/', $_GET['q']);
if ($q[0] == 'dashboard') {
$theme_registry['page']['path'] = $path . '/templates/dashboard';
}
}
}
Note that dashboard in $theme_registry['page']['path'] = $path .
'/templates/dashboard'; is a folder. I don't know how to change
template name here. Don't think it's really needed either.
Does this help?
--
Hannes
On Mon, Sep 10, 2012 at 3:00 PM, <themes-request(a)drupal.org> wrote:
> Send themes mailing list submissions to
> themes(a)drupal.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
> http://lists.drupal.org/mailman/listinfo/themes
> or, via email, send a message with subject or body 'help' to
> themes-request(a)drupal.org
>
> You can reach the person managing the list at
> themes-owner(a)drupal.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of themes digest..."
>
> Today's Topics:
>
> 1. Replicating page.tpl.php in D7 (Jeff Greenberg)
>
>
> ---------- Forwarded message ----------
> From: Jeff Greenberg <listmail.ayendesigns(a)gmail.com>
> To: Themes <themes(a)drupal.org>
> Cc:
> Date: Sun, 9 Sep 2012 19:13:33 -0400
> Subject: [themes] Replicating page.tpl.php in D7
> I have the following code in my module in D7. My intention is to have my custom template loaded in place of page.tpl.php for this specific page, and to have the template file in the module directory rather than having page--mypage.tpl.php in the theme directory.
>
> The problem I'm running in to is that after the template is loaded, it complains that none of the page variables (logo, etc) exist. I realize that my arguments array is empty in the code, but in looking around (in all the wrong places, apparently) I can't figure out what to pass.
>
> function mymodule_user_dashboard_menu() {
> $items = array();
>
> $items['dashboard/%user_uid_optional'] = array(
> 'page callback' => '_mymodule_user_dashboard_template',
> 'page arguments' => array(1),
> 'access arguments' => array('access content'),
> 'type' => MENU_CALLBACK,
> );
>
> return $items;
> }
>
> function _mymodule_user_dashboard_template() {
> return theme('mymodule_user_dashboard_template');
> }
>
> function mymodule_user_dashboard_theme() {
> $themes = array(
> 'mymodule_user_dashboard_template' => array(
> 'template' => 'templates/dashboard',
> 'arguments' => array(),
> )
> );
>
> return $themes;
> }
>
> --
> ---
> drupal.org/user/367108
> linkedin.com/in/jeffrgreenberg
> accidentalcoder.com / ayendesigns.com
> @accidentalcoder
>
>
> _______________________________________________
> themes mailing list
> themes(a)drupal.org
> http://lists.drupal.org/mailman/listinfo/themes
>
I have the following code in my module in D7. My intention is to have my
custom template loaded in place of page.tpl.php for this specific page, and
to have the template file in the module directory rather than having
page--mypage.tpl.php in the theme directory.
The problem I'm running in to is that after the template is loaded, it
complains that none of the page variables (logo, etc) exist. I realize that
my arguments array is empty in the code, but in looking around (in all the
wrong places, apparently) I can't figure out what to pass.
function mymodule_user_dashboard_menu() {
$items = array();
$items['dashboard/%user_uid_optional'] = array(
'page callback' => '_mymodule_user_dashboard_template',
'page arguments' => array(1),
'access arguments' => array('access content'),
'type' => MENU_CALLBACK,
);
return $items;
}
function _mymodule_user_dashboard_template() {
return theme('mymodule_user_dashboard_template');
}
function mymodule_user_dashboard_theme() {
$themes = array(
'mymodule_user_dashboard_template' => array(
'template' => 'templates/dashboard',
'arguments' => array(),
)
);
return $themes;
}
--
---
drupal.org/user/367108linkedin.com/in/jeffrgreenbergaccidentalcoder.com / ayendesigns.com
@accidentalcoder