I've just installed the Sections module, as it sounded very promising. However, I encountered some problems.

I created two sections and attached Bluemarine to one and Chameleon to the other. However, when opening any of the urls associated to the two sections, the theme that appeared kept being Pushbutton, which is the default theme for my Drupal installation.

I checked the database, and the data relative to the various sections (Name, associated Paths and wanted Theme) is indeed stored correctly in the database, so I have no idea why the wanted Theme doesn't show up when those urls are accessed.

I hope this gets fixed--this module sounds great, it would make Drupal so much more flexible.

Comments

Bèr Kessels’s picture

Could you tell me more, please?

Are the other themes installed and "activated"? Dot they work by deafult? What Drupal Version are you running? Do you have clean paths enabled? etcetc. That will help me look into your prblem better,

Bèr

Anonymous’s picture

In administer->themes, Bluemarine, Chameleon and Pushbutton are all enabled, and Pushbutton is my default. All the themes work without any kind of problems if I make them the default theme in administer->themes.

I'm running the latest official Drupal version, 4.5. I do have clean urls enabled, and I have the path module installed as well; however, the urls I tried the Sections module with were all standard Drupal urls (e.g. node/add/*), not aliased in any way.

I'm running Drupal on my local machine, which runs MacOS X Panther. I've tried the Sections module with Firefox 1.0, Safari 1.2, Netscape 7.1 and Explorer 5.2, and it worked in none of the browsers, so I don't think it's a browser-related issue (I have no idea whether it could be a browser-related issue, but since you wanted more info I'm providing all that is crossing my mind).

In admin/user/configure/permission I have granted permission to "administer sections" for Sections module to authenticated users, and I'm doing all the testing as the first (and only) authenticated user.

If there's any other info you need, just ask me. :)

I also wanted to thank you for taking the time to develop such a module! It's a great idea.

inteja’s picture

I have the same issue.

Drupal cvs, 3 themes enabled. 2 sections set up. No errors but also no themes per section. Tried toggling clean paths and caching. Cleared cache. No effect.

inteja’s picture

I did some hacking around and I think it's an issue with the regular expressions and/or the PHP version (I'm running CGI version 4.3.2 on Apache 2.046).

I added an echo statement at line 272 echo "<h1>no match</h1>";, which should only print if the regular expression didn't find a match between the section path and current url path. It printed "no match" every time, even when accessing one of my defined sections.

inteja’s picture

OK. I found the problem. I (and I suspect Anonymous above) have Drupal installed in a sub-folder of our web domains (e.g. www.mydomain.com/beta/). I'm not a regex expert so I don't know how to elegantly solve the problem, but when I added the line:

265 $url = substr($url, 5);

... this strips the /beta/ part of the url (in my case only) and then the sections.module works flawlessly.

I'm sure someone can come up with an elegant fix.

Bèr Kessels’s picture

dear anonymous #2, are you running drupal in a subdiretory too? If so, than we found the issue.

The thing is, that I took the logick literally from the blocks system. So if they do not work for sections, the blocks will be broken too!

dansuade’s picture

Yes... I am also having the same problem and is testing in a subdirectory...So I think this is the problem... How do I fix it for a directory like: http://www.mydomain.com/dir1/dir3/dir3.

I too must add my thanks for your efforts on this module . Look very very promising. More grease to your elbows.
Dan.

Bèr Kessels’s picture

Since I have no access to a subdirred Drupal ATM id like wome help:
PLEase take this "form" and answer all questions and post it back, with comments inbetween.

1) in a sections settings use node/X instead of /node/X (preceding slash)
.....
2) in a sections settings use /node/X instead of node/X
.....
3) in a sections settings try
.....
4) try sections without clean urls
.....

Thanks a lot, together we will get this module ready for a 4.5 release!

Bèr Kessels’s picture

3) in a sections settings try <front>

inteja’s picture

