I just want to start off by saying that I'm just starting out with MODx and so far, I'm loving it. I've had to take the crash course though as I have to get a documentation site up for work and the time budget is low.
The main requirement of the site is to allow for internal staff to create new articles/documents etc. I have NewsPublisher setup and running but have run into two issues. One is critical and the other is more of a cosmetic thing.
The first issue (the critical one) is that I cannot get the [[!NpEditThisButton]] to work. If I try it with the default call: [[!NpEditThisButton]] I get the following output on the button: "Could not set the np_id default property. Set it manually to the ID of the Newspublisher page..". This was easy to resolve and I am setting the np_id dynamically using the [[*id]] tag and that part seems to be working. The next issue I get with this call [[!NpEditThisButton? &np_id=`[[*id]]` &debug=`1`]] is: "In noShow list". I then create the noShow list and that error goes away but still, upon submit I do not receive an edit form.
The second issue is that the tabs aren't working despite not throwing an error.
I can't help but feel there is something fundamentally wrong but I'm not sure what it is. I can create a new post without issue (aside from the tabs) but cannot edit.
Here is my full call with the tabs. I have checked the JSON and it is well formed and I believe everything else is as it should be.
<pre>
[[!NewsPublisher?
&parentid=`19`
&initrte=`1`
&usetabs=`1`
&show=`pagetitle,published,features_desc,features_sales_guide,features_sales_brochure,features_implementation,features_tech_spec`
&tabs=`{
"Main" : ["pagetitle","published","features_desc"],
"SalesGuide" : ["features_sales_guide"],
"SalesBrochure" : ["features_sales_brochure"],
"Implementation Guide" : ["features_implementation"],
"Technical Specification": ["features_tech_spec"]
}`
&template=`9`
&required=`pagetitle,published,features_desc`
]]
</pre>
The TVs all work properly upon creation and so does the template assignment and parentid.
Thanks for any help that can be provided!
Mike
Try putting the &tabs JSON all on one line. The JSON parser can handle it on multiple lines, but often the MODX parser that parses snippet tags can't.
Hard code the ID of the NewsPublisher page in the &np_id property (or just set it on the NpEditThisButton's "Properties" tab).
BobRay,
Thanks you for your prompt reply. When I saw your response I knew instantaneously what I had done wrong with the NpEdit button. I was linking to the current page with the np_id rather than the NewsPublisher page for that section of the site. I can now edit without issues!
As far as the tabs go, I tried putting them on the same line before posting initially but that did not work either. I'm no stranger to PHP so if you can point me in the right direction to troubleshooting that at the script level, I'm happy to dig in.
Definitely appreciate your help today, thanks again!
I'm afraid I don't know what's up with the tabs. They're done mostly in JavaScript and for a very small group of people, they don't work and I don't know why. It could be browser-related so you might try using another browser. You could also try Chrome dev. tools or Firebug to see if you're getting any JS errors.