Welcome, Guest. Please login or register.
July 04, 2009, 03:02:34 AM

Login with username, password and session length
Search:     Advanced search
You wanna join the Website Baker team?
For more Informations read here or on our Startpage.
85167 Posts in 13110 Topics by 8207 Members
Latest Member: kolerik
* Home Help Search Login Register
+  Website Baker Community Forum
|-+  English
| |-+  Modules (Moderators: Argos, BerndJM)
| | |-+  New Module - Section Picker (aka Global Blocks)
Pages: [1] 2 Go Down Print
Author Topic: New Module - Section Picker (aka Global Blocks)  (Read 4329 times)
Ruud
Development Team
"All I Do Is Bake" Baker
******
Offline Offline

Posts: 985


[[droplets]]


WWW
« on: August 09, 2008, 06:05:35 PM »

There have been lots of posts about the possibility to use a page (or a section from another page) in other pages.
All kind of nice hacks and snippets can be found to do this.

This new module allows to create a page (or add section(s) to an existing page) and select from what other page the content should be used.

The module works with all page(section)-types (at least all I could test).
Combining multiple sections from other pages is also possible.

Tip: create hidden pages with content, build your pages by combining sections with this module.

 version 0.23 - October 24, 2008
 - bugfix: modify.php was using short_open_tags. (only a problem when this is set Off in php)

 version 0.22 - October 19, 2008
 - the same small bugfix in select_pages.php. Last one missed the zipfile

 version 0.21 - September 24, 2008 (38 downloads)
 - small bugfix in select_pages.php

 version 0.2
 - added search.php -
   This allows linked sections to be searched. The sections must support the improved search of WB2.7
   WB 2.6 installation wil work, but without search.
 

Version 0.1 - August 9, 2008 (downloaded 66 times)
- Initial version

« Last Edit: October 24, 2008, 02:38:33 PM by Ruud » Logged

kweitzel
Forum Team
A Baker's Baker
*****
Offline Offline

Posts: 4832


WWW
« Reply #1 on: August 09, 2008, 08:34:46 PM »

Nice one Ruud ... just gave it a quick try. Will help some of the users looking for the global blocks a lot ...

cheers

Klaus
Logged

http://www.weitzel.biz
PM has been disabled
cuotos
Pending Apprentice Baker
**
Offline Offline

Posts: 3


Email
« Reply #2 on: August 09, 2008, 09:15:50 PM »

awesome, just what I was looking for -seems to work just fine for now, I'll keep testing

Thanks a lot!

edit: One question though:
at the beginning of the "included" blocks, there's always an ampty ancor like
<a id="wb_section_20" name="wb_section_20"></a>
Why is that?

cheers
« Last Edit: August 10, 2008, 10:29:24 AM by cuotos » Logged
Ruud
Development Team
"All I Do Is Bake" Baker
******
Offline Offline

Posts: 985


[[droplets]]


WWW
« Reply #3 on: August 10, 2008, 08:14:45 PM »

edit: One question though:
at the beginning of the "included" blocks, there's always an ampty ancor like
<a id="wb_section_20" name="wb_section_20"></a>
Why is that?

Just do a search for "wb_section" in this forum. It is a standard feature of WB2.7.

Ruud
Logged

Availor
Senior Baker
*****
Offline Offline

Posts: 154


Yup it's me


WWW
« Reply #4 on: August 10, 2008, 09:20:00 PM »

kudos to you
Logged

www.websitebakerden.com - free complex baker templates and tutorials
www.videoxone.com - watch free movies
aldus
Addons Team
"All I Do Is Bake" Baker
******
Offline Offline

Posts: 666



Email
« Reply #5 on: August 11, 2008, 11:50:37 AM »

Hello Ruud

Ok - massiv code-cleaning in all files, e.g. removing the unnessesarys breakets and
subversions-id within the wrong authornames.
Also removing the wrong "</form>" close-tag inside "modify.php".

