Recent Topics

1 Aug 28, 2009 11:10    

I'm creating a site with b2e v3.3.1 that will ideally house both a news feed and and an event calendar. I'd hoped to create a separate stub file and skin for each feature so only the one blog would have to be updated and users could be directed to the appropriate stub on demand — i.e., the calendar stub would display future posts categorized as events in a calendarish format, while the main stub would be a reg'ler ol' blog page.

I've run into a similar problem as [url=http://forums.b2evolution.net/viewtopic.php?t=13314]this user did[/url] in that, unless the stub file is referenced in the blog base URL, all of its settings are ignored — this includes skin, timestamp range, and categories, much to the detriment of my Master Plan — and the browser is redirected to the base URL.

So, I'm left wondering how to take advantage of the control and flexibility seemingly offered by stub files if only one base URL can be specified and b2e pays heed only to that file. The [url=http://manual.b2evolution.net/Stub_file#Can_I_use_multiple_stub_files_for_the_same_blog.3F]stub file documentation[/url] has this to say on the matter:

Stub file wrote:

Can I use multiple stub files for the same blog?

Yes, you can create several stub files for the same blog if you want. They'll all work and display your blog in different locations of your site. However, when b2evo creates navigation links and especially permalinks, it will refer to the one and only stub file you have configured in the backoffice (unless you override this default behaviour in customized skins, but that's another subject).

Stub files let you set dozens of different parameters to fine tune how you want to display your blog. An example of a stub file is provided as a_stub.php . If you duplicate and rename a_stub.php 10 times, you'll have 10 different ways of calling blog_a with it's default skin. If you modify the 10 copies, you'll have 10 different displays.

The first thing you'll want to do is display another blog besides blog a. But you could also force the display to a specific skin, or use another linkblog, or decide to display posts in the future, or change the sorting order of your posts, etc...

But the issues isn't just with the generated links; all settings of unspecified stub files are ignored.

What am I missing here?

2 Sep 26, 2009 22:54

I think the telling line is this one:

you'll have 10 different ways of calling blog_a

YOU will be able to call it that way. It won't: you will.

Sounds like a really bad thing in the manual to me because as you've identified, the only stub file b2evolution will automagically work with is the one identified in the back office on the URLs subtab.

:(

3 Oct 09, 2009 00:52

Thanks for replying, EdB.

If I read you right, I was trying to do what you think I should have been trying to do. That is, I create a stub file — say, stub.php — configure it as desired and request it explicitly in the URL when visiting the blog — say, domain/news/stub.php. That way, even if the blog is set to use one skin or what have you by default, I can have it use another skin (or what have you) by calling stub.php — yes?

But that's not what would happen. What would happen is that every time I tried to access the blog through a stub file, I would be redirected to the base URL, and the blog would be rendered in its default configuration.

Coming back to it with a fresh mind these months later, it didn't take me too long to figure out the problem, though! I created a fresh installation of 2.4.7, and everything worked fine. Going back to a fresh installation of 3.3.1, I still had the same problem. What was the difference?

Turns out the problem was being caused by the blog's SEO settings. 3.3.1 comes with a new setting: "301 redirect to canonical URL when possible", and it was nearly always possible, even when I wanted to use a stub file. :roll:

After disabling that particular option, my stub files are working fine. Thanks for raising my thread from the dead. I couldn't have done it without you! :D


Form is loading...