1). In the blog post, the single and double quotes are getting escaped. For example She said "stop." turns into, she said \"stop.\"This is down to PHP "magic quotes" being enabled. It will seriously intefere with any form processing, and is highly undesirable in any up-to-date PHP setup. If you have access to your php.ini file, insert the line
magic_quotes_gpc = Off
2). Posts that were made prior to installing PubKit show a creation date of 1969.If you’re using pkDate as the item date, and it’s empty, you get a zero result as the timestamp, or 0000 on 1st Jan 1970 (slipping back to 2300 31 Dec 1969 because of DST). I haven’t tried it, but if you set a default date for pkDate that might give you something more credible; or you may be able to use the DocManager module to set some values in the TV en masse.
3). I am unable to get dates from either [+pub_date:dateIfSet=`%d-%m-%y`+] or [+pkDateTo:dateIfSet=`%d-%m-%y`+]Are you sure you have named the PHx modifier snippet correctly (phx:dateIfSet)? What output do you get with an unmodified placeholder such as [+pub_date+], or the built-in PHx modifier [+pub_date:date=`%d-%m-%y`+]?
4). In the document tree, when logged in as Administrator, I am unable to look at any of the new documents
5). Will there be an option in the future to edit and re-save a post without re-publishing the post (making a duplicate)?This should be the standard action already! Opening the page containing your PubKit call (e.g. post-edit.html) with ?docId=99&command=edit as the query string or equivalent POST values should mean you are reediting document 99. This is what the hyperlink from the management list should do. I use it all the time, because I’m always spotting typos just after publishing something.
<?php class newsItem extends Resource { public $defaultDate; // set using function in constructor public $tvs = array( 'pkDate'=>NULL, 'pkDateTo'=>NULL, 'blogAuthor' =>NULL ); public $validate = array( 'pagetitle'=>'string||Req||title', 'longtitle'=>'string||Req||postHeadline', 'tvpkRichContent'=>'string||Req||postContent', 'displayDate'=>'date||Req||displayDate', 'displayFrom'=>'date||Opt||fromDate', 'displayTo'=>'date||Opt||toDate' ); function __construct($pid, $fields, $lang) { $this->defaultDate = strftime($lang['dateFormat']); $this->tvs['pkPreviewFlag'] = (isset($fields['preview'])) ? 1:0; if (empty($pid)) { $this->tvs['blogAuthor'] = $_SESSION['webFullname']; } else { global $modx; $author = $modx->getTemplateVar('blogAuthor', 'id', $pid); $this->tvs['blogAuthor'] = $author['value']; } parent::__construct($pid, $fields, $lang); } function CustomFields($fields, $doc) { $customFields = array(); $customFields['displayDate'] = strftime($this->lang['dateFormat'], strtotime($fields['pkDate'])); $customFields['displayTo'] = ($fields['pkDateTo'] > 0) ? strftime($this->lang['dateFormat'], strtotime($fields['pkDateTo'])) : ""; $customFields['displayFrom'] = ($doc->Get('pub_date') > 0) ? strftime($this->lang['dateFormat'], $doc->Get('pub_date')) : ""; return $customFields; } } ?>
magic_quotes_gpc = off
I am having problems with adding an item for a News item.
When I preview the news-manage page and click "add item" I get sent to my home page and my browser says I am at "/admin/news-edit".
When I preview my news-edit page it says "You do not have permission to post items here".
I think it may be an issue with my file layout and Ditto calls to the correct page.
My Ditto call on the manage page only shows the "add item" page when the call is this "[!Ditto?parents=`37`"
If I set it to `9` or `38` I get the MODx parse errors.
<form method="post" action="/welcome/area-reports/area-edit" id="addItem">
&canPost=`full member`
<form method="post" action="../admin/news-edit" id="addItem"> <input type="submit" value="Add item" /> </form> <div> <table> <thead><tr> <th colspan="2">Item and status</th><th>Date</th><th>Publish</th> <th>To</th></tr></thead> <tbody> [!Ditto?parents=`9` &tpl=`news.manage.tpl` &showPublishedOnly=`0` &orderBy=`pkDate DESC,editedon DESC` &extenders=`pkStatus` &tagData=`acNews` &debug=`0`!] </tbody> </table> </div>
[!PubKit?class=`post` &folder=`9` &template=`` &tags=`acNews` &rtcontent=`pkRichContent` &formtpl=`news.input.tpl` &tagFormat=`chk` &canPost=`editor` &debug=`0`!]
Hi, I don’t think you need the .. at the beginning of the action - I presume that the URL alias for your Admin page(41) is admin and your news-edit page (38) URL alias is news-edit then I’d expect the following to work
2) My news manage page (38) is this:
<form method="post" action="../admin/news-edit" id="addItem"> <input type="submit" value="Add item" />
<form method="post" action="/admin/news-edit" id="addItem"> <input type="submit" value="Add item" />
Does the MODx Parse error give you any clues?
My News Edit page (37) is this:
[!PubKit?class=`post` &folder=`9` &template=`` &tags=`acNews` &rtcontent=`pkRichContent` &formtpl=`news.input.tpl` &tagFormat=`chk` &canPost=`editor` &debug=`0`!]
When changing to "folder=`9`" I get a MODx Parse Error.
Not sure about this - actually I don’t have a TV called newsBody and it still works for me. I presume this is just a default template to stick in the news edit page when creating a new item. I suppose if you want posters to follow a certain format then you can use this field.
3) When previewing my News Edit page, the details input box is not shown.
I tracked it down through the TV [*pkRichContent*]
The default value is [+newsBody+]
I do not have a TV by that name and do not see it referenced in the docs anywhere.
What are the parameters for that TV?
<div class="row"> <span class="edLabel"><label for="detail">Details</label></span> <span class="edField" id="detail">[*pkRichContent*]</span> </div>
[!Ditto?parents=`156` &tpl=`news.manage.tpl` &showPublishedOnly=`0` &orderBy=`pkDate DESC,editedon DESC` &extenders=`pkStatus` &tagData=`acNews` &debug=`0`!]