One question left - inside "view.php"
Code:
<?php
/**
*
*/
if($query_sec->numRows() > 0) { 
$section $query_sec->fetchRow(); 
$section_id $section['section_id']; 
$module $section['module']; 
require(WB_PATH.'/modules/'.$module.'/view.php'); 

?>


Looks to me like a bug: what's happend if where are more than one found? But that's my own.

Regards
Aldus
Logged


43 61 6E 20 79 6F 75 20 72 65 61 64 20 6D 65 3F
Ruud
Development Team
"All I Do Is Bake" Baker
******
Offline Offline

Posts: 985


[[droplets]]


WWW
« Reply #6 on: August 11, 2008, 12:12:11 PM »

Hi Aldus,

Ok - massiv code-cleaning in all files, e.g. removing the unnessesarys breakets and
subversions-id within the wrong authornames.
Also removing the wrong "</form>" close-tag inside "modify.php".
Thanks, this happens when you take another module as base for a new one. I always forget to clean that (you should know by now  cool).

Looks to me like a bug: what's happend if where are more than one found? But that's my own.

If more than one found you will have more serious problems. The "section_id" is the primary key of that table and cannot be in there more than once.
If there would be more than one in there this will show the first one only.
The test (numRows() > 0) is there to prevent errors when the linked section is removed. The block will just skip if the linked section does not exist.

Ruud
Logged

Insa
Pending Apprentice Baker
**
Offline Offline

Posts: 13


244015
« Reply #7 on: August 18, 2008, 03:14:18 PM »

http://forum.websitebaker2.org/index.php/topic,7574.0.html - It's bad???
Logged
Ruud
Development Team
"All I Do Is Bake" Baker
******
Offline Offline

Posts: 985


[[droplets]]


WWW
« Reply #8 on: August 18, 2008, 03:54:30 PM »


Hmm,

I must admit I missed that one.  wink
If I had seen it I might have modified that one for my project.

There is a little difference. Your page copier copies complete pages, where the section picker sticks to single sections (that can be combined in full new pages). Using Page copier with single section pages will do exactly the same.

The reason I published this module was that there were lots of discussions/questions for "global blocks". They all had solutions to pick one section from existing pages (or hidden library pages) and include using php in the template.

Well, the community now can choose whatever fit's their need.

Cheers,

Ruud
Logged

nuke
Pending Apprentice Baker
**
Offline Offline

Posts: 5


« Reply #9 on: August 26, 2008, 07:26:23 PM »

Great module - thanks! Works wonderfully!!!
Logged
Anlina
Pending Apprentice Baker
**
Offline Offline

Posts: 18


« Reply #10 on: September 11, 2008, 03:59:29 PM »

I have the module installed without an issue, but when I go to modify the page and add a section, I click save and get a generic internal server error. Any ideas?

Edit: Okay, maybe this is a more general Websitebaker issue.
« Last Edit: September 11, 2008, 04:22:49 PM by Anlina » Logged
Ruud
Development Team
"All I Do Is Bake" Baker
******
Offline Offline

Posts: 985


[[droplets]]


WWW
« Reply #11 on: September 11, 2008, 04:18:58 PM »

I never have seen that.

What section are you adding when things go wrong?
Any sections before the Section Picker?

If I know exactly how you are building the page I could try to reproduce the error.

Ruud
Logged

kweitzel
Forum Team
A Baker's Baker
*****
Offline Offline

Posts: 4832


WWW
« Reply #12 on: September 11, 2008, 04:51:39 PM »

Usually the internal server error relates to a configuration issue. have a look at your error.log of the webserver to find out details.

cheers

Klaus

PS: I removed your double post ...
Logged

http://www.weitzel.biz
PM has been disabled
Anlina
Pending Apprentice Baker
**
Offline Offline

Posts: 18


« Reply #13 on: September 11, 2008, 05:49:21 PM »

Thanks both of you - the problem was that my directory permissions were set to 777 instead of 755. Things seem to be working now.
Logged
chip
Pending Apprentice Baker
**
Offline Offline

Posts: 10


« Reply #14 on: September 21, 2008, 10:05:11 PM »

Could it be that it doesn't work with WB 2.7?
Or how to use? I've installed the module but i can't use it..

Or is it a problem 'cause I'm using sections (main content, right column)...?

thanks for answers
Logged
Ruud
Development Team
"All I Do Is Bake" Baker
******
Offline Offline

Posts: 985


[[droplets]]


WWW
« Reply #15 on: September 21, 2008, 10:44:43 PM »

It will work on WB2.7 without problems.

The way to use is to add a section of the type section-picker to an existing page.
The new added section allows you to select any other page+section of your site to be displayed on that page.

In the "Manage Sections" you could assign it to another block (main/right)

Thats it.

Ruud
Logged

mikejd
Apprentice Baker
***
Offline Offline

Posts: 82


Email
« Reply #16 on: September 22, 2008, 11:49:15 AM »

I have installed Section Picker to try it out. When I add a section for it on a test page and go to 'Modify page' in the admin interface I get an error message :

Notice: Use of undefined constant level - assumed 'level' in E:\domains\d\deveron-arts.com\user\htdocs\wb\modules\section_picker\select pages.php on line 10

This is repeated, quite literally, hundreds of times (I gave up counting). Eventually at the bottom of the page is the drop down box to select the section. This allows me to select the page or section I wish to display from a list of all sections.

The page renders correctly, the problem is only in the admin.

Mike
Logged
aldus
Addons Team
"All I Do Is Bake" Baker
******
Offline Offline

Posts: 666



Email
« Reply #17 on: September 22, 2008, 12:01:11 PM »

I have installed Section Picker to try it out. When I add a section for it on a test page and go to 'Modify page' in the admin interface I get an error message :

Notice: Use of undefined constant level - assumed 'level' in E:\domains\d\deveron-arts.com\user\htdocs\wb\modules\section_picker\select pages.php on line 10

This is repeated, quite literally, hundreds of times (I gave up counting). Eventually at the bottom of the page is the drop down box to select the section. This allows me to select the page or section I wish to display from a list of all sections.

The page renders correctly, the problem is only in the admin.

Mike

Hm ... level has to be in brackets (File select_pages.php - line 10), like:
Code:
<?php
$links
[$res['section_id']] = $res['section_id'].'|'.str_repeat("  -  ",$res['level']).$res['page_title'].'     -      section:'.$res['module'].'';
?>


hth
Regards
Aldus
Logged


43 61 6E 20 79 6F 75 20 72 65 61 64 20 6D 65 3F
mikejd
Apprentice Baker
***
Offline Offline

Posts: 82


Email
« Reply #18 on: September 23, 2008, 11:06:27 AM »

Thanks Aldus, that seems to have sorted it. Should this line now be changed in the  module download and an updated version provided?

Mike
Logged
Ruud
Development Team
"All I Do Is Bake" Baker
******
Offline Offline

Posts: 985


[[droplets]]


WWW
« Reply #19 on: September 23, 2008, 12:00:52 PM »

I will update the module in the next few days.

This will be fixed in that version.

Ruud
Logged

Pages: [1] 2 Go Up Print 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.9 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!