Author Topic: New Module - Section Picker (aka Global Blocks)  (Read 52822 times)

Offline Ruud

  • Posts: 3649
  • Gender: Male
  • Do not use PM for help! Please use the forum!
    • Dev4Me - Professional WebsiteBaker Development
New Module - Section Picker (aka Global Blocks)
« 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.




[gelöscht durch Administrator]
« Last Edit: March 14, 2011, 03:20:29 PM by Ruud »

Offline kweitzel

  • WebsiteBaker Org e.V.
  • **
  • Posts: 6983
  • Gender: Male
Re: New Module - Section Picker
« 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

cuotos

  • Guest
Re: New Module - Section Picker
« 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 »

Offline Ruud

  • Posts: 3649
  • Gender: Male
  • Do not use PM for help! Please use the forum!
    • Dev4Me - Professional WebsiteBaker Development
Re: New Module - Section Picker
« 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

Availor

  • Guest
Re: New Module - Section Picker (aka Global Blocks)
« Reply #4 on: August 10, 2008, 09:20:00 PM »
kudos to you

aldus

  • Guest
Re: New Module - Section Picker (aka Global Blocks)
« 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: [Select]
<?php
/**
*
*/
if($query_sec->numRows() > 0) { 
    
$section $query_sec->fetchRow(); 
    
$section_id $section[&#39;section_id&#39;]; 
    
$module $section[&#39;module&#39;]; 
    
require(WB_PATH.&#39;/modules/&#39;.$module.&#39;/view.php&#39;); 

?>


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

Regards
Aldus

[gelöscht durch Administrator]

Offline Ruud

  • Posts: 3649
  • Gender: Male
  • Do not use PM for help! Please use the forum!
    • Dev4Me - Professional WebsiteBaker Development
Re: New Module - Section Picker (aka Global Blocks)
« 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  8-)).

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

Offline Insa

  • Posts: 17
  • Gender: Male

Offline Ruud

  • Posts: 3649
  • Gender: Male
  • Do not use PM for help! Please use the forum!
    • Dev4Me - Professional WebsiteBaker Development
Re: New Module - Section Picker (aka Global Blocks)
« Reply #8 on: August 18, 2008, 03:54:30 PM »
http://www.websitebaker2.org/forum/index.php/topic,7574.0.html - It's bad???

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

Offline nuke

  • Posts: 31
Re: New Module - Section Picker (aka Global Blocks)
« Reply #9 on: August 26, 2008, 07:26:23 PM »
Great module - thanks! Works wonderfully!!!

Anlina

  • Guest
Re: New Module - Section Picker (aka Global Blocks)
« 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 »

Offline Ruud

  • Posts: 3649
  • Gender: Male
  • Do not use PM for help! Please use the forum!
    • Dev4Me - Professional WebsiteBaker Development
Re: New Module - Section Picker (aka Global Blocks)
« 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

Offline kweitzel

  • WebsiteBaker Org e.V.
  • **
  • Posts: 6983
  • Gender: Male
Re: New Module - Section Picker (aka Global Blocks)
« 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 ...

Anlina

  • Guest
Re: New Module - Section Picker (aka Global Blocks)
« 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.

chip

  • Guest
Re: New Module - Section Picker (aka Global Blocks)
« 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

Offline Ruud

  • Posts: 3649
  • Gender: Male
  • Do not use PM for help! Please use the forum!
    • Dev4Me - Professional WebsiteBaker Development
Re: New Module - Section Picker (aka Global Blocks)
« 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

Offline mikejd

  • Posts: 221
Re: New Module - Section Picker (aka Global Blocks)
« 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

aldus

  • Guest
Re: New Module - Section Picker (aka Global Blocks)
« 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: [Select]
<?php
$links
[$res[&#39;section_id&#39;]] = $res[&#39;section_id&#39;].&#39;|&#39;.str_repeat("  -  ",$res[&#39;level&#39;]).$res[&#39;page_title&#39;].&#39;     -      section:&#39;.$res[&#39;module&#39;].&#39;&#39;;
?>


hth
Regards
Aldus

Offline mikejd

  • Posts: 221
Re: New Module - Section Picker (aka Global Blocks)
« 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

Offline Ruud

  • Posts: 3649
  • Gender: Male
  • Do not use PM for help! Please use the forum!
    • Dev4Me - Professional WebsiteBaker Development
Re: New Module - Section Picker (aka Global Blocks)
« 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

Offline Ruud

  • Posts: 3649
  • Gender: Male
  • Do not use PM for help! Please use the forum!
    • Dev4Me - Professional WebsiteBaker Development
Re: New Module - Section Picker (aka Global Blocks)
« 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

Offline Stefek

  • Posts: 6177
  • Gender: Male
  • ("ړ)
Re: New Module - Section Picker (aka Global Blocks)
« Reply #21 on: October 19, 2008, 03:34:55 PM »
Hello Ruud,
I installed this module and I get this message:
Code: [Select]
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
"Gemeinsam schafft man mehr."

gemeinsam
1. mehreren Personen oder Dingen in gleicher Weise gehörend, eigen
2. in Gemeinschaft [unternommen, zu bewältigen]; zusammen, miteinander
#Duden

Offline Ruud

  • Posts: 3649
  • Gender: Male
  • Do not use PM for help! Please use the forum!
    • Dev4Me - Professional WebsiteBaker Development
Re: New Module - Section Picker (aka Global Blocks)
« 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 :(

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

Offline Stefek

  • Posts: 6177
  • Gender: Male
  • ("ړ)
Re: New Module - Section Picker (aka Global Blocks)
« 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
"Gemeinsam schafft man mehr."

gemeinsam
1. mehreren Personen oder Dingen in gleicher Weise gehörend, eigen
2. in Gemeinschaft [unternommen, zu bewältigen]; zusammen, miteinander
#Duden

Offline Ruud

  • Posts: 3649
  • Gender: Male
  • Do not use PM for help! Please use the forum!
    • Dev4Me - Professional WebsiteBaker Development
Re: New Module - Section Picker (aka Global Blocks)
« 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 »

 

postern-length