Jump to content

PageField publishing new pages issue


a-ok
 Share

Recommended Posts

Hi folks,

I have a simple Page field setup to act as a tag system. This has worked for me, but for some reason it's not working now and I can't find out why. I can select previously added 'Pages' here, but cannot add new ones (comes up with a little warning symbol (see attached)).

Any way I can check through to see what I have changed to affect this? Debug mode? What should I be looking for? I have tried to test it alongside another project with a similar setup that still works but all seems to be the same?

Thanks guys,

:(

post-2553-0-69487300-1424365789_thumb.pn

Link to comment
Share on other sites

Didn't know AutoComplete had this as well.

Autocomplete is actually really nice. I see pros and cons compared with ChosenSelect and I think it comes down to how many tags you are likely to end up with. Automcomplete uses ajax to load matching pages/tags, but this means that you can't browse existing ones like you can with ChosenSelect, but maybe nicer than potentially loading up hundreds of items into the DOM.

Sorry, will stop the OT comments now :)

Link to comment
Share on other sites

The javascript of the module says that this error icon should symbolize that you can't add pages, because it can't find the textarea I mentioned above. The textarea should have the id "#_{fieldname}_add_items". So you should take a look, why jQuery can't find it, this will at least give you some insight, why it doesn't work or if it's even in the DOM.

Autocomplete is actually really nice. I see pros and cons compared with ChosenSelect and I think it comes down to how many tags you are likely to end up with. Automcomplete uses ajax to load matching pages/tags, but this means that you can't browse existing ones like you can with ChosenSelect, but maybe nicer than potentially loading up hundreds of items into the DOM.

Sorry, will stop the OT comments now :)

It actually does add pages in same way my module does. Just copy the name over to the textarea. Only small difference is, that my module does it only once on the form submit.

Link to comment
Share on other sites

Thanks. Okay, so I have compared the DOM on a project where it works, and on this one where it doesn't, paying attention to '#_{fieldname}_add_items' you mentioned. 

See below for two images, the first one is the one that works can you can clearly see some more elements in the DOM relating to the page autocomplete. The setup is exactly the same from what I can see... so why would the '.InputfieldPageAdd' div and its contents be missing from one and not the other?

Screen%20Shot%202015-02-19%20at%2018.45.Screen%20Shot%202015-02-19%20at%2018.45.

Link to comment
Share on other sites

It actually does add pages in same way my module does. Just copy the name over to the textarea. Only small difference is, that my module does it only once on the form submit.

Not referring to adding of new pages - I understand how it works in both modules - I am talking about the way they display existing pages - ChosenSelect loads all into the DOM using the Select field. Autocomplete uses ajax to search and return matches dynamically.

Link to comment
Share on other sites

With Autocomplete input you don't need a textarea it's just hitting enter a if it doesn't find it. Its different from the other input types.

That's wrong. This are snippets from it's javascript file. I just wanted to know if the textarea it's there, even if it's not visible.

function isAddAllowed() {
	return $('#_' + $ol.attr('data-name') + '_add_items').size() > 0; 
}
…
    var $addItems = $('#_' + name + '_add_items'); 
    if($addItems.size() > 0) $addItems.val(addValue);

But the conclusion is the same, something is blocking the rendering of this textarea. So check if you can add and publish the pages you want to add.

Link to comment
Share on other sites

Thank you for all the help and replies. I believe all the page permissions are correct but will go through it all and check. Is there anything obvious I should be looking for? Also, this is not in an extra tab and is in the content tab.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...