Multiple page selectors in block

Permalink
Hi,

I'm trying to make a block where different pages could be selected through the sitemap of Concrete5.

The helper form/page_selector gives us the opportunity to select a page in the sitemap.

But if multiple selectors are placed on in the block, the page selector doens't seem to work. After some problem seeking, I found out that the javascript function to load the page into the block is overwritten as soon as another page selector is added.

The function name is: ccm_selectSitemapNode.

Has anybody a solution for this problem?

Thank you!

DeWebmakers
 
andrew replied on at Permalink Reply
andrew
I will try and take a look at this as soon as possible. It doesn't surprise me that the helper may not have been built to work flawlessly with multiple instances in one page.
DeWebmakers replied on at Permalink Reply
DeWebmakers
Any progress yet?
I'm kind of waiting for it....

Should I also add this question/feature to the service partner area?
olacom replied on at Permalink Reply
olacom
Is this problem still present ?
DeWebmakers replied on at Permalink Reply
DeWebmakers
Still a problem :)
strefarytmu replied on at Permalink Reply
Steps to fix!

Step 1.

Override /concrete/helpers/form/page_selector.php by copying it to /helpers/form/page_selector.php. [b]Warning:[/b] due to an unrelated bug you will [b]also[/b] have to rename the original. This isn't how the Concrete5 overriding usually works, but with this particular file it turns out to be necessary.

Step 2.

Edit the copy and change this line:

var pari = $(ccmActivePageField).parent().find(\'[name=' . $fieldName . ']\');


to look like this:

var pari = $(ccmActivePageField).parent().find(\'input[type="hidden"]\');
jordanlev replied on at Permalink Reply
jordanlev
I've also fixed this problem as part of the "Designer Content" package. If the block you're building is fairly straightforward and just has Images, Page Selectors, TinyMCE editors and/or textboxes in it, I recommend using that instead:
http://www.concrete5.org/marketplace/addons/designer-content...

I'm hoping to submit those fixes as a patch for the next version of the core system, but who knows when that will be...
DeWebmakers replied on at Permalink Reply
DeWebmakers
Great!

Thanks for the replies.

I solved the problem by creating a new pageselector popup and passing the pageID's to hidden fields.

This is much nicer and easier.

Thanks again!

Corretje