I hope this is the right place to post this...Playing around with creating a Marinelli subtheme off of 7.x-3.0-beta4. Coped the subtheme folder and renamed, etc., and then copied the page.tpl file and got it working. When I tried to move the Primary Menu code below the rotating banners (just a straight copy-and-paste of the if statement and div), the advertisment region now shows three banners as active, stacked atop one another over the entire page. I don't see anything obvious that would make this happen. Is this a bug, or am I just too inexperienced and unread as to the intracacies of the theme? Is there a way to make this work? Thanks, and sorry again if this is the wrong place to post this.
Comment | File | Size | Author |
---|---|---|---|
#13 | screenshot.png | 694.63 KB | dwalker51 |
#3 | marinelliscreen.jpg | 25.38 KB | ManchesterNewsGuild |
Comments
Comment #1
Lioz CreditAttribution: Lioz commentedCan you please attach your version of the page.tpl.php?
Comment #2
ManchesterNewsGuild CreditAttribution: ManchesterNewsGuild commentedWill do as soon as I get access. It's on a local test site and I'm away from that. Thanks for responding.
Comment #3
ManchesterNewsGuild CreditAttribution: ManchesterNewsGuild commentedHi. Below is the code for the page.tpl I copied from the Marineli folder into my subtheme. It works properly as it was originally written, and is stock code out of the box except for my two cut-and-pastes, which break it. As indicated below, all I did was cut the if statement and div code for the main menu, and paste it where the secondary menu originally appears, and cut and pasted the secondary menu from where it originally appears and pasted it where the main menu used to be. I thought that would simply flop the menus (above and below the rotating advertisement div). It did, but it also breaks the banner rotation, and all of the banners appear, stacked atop one another down the page, with the page now floated flush left with the browser window. I don't get why that would happen, and would appreciate some advice. Can the main menu even be moved? Why would that break the cycle code? I've attached a screen shot. Thanks
Comment #4
Lioz CreditAttribution: Lioz commentedComment #5
ManchesterNewsGuild CreditAttribution: ManchesterNewsGuild commentedHello, Lioz. I see you postponed as needing more info, but don't say what you need. But here is some more info I've inadvertently discovered while posting the code you asked for, and it appears there is a bug (or two) somewhere in the code (perhaps a path somewhere? I'm not a coder...just learning by sight). Anyway:
In recreating a subtheme and page.tpl last night (I had given up and deleted it and moved on to work with another theme), I inadvertently renamed the Marinelli subtheme folder, and .info file, etc., to my_theme while it was still within the main Marinelli folder. Within that my_theme folder, I created a folder called templates, and copied the original page.tpl into that, and made my changes as posted above. Only then did I copy the whole shebang outside the Marinelli folder, as one should do to properly create a subtheme. When I enabled the subtheme, it broke the banner rotation as described above.
This morning, I went into my subtheme and disabled the quirky page.tpl by renaming it pagexx.tpl, refreshed the theme by visiting the appearance page and saving, and cleared the cache, and voila, when I went to my home page, my changes had taken and the banner was rotating. Puzzled, I poked around, as disabling my subtheme page.tpl should have defaulted to the original in Marinelli. Lo and behold (but a bug), drupal was now reading the page.tpl in the renamed and inadvertently left behind subtheme folder WITHIN the Marinelli main folder!
In sum, the code works, and you can move the main menu below the rotating banner, IF your subtheme REMAINS in the Marinelli folder. Good news, but not the way a subtheme is supposed to work.
However, I then noticed that this only works for the logged-in administrator. If not logged in, or logged in as just an authenticated user, the paths to the banners is wrong and they don't appear, although their titles do. Hope this helps somebody else, and allows someone with more skill than I currently have to perhaps fix the code. Please let me know. Thanks
Comment #6
openworldstudios CreditAttribution: openworldstudios commentedI am having the same issue as well. The error occurs from the placement of the new page.tpl file, not any specific changes in it. Has anyone found a fix yet?
Comment #7
Eric B. CreditAttribution: Eric B. commentedI'm also having the same issue. As soon as I move the page.tpl.php to the subtheme folder, the rotating banner breaks.
Comment #8
Jose_ibi CreditAttribution: Jose_ibi commentedHi! I'm having the same issue too. When I moved page.tpl.php to the subtheme folder, the banner breaks.
Comment #9
ClaudeS-1 CreditAttribution: ClaudeS-1 commentedI've encountered the same problem (the rotating banner breaks), and here's what I've found:
- without page.tpl.php in your subtheme/templates folder, the return value for "path_to_theme()" (in banners.inc) is "marinelli"; thus it correctly loads the banner's cycle.js from the marinelli/js folder
- when you add page.tpl.php to your subtheme/templates folder, the return value changes to the name of your subtheme, so it tries to load the JS from your subtheme/js folder - if you haven't copied the JS files across, the banner won't work.
Now I'd rather not have to copy everything into my subtheme, but I'm new to Drupal so don't know if you can do something to resolve this issue of whether the path_to_theme should be the parent or subtheme depending on circumstances...
What's strange is that all the other times path_to_theme() is called, it returns the parent (marinelli), only in banners.inc does it return the subtheme name...
Comment #10
dkendall CreditAttribution: dkendall commentedIt seems even after moving the js files there are issues with the basic css as well. Has anyone figured out how to subtheme this without making a complete copy?
Comment #11
BillyIdle CreditAttribution: BillyIdle commentedYou're mostly right, ClaudeS. path_to_theme() seems to be the problem, but it fails everywhere except inside template.php. Is this a bug and if so, is it in the theme or in Drupal 7? Anyone have a workaround, except duplicating the js and css dirs?
Comment #12
yesmathew CreditAttribution: yesmathew commentedIs it possible to make different banners for different subthemes?
Comment #13
dwalker51 CreditAttribution: dwalker51 commentedDon't want to hijack the thread, so if I do, please excuse me.
I have a very similiar problem, though I did not move the primary links. There was a beta9 version running as I liked, though I had edited before learning about subthemes.
I have decided to move to a subtheme to avoid upgrade problems. So what I did was the following:
This has been done a few time on the theme before so I have seen the repeated banners before on top of my pages. So this time I removed all but one image before I started.
I saved my previous theme.
downloaded the beta11 version
enabled it, then copied out the subtheme, called it noao, changed the info file to noao.info and edited it.
I then enabled it as the default and I get my theme working. Due to changes in the CSS I copied my old css directory into the subtheme and de-commented the noao.info file, like so (it has two extra regions that I added):
I then needed to disable some of the blocks on my site, disabled the primary and secondary menu since I am using nice_menus.
I had added a footer image so I also copied my old img directory
Voila!! All looked great, but now I need to add more of my original banner images, I added one and once again I have the banners one after the other.
Not quite sure how to proceed, do I need to copy the js directory as well? I am Confused.
Once again I apologize if this is not quite the same problem, I will open another thread if need be.
Comment #14
Tabestan CreditAttribution: Tabestan commentedI added the content of marinelli/logics to my subtheme and it worked but I agree, it's not a proper way to do it and I wonder about updates.
Still that theme is awesome.
Comment #15
schuffr CreditAttribution: schuffr commentedI am having the same issue with version 7.x-3.0-beta11. I haven't yet seen where this is being addressed. Any update on the status
Comment #16
Carlos Miranda Levy CreditAttribution: Carlos Miranda Levy commentedI renamed the title to reflect the actual problem, updated the version as the issue remains on 7.x-3.0-beta11 and changed the Component to code as it's a coding issue.
I can confirm that copying the css, logics and js folders to the subtheme folder fixes the problem, regardless of the location of the subtheme folder.
Comment #17
vernma CreditAttribution: vernma commentedThe workaround indicates you need to define your sub-theme under the Marinelli folder, contrary to Drupal form.
I found this when I tried to do what everything else wanted, move the ads above the menu.
This seems to be a pretty major problem. Why is there no fix after all these months and versions?
Comment #18
ChristianAdamski CreditAttribution: ChristianAdamski commentedI want to add, that having a
[SUBTHEMENAME]_preprocess_page()
function in your template.php also causes thepath_to_theme()
to redirect to your subtheme folder, which breaks paths for the JS-files needed for the banner.