1) in a sections settings use node/X instead of /node/X (preceding slash)

Didn't work.

2) in a sections settings use /node/X instead of node/X

Didn't work.

3) in a sections settings try <front>

Didn't work.

4) try sections without clean urls

Didn't work. Tried both.

Your questions prompted me to try prefixing the path with the folder that Drupal is installed in and this worked!

So, if Drupal is installed at www.mydomain.com/subfolder/, to create a different section for blogs I simply used subfolder/blog/*

Hope this helps.

inteja’s picture

BTW: I tested your theory about the blocks module and it is not as you expected. Blocks can be shown only on specific pages by simply using the path, not the path prefixed by the sub-folder Drupal is installed in.

Bèr Kessels’s picture

No, not the 4.5 block paths. In HEAD (just after 4.5 was released) a whole new concept of blocks admin was introduced. My sections mimics the UI of this new blocks admin as close as possible. I reused a lot of code from that blocks system too.

Anonymous’s picture

Yes! I do have Drupal installed in a subdirectory too! :) It's good to know why it isn't working.
Also, my form:

1) in a sections settings use node/X instead of /node/X (preceding slash)
Not working.

2) in a sections settings use /node/X instead of node/X
Not working.

3) in a sections settings try <front>
Not working.

4) try sections without clean urls
Not working.

I also followed brianh's suggested and tried prefixing the path with the folder that Drupal is installed in.
This worked most of the times! :D It doesn't work with <front>, though.

I also noticed something. To make it work with paths like node/add/*, you have to input data this way:

drupalSubdir/node/add
drupalSubdir/node/add/*

Using drupalSubdir/node/add/* alone doesn't work.

inteja’s picture

Ber, yes I'm using Drupal CVS so I know the blocks admin you are referring to (configure link rather than a text box) and I also found the relevant regex code in the new blocks module that you've utilized. There must be something different between the two.

Bèr Kessels’s picture

brianh: youmean that in blocks the paths etc like &ltfrong> work, even on a subdirred Drupal installation?

Regards, Ber

inteja’s picture

Yes, exactly.

Anonymous’s picture

is all good now?

Bèr Kessels’s picture

this issue is very old, the recent pathces to fix some regexp issues should have solved this. closing.

please re-open if you still have this bug.

Anonymous’s picture

I have drupal installed in a subdirectory called "drupal", and since you said the last patches should fix this problem, I downloaded the latest version from CVS and tried it out.

Unfortunately, there are still no changes for me. I still have to specify the directory drupal is in, or it doesn't work.
This is more than fine with me, it's just a small thing one needs to remember to do.

My real problem is that I can't seem to attach a theme to at all. I've tried:


drupal
drupal/
drupal/index.php
drupal/

and nothing works. I'm using as some sort of splash page with recent updates only, so I've done a particular theme for only and would like to be able to use it.

Did I miss something crucial, is there something else I need to do to be able to select a theme for front or anything else?

Thanks!

Anonymous’s picture

And that before was:

<front>
drupal/<front>

before it got edited out.

Bèr Kessels’s picture

Hi,

PLease note: The code for defining/setting blocks /should/ be exactly similar to the blocks. Note that the released version for 4.5 will not be updated (by me! if you have patches that work, please feel free to commit) and is *as is*, but should be exactly similar to the HEAD version.

So please check the following:
1) are you using the *latest* sections.module
2) are you using drupal latest CVS *or/*
3) are you using drupal 4.5.2

If 1 and 2: please check whether blocks paths work and behave similar to the secions. If thats not the case , you found a bug.
if 1 and 3: please note that i cannot help you further. Changes will be placed in the 4.6 version in a few months only.

Bèr Kessels’s picture

sorry, too quick.

I should have mentioned, that i have not yet tested the module on HEAD, but I know for sure some minor things changed in the themes system. You should look at the theme names, that are parsed.
Also note that the phptemplate system works best with this module.

Anonymous’s picture

I just found a workaround to assign a theme to <front>: I assigned the theme I created for <front> as default to drupal in the admin->themes page, then I created a section for all the rest of drupal and assigned the pushbutton-for-PHPTemplate theme to it (yes, I am using PHPTemplate and its themes). This works and styles <front> with one theme and all the rest with pushbuttonPHP. However, every time you add a module that creates custom urls you have to remember to go to the sections module and add the new urls to it, which isn't ideal. Being able to use the sections module to directly specify a theme for <front> would be really great.
Anyhow, since my case is 1+3, I'll wait for 4.6. Thanks for your help!

Anonymous’s picture

Scratch that--I didn't really feel like waiting till 4.6, so I went ahead and installed the CVS I found here:
http://drupal.org/files/projects/drupal-cvs.tar.gz
Hope it's the one you're talking of? The version of the sections module I've been using is this one:
http://cvs.drupal.org/viewcvs/*checkout*/drupal/contributions/modules/se...

