Jump to content
a-ok

PageField publishing new pages issue

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

Share this post


Link to post
Share on other sites

Maybe check the console for javascript errors as the module does rely on AJAX and copying the new pages in an extra textarea field.

Share this post


Link to post
Share on other sites

Thanks. I've checked and nothing. When I type in a page name, it looks like a search option is AJAX'd in (see attached) but no errors?

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

Share this post


Link to post
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 :)

Share this post


Link to post
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.

Share this post


Link to post
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.

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Maybe you don't have access righta to add a page there?

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Maybe you don't have access righta to add a page there?

How would I double check this? I am sure it is all set up correctly?

Share this post


Link to post
Share on other sites

What version and is it in a tab Other than content?

Share this post


Link to post
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.

Share this post


Link to post
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.

Share this post


Link to post
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

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Spyros
      Hello
      I'm having a strange issue with the $page->find(), for some reason I'm missing some of the pages from the results. I found then that I was missing all the pages with the same "PAGE NAME". Is it a bug or am I missing something?
      PS 
      If I change the "PAGE NAME" of one of the missing ones then I'm retrieving the page without any problem.
      Thank you
    • By benbyf
      Hi, Looking to create form elements on a page–some input with a colection of form inputs and the appropriate labels and variables for that input. I've used ProForms in the past and rolled out my own when creating simply one off forms, but I wonder if anyone has found a good way of allowing form creation on page editing so that clients can adhocly make and edit forms?
      Thanks
    • By EyeDentify
      Hello Dear PW Gurus.

      Hope you fair well in these Corona Crisis times.

      Anyhow, i have a problem with a Cryptic error message that shows up when i am trying to Delete images out of a Images field.
      The Error message does say a little but it does not make sense to me why i can´t delete the images because of it.

      Is it some permission issue perhaps?

      I will attach screenshots of it and what i did prior to it.
      I am from sweden so ignore the funny words here and there.

      Hope you all can send me on the right track.
      i am running PW 3.0.139 on this install.

      Step1:

      Step 2: Select the images with the trashcan symbol

       
      Step 3: Cryptic Error message

      I am scratching my head on this one, have not seen this before.

      Thankfull for all help.
      /EyeDentify
    • By EyeDentify
      I have been experimenting with the new $page->meta() method and find it useful.

      Once i figured out that the data i "save" with it is tied to the page where i called the method from.

      So this is not obvious at least not for me in the documentation:
      https://processwire.com/api/ref/page/meta/
       
      So i just wanted to share that revelation with the community so you don´t get as confused as i was.

      Happy Coding Everyone.
×
×
  • Create New...