Quote from: vitaliy at Jan 18, 2011, 01:51 PM
how to display the form only to certain groups of users?
no. I need to make the page visible to all, and the snippet only worked if I allow a user.
You can’t do both. Either it’s visible to everyone, or it isn’t.
I’m afraid I don’t understand what you want to do.
I want to have a button and the form on the page appears only if you login in the manager
Well, NewsPublisher is a *front-end* editing solution (the Manager already has a resource editing form and it can be customized). In the front end of the site, you’re by definition not in the Manager, so Manager login is irrelevant.
OTOH, If you set the permissions properly (as I described above), only users who are logged in in the front end (using the Login snippet) and who have the right to edit the current document will see the button.
When you are previewing from the Manager as the admin Super User, you have special rights and will always see the button, but other users will not.
If you set &debug=`1`, the button will always show and you will see a message on the button telling you whether it will be shown or not to the current user. If you set &debug=`0`, the button will be hidden from those without the necessary permissions.
A very usefull snippet, great you share it!
But I can’t get a tv like tags to show up.
[[!NewsPublisher? &aliastitle=`1` &cancelid=`66` &initrte=`1` &rtcontent=`1` &template=`mblog` &show=`tags` ]] results in:
Sorry . . . There were one or more problems in producing the form:
You want to display a TV that is not attached to this template. Template: ---- TV: tags
Although the tvs are attached to the template(s).
Any hint is appreciated.
Is ’tags’ the actual name of the TV (not ’Tags’)?
Be sure the TV is connected to the template you’ve specified (or to the system default template).
Another thing to try is using the id of the TV rather than its name.
Are you using the &template parameter, and is the TV also attached to that template?
The check in NP is based on the template the new page will have (or at least that’s what it’s supposed to be checking), not the template for the NP page. If you don’t send the &template parameter, it uses the system default template, so the TV would have to be attached to that template.
Do you have the latest version of NP (1.0.6) and MODx (2.0.8)?
I’m sorry, I’ve tried everything I can think of (including pasting your NP tag) and I can’t duplicate this problem. I test NP with TVs all the time.
You could try using the template ID rather than the name (it’s faster), but it shouldn’t make any difference.