Anyhow, I then tested what you asked for. I went to admin->blocks and enabled the previously disabled Categories block. I clicked on 'Save blocks'. Once saved, I clicked on 'configure' and specified that I wanted the Categories block on <front> only, by inputting <front> in the text area and checking the option 'Show on only the listed pages'.
Then I cleared the cache, went to <front>, and indeed the categories block showed up on <front>, and not on any other page. I found it really odd, since you said the code is the same. Is it really a bug, then?

Also, after installing drupal CVS, suddenly the theme selector of the various sections doesn't show theme names anymore, just a series of blank lines.

Anonymous’s picture

Any news on this bug?

Bèr Kessels’s picture

No.

As pointed out a lot of times before: It works fine for me, So I wont make any changes, unless others come up with patches.

Anonymous’s picture

Title: Themes attached to various sections not showing up-- default theme showing » How to make the module work for the front page

To answer the person who can't make it work with the front page: I had this problem too, but then I tried using:

/

instead of:

<front>

where you specify the pages where you want your section to show up, and miracously it worked. Hope it helps.

Anonymous’s picture

Title: How to make the module work for the front page » Themes attached to various sections not showing up-- default theme showing

Sorry, I didn't know changing the title of my comment would change the title of the whole thread. I put it back to the previous title now.

visualnotion’s picture

Category: bug » support

I, too, was having problems with the Section module working correctly. I found out what I was doing wrong.

I have three themes being used for three different pages/layouts. I have: Front, Interior, Admin.

Here is what I learned:
Make sure that your "Default Front Page" (in Admin > Settings) is the same as your pages listed in the Sections module. (Admin > Settings > Sections>)

In my case I have "node" specified as my default front page in the site settings. I also set the pages that use the Front theme to be "node." (Remember to include additional pages, if you have more than one.)

I hope this helps others who have had the same problem.

seaneffel’s picture

I can only get this module to *partially* work.

I'm looking for a solution to have certain content types display as a different theme, lots of other modules try to do this but don't get it right.

I added the following sections, actually identical to the example listed below the field:

blog
blog/*

When I go to site.com/blog then it works.

When I go to any site.com/blog/* it does not display the template I told it to.

http://www.cctvcambridge.org

Bèr Kessels’s picture

Status: Active » Closed (fixed)

Too many different issues in one post. PLease open a new issue if teh HEAD still does not fix your issue

harkonnen’s picture

Assigned: Unassigned » harkonnen

This is old thread, but just in case someone has same problem as I did.

In, Administer >> Site building >> Sections

If you have WYSIWYG HTML editor like FCKeditor module installed, make sure to "switch to plain text editor" before you add pages to "activate section".
Otherwise, you add 'blog' page thinking yoursite.com/blog will show in different theme, but if you don't switch to plain text editor, your input will become ' <p>blog</p> '.

Add 'admin/build/sections/*' at 'Paths to exclude' config in your HTML editor's configuration.