Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

All other Modules /

Discuss all other Modules here.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Can not add a subsites virtual page


Go to End


3 Posts   1136 Views

Avatar
Rupert

Community Member, 10 Posts

18 June 2013 at 7:52pm

Hi,

I am using Subsites-master-1.0-beta1 (with SilverStripe CMS v3.0.5). I can add a virtual page, but not a subsites virtual page.
I can choose a subsite, but then when I try to choose a page to link to, I get the following error:

ReferenceError: $$ is not defined
[Break On This Error]
var subsiteSel = $$('#CopyContentFromID_SubsiteID select')[0];

When the mouse hovers over the "choose a page to link to" drop down box, all I see is a link to #

Any clues to where the problem may lie, would be greatly appreciated.

Thanks,
Rupert

Avatar
Rupert

Community Member, 10 Posts

28 June 2013 at 6:30am

Ok, I am getting closer to a solution, but I need help.

My problem is with the subsites module. In particular the javascript SubsitesTreeDropdownField.js
In this file there is the line:

var subsiteSel = $$('#CopyContentFromID_SubsiteID select')[0];

Now what is this $$ doing?
My javascript does not understand it. If I replace the line with:

var subsiteSel = $('#CopyContentFromID_SubsiteID select')[0];

Then "Choose a page to link to" works. But none of the
"Page name"
"Navigation label"
"Content"
are editable.

So what is the real solution?

Avatar
Rupert

Community Member, 10 Posts

28 June 2013 at 10:24am

Further into the code of SubsitesTreeDropdownField.js
What is going on here:

subsiteSel.onchange = (function() {
this.createTreeNode(true);
this.ajaxGetTree((function(response) {
this.newTreeReady(response, true);
this.updateTreeLabel();
}).bind(this));
}).bind(this);

Most of these function calls do not exist??