should work without
&language=`[[++cultureKey]]`
I have another problem, inside a form I have a placeholder thus [[+previewLink]].
If I set this using $modx->setPlaceholder it has no effect, ie it doesn't set. it seems to retain its old value, unless I clear the site cache. I've tried the $cache parameter set to 0, no effect. I've also tried this syntax [![!+previewLink]] and this one [[!+previewLink]] to no avail.
How do I set placeholders in these cached forms so it works every time?
Use MODx, or the cat gets it!
I have my contactForm in an absolute uncached chunk
inside that chunk
[[!FormIt?
&hooks=`spam,addAttachement,email`
&emailTpl=`emailKontakt`
&emailTo=`[email protected]`
&emailUseFieldForSubject=`1`
&validate=`name:required,
email:email:required,
subject:required,
text:required:stripTags`
]]
[[!placeholdertest]]
[[!+placeholdertest]]
<form action="[[~[[*id]]]]" method="post" class="form">
<input type="hidden" name="nospam:blank" value="" />
<div class="form-group">
<label for="name">
Name:
</label>
<input type="text" class="form-control" name="name" id="name" value="[[!+fi.name]]" />
<span class="error">[[!+fi.error.name]]</span>
.
.
.
.
the snippet placeholdertest is
$modx->setPlaceholder('placeholdertest',$_REQUEST['email']);
the mmlCache - snippet runs in cache-modus (&cache=`1`)
seems do work without issues.
what is your whole scenario?
Yes, I have one place holder outside of the form like yours and it works, its the two that are inside the form like so
<input id="storyFormPreviewLink" name="storyFormPreviewLink" type="hidden" value="[[+previewLink]]" />
that dont work.
If I set these on page entry in a snippet it works, if I then comment out the setting in the snippet and refresh the page you would expect the values to return to 'value=' ie not set, in fact they don't they appear with the values as previously set by the snippet, as though the snippet was still setting them, if you clear the site cache and refresh the page it works, i.e. they adopt the values expected.
Try moving your place holders above inside the form.
Use MODx, or the cat gets it!
Hi,
I'm having trouble getting pagination to work and wonder if it's something to do with the mml_cache setting?
I have the following call:
[![!getPage?
&elementClass=`modSnippet`
&element=`dw_getStoryResources`
&parents=`39`
&tpl=`storyItemListTpl`
&includeContent=`1`
&includeTVs=`1`
&processTVs=`1`
&showHidden=`1`
&hideContainers=`1`
&limit=`12`]]
If i change the &limit to a much higher number (eg. 70 +) then the items display but setting this to 12 doesn't display anything. Any ideas?
Thanks
J
www.9thwave.co.uk
WEB | DESIGN | PRINT
I don't know what your dw_getStoryResources - snippet does.
Just tested this:
[[!pdoPage?
&element=`pdoResources`
&parents=`58`
&loadModels=`migxmultilang`
&prepareSnippet = `mmlTranslatePdoToolsRow`
&includeTVs=`mml_pagetitle`
&prepareTVs=`1`
&tpl=`testTpl`
&limit=`2`
]]
my chunk testTpl is just:
this is working and translating without issues
As recommended, you should allways try to use the pdoTools - snippets
with
&loadModels=`migxmultilang`
&prepareSnippet = `mmlTranslatePdoToolsRow`
if you want translated results
dw_getStoryResources is just a copy of the standard getResources snippet with extra filtering so its getPage compatible , your example above uses pdoPage, not getPage, we use a standard getPage call thus :-
[![!getPage?
&elementClass=`modSnippet`
&element=`dw_getStoryResources`
&parents=`39`
&tpl=`storyItemListTpl`
&includeContent=`1`
&includeTVs=`1`
&processTVs=`1`
&showHidden=`1`
&hideContainers=`1`
&limit=`140`]]
are you saying this won't work with the mml stuff.
Use MODx, or the cat gets it!
I didn't try to work with getPage and getResources inside mmlCache.
It should work, but it wouldn't translate anything, because getResouces doesn't know anything about the translated fields.