Welcome, Guest. Please login or register.
March 21, 2010, 07:31:33 AM

Login with username, password and session length
Search:     Advanced search
WB 2.8.1 veröffentlicht!
Download und weitere Informationen gibt es hier .
110567 Posts in 15967 Topics by 9311 Members
Latest Member: tomko
* Home Help Search Login Register
+  WebsiteBaker Community Forum
|-+  English
| |-+  Modules (Moderators: Argos, BerndJM)
| | |-+  New Module - Section Picker (aka Global Blocks)
Pages: [1] 2 3 Go Down Print
Author Topic: New Module - Section Picker (aka Global Blocks)  (Read 8103 times)
Ruud
Development Team
******
Offline Offline

Posts: 1273


[[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.

Edit: The latest version is available on the AMASP site.

« Last Edit: December 01, 2009, 04:15:39 PM by Ruud » Logged

kweitzel
Forum administrator
*****
Offline Offline

Posts: 5561


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

Offline Offline

Posts: 3


« 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
******
Offline Offline

Posts: 1273


[[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

Offline Offline

Posts: 171


Yup it's me


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

kudos to you
Logged
aldus
Addons Team
******
Offline Offline

Posts: 1018



« 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



57 65 62 73 69 74 65 20 42 61 6B 65 72 20 72 6F 63 6B 73 21
Ruud
Development Team
******
Offline Offline

Posts: 1273


[[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

Offline Offline

Posts: 17



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

http://www.websitebaker2.org/forum/index.php/topic,7574.0.html - It's bad???
Logged
Ruud
Development Team
******
Offline Offline

Posts: 1273


[[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

Offline Offline

Posts: 10


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

Great module - thanks! Works wonderfully!!!
Logged
Anlina

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
******
Offline Offline

Posts: 1273


[[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 administrator
*****
Offline Offline

Posts: 5561


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

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

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
******
Offline Offline

Posts: 1273


[[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

Offline Offline

Posts: 100


« 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
******
Offline Offline

Posts: 1018



« 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



57 65 62 73 69 74 65 20 42 61 6B 65 72 20 72 6F 63 6B 73 21
mikejd

Offline Offline

Posts: 100


« 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
******
Offline Offline

Posts: 1273


[[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

Ruud
Development Team
******
Offline Offline

Posts: 1273


[[droplets]]


WWW
« Reply #20 on: September 24, 2008, 02:27:34 PM »

An updated version is available.

1. small bugfix. (found by mikejd)
2. When the module is used in WB2.7 the pages created with the section picker are also searched by the WB searchpages.
Note: It will only search the sections that support the WB2.7 new-improved-search!

Download available in the first post in this thread.

Ruud
Logged

Stefek
Backend Theme Team
******
Offline Offline

Posts: 3203



WWW
« Reply #21 on: October 19, 2008, 03:34:55 PM »

Hello Ruud,
I installed this module and I get this message:
Code:
Notice: Use of undefined constant level - assumed 'level' in /mnt/web4/12/33/5284***/htdocs/pagename/modules/section_picker/select pages.php on line 22
Notice: Use of undefined constant level - assumed 'level' in /mnt/web4/12/33/5284***/htdocs/pagename/modules/section_picker/select pages.php on line 22
Notice: Use of undefined constant level - assumed 'level' in /mnt/web4/12/33/5284***/htdocs/pagename/modules/section_picker/select pages.php on line 22
Notice: Use of undefined constant level - assumed 'level' in /mnt/web4/12/33/5284***/htdocs/pagename/modules/section_picker/select pages.php on line 22
Notice: Use of undefined constant level - assumed 'level' in /mnt/web4/12/33/5284***/htdocs/pagename/modules/section_picker/select pages.php on line 22
Notice: Use of undefined constant level - assumed 'level' in /mnt/web4/12/33/5284***/htdocs/pagename/modules/section_picker/select pages.php on line 22

However, the module works just fine.
This message is displayd above the picke itself.

Regards,
Stefek
Logged

Bowling in Kiel Halle Aschaffenburg

"Es gibt viele Pfade am Fuße des Berges,
doch von der Spitze aus, erblicken wir alle den selben Mond."
jap. Sprichwort
Ruud
Development Team
******
Offline Offline

Posts: 1273


[[droplets]]


WWW
« Reply #22 on: October 19, 2008, 11:27:17 PM »

Hi Stefek,

This problem was supposed to be solved in the current version. But apparently it's not.

Probably when I was code-cleaning an old version of that file was used Sad

The message is a "notice". This means nothing is going wrong, it's just telling it could be coded better.
I fixed it again. A version v.0.22 is now available in the first post of this thread.

Ruud
Logged

Stefek
Backend Theme Team
******
Offline Offline

Posts: 3203



WWW
« Reply #23 on: October 20, 2008, 12:02:42 AM »

Thanks Ruud.

Can I just install  the new one "over" the existing installation, or do I have to remove the another one first?

Regards,
Stefek
Logged

Bowling in Kiel Halle Aschaffenburg

"Es gibt viele Pfade am Fuße des Berges,
doch von der Spitze aus, erblicken wir alle den selben Mond."
jap. Sprichwort
Ruud
Development Team
******
Offline Offline

Posts: 1273


[[droplets]]


WWW
« Reply #24 on: October 20, 2008, 02:28:43 PM »

You can just upgrade. No need to uninstall first.

Ruud

« Last Edit: October 20, 2008, 03:46:07 PM by Ruud » Logged

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

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