Hi all!
It seems, my example isn’t too hard, but i still can’t figure it out, so when it will be cleaned it will be useful.
The challenge is that users can leave posts without any registration, but leaving their name, post title, and post body.
for exp, chunk tpl:
<form name="NewsPublisher" method="post" action="[~[*id*]~]">
<fieldset>
<h3>Header</h3>
<input name="NewsPublisherForm" type="hidden" value="on" />
<label for="pagetitle">Post title <abbr title="Post title">?</abbr>: <input name="pagetitle" id="pagetitle" type="text" size="40" value="[+pagetitle+]" /></label><br />
<label for="nick">Your name <abbr title="Your name">?</abbr>: <input name="nick" id="nick" type="text" size="40" value="[+nick+]" /></label><br />
</fieldset>
<fieldset>
<label for="content">[*blogContent*]</label>
</fieldset>
<fieldset>
<input name="Send" type="submit" value="Send!" class="button" />
</fieldset>
</form>
I create an extender for "nick" param, but i am not skilled in php, so i don’t know how to make it work ))
<?php
$placeholders['nick'] = array("*","displayNick");
if(!function_exists('displayNick')){
function displayDetail($resource){
return($resource['nick']);
}
}
?>
it doesn’t work for now, modx writes:
« Execution of a query to the database failed - Unknown column ’sc.nick’ in ’field list’ »
SQL: SELECT DISTINCT sc.id,sc.nick,sc.introtext,sc.content,sc.createdby,sc.published,sc.pagetitle,sc.createdon FROM `belkau12_baza1`.`modx_site_content` sc LEFT JOIN `belkau12_baza1`.`modx_document_groups` dg on dg.document = sc.id WHERE (sc.id IN (71,73,74,75,76,77,78,79,80,81,82) AND sc.published=1 AND sc.deleted=0 ) AND (sc.privateweb=0) GROUP BY sc.id ORDER BY sc.createdon DESC
Thank you for help