Hi, I have a strange problem trying to view the TV variables list from a document.
If I use a "normal" TV, everything works without problems but if I use a bind (@CHUNK), the variables list is not shown in the "Template Variables" panel of the document.
This happen even with a single variable like the following:
Variable name: context_menu
Caption: Change the context menu
Description: Change the context menu on per-page basis.
Category: (none)
Lock variable for editing: no
Sort order: 0
Clear cache on save: yes
Input type: text
Input option values: (none)
Default value: @CHUNK cnkMenuHome
Output type: string
String format: (none)
The chunk cnkMenuHome is correctly defined in the "Chunks" section and the variable is associated to the template used for the pages (in the "Template Variables" panel under the "Templates" section, the list appears correctly).
In these conditions, the variables list in "Templates variables" of the documents is not shown.
If I use anyway the variable in a document, putting [[* context_menu]] somewhere in the resource content, the page in the front-end appears completely blank.
With MODx Revolution 2.0.0 RC1, everything worked properly. I made several tests, both updating MODx from RC1 to RC2 that installing RC2 from scratch and recreating documents, templates, chunks and TV.
Anyone has experienced the same problem?
-
MODX Staff
- 10,725 Posts
Could be a bug; I don’t use the @ bindings much so I personally haven’t experienced it. But if you believe it is a bug, please report it in JIRA.
what is the content of your chunk ’cnkMenuHome’?
Hi,
I’m not sure that this is a bug; I’ve not a huge experience with Modx, so this behavior can be either a bug or my mistake.
The chunk content is the follow:
----------------------------------
<form name="datein">
Data arrivo
[[DatePicker? &SetExtra=`class="selectC"`
&PreselectToday=`true`
&DaysToShift=`1`
&DayName=`wsh_dayin`
&MonthName=`wsh_monthin`
&YearName=`wsh_yearin`]]
<input type="hidden" name="wsh_datein">
<script language="JavaScript">
new tcal ({’formname’: ’datein’,
’controlname’: ’wsh_datein’,
’controlday’: ’wsh_dayin’,
’controlmonth’: ’wsh_monthin’,
’controlyear’: ’wsh_yearin’});
</script>
</form>
<form name="dateout">
Data partenza
[[DatePicker? &SetExtra=`class="selectC"`
&PreselectToday=`true`
&DaysToShift=`3`
&DayName=`wsh_dayout`
&MonthName=`wsh_monthout`
&YearName=`wsh_yearout`]]
<input type="hidden" name="wsh_dateout">
<script language="JavaScript">
new tcal ({’formname’: ’dateout’,
’controlname’: ’wsh_dateout’,
’controlday’: ’wsh_dayout’,
’controlmonth’: ’wsh_monthout’,
’controlyear’: ’wsh_yearout’});
</script>
</form>
----------------------------------
[[DatePicker]] is my snippet used to generate a three listbox date picker; the javascript part create a Tigra Calendar instance to pop-up a small calendar on user request. When placed in the content part of a page, the snippet works fine, so i think that isn’t involved as part of problem.
so far, no prob with your code on my installation. of course I haven’t your snippet to try it.
what, when you remove your snippet-calls from chunk?
Yes, but nothing changes. Also, if I redefines the TV, removing the bindings @CHUNK and copying the chunk code directly into the TV value field, everything works fine.
Anyway, I’m now prone to think about a configuration problem on my servers (or even on my client...), rather than a modx bug, even if I have no evidence of this.