Another error…
The data matrix field isn’t included in the SAEF but when viewing an entry in the control panel submitted from the SAEF I get the following errors…
Warning: array_keys() [function.array-keys]: The first argument should be an array in /path/to/cp/extensions/ext.lg_data_matrix_ext.php on line 1038
Warning: Invalid argument supplied for foreach() in /path/to/cp/extensions/ext.lg_data_matrix_ext.php on line 1039
Sorry I should have maybe dug a little deeper first. Sending the columns as hidden inputs seems to have sorted it. Might be nice to do it without though.
<input value="" name="field_id_115[cf_news_external_url][]" type="hidden" />
<input value="" name="field_id_115[cf_news_external_label][]" type="hidden" />
The no parsing in the template is still annoying me though if anyone has any ideas.
Leevi, I’m trying this out but in my template the tags aren’t being parsed. Using the code…I get {lg_data_matrix limit="10"}{rows}{cf_news_links_label} {/rows}{/lg_data_matrix} * {cf_news_links_label} is linked.{lg_data_matrix limit="10"} {rows} <li><a href="http://{cf_news_links_url}">{cf_news_links_label}</a></li> {/rows} {/lg_data_matrix}
Hey Smallbeer,
{lg_data_matrix … should be your custom filed short name. By the looks of things it could be {cf_news_links}?
In the example my custom field was {lg_data_matrix}
Cheers
Another error… The data matrix field isn’t included in the SAEF but when viewing an entry in the control panel submitted from the SAEF I get the following errors…Warning: array_keys() [function.array-keys]: The first argument should be an array in /path/to/cp/extensions/ext.lg_data_matrix_ext.php on line 1038 Warning: Invalid argument supplied for foreach() in /path/to/cp/extensions/ext.lg_data_matrix_ext.php on line 1039
Feel like a bit of hacking? 😊
Try change lines 1030 - 1044 (or there abouts) to:
// new entry
if(($cols = unserialize($field_data)) === FALSE || empty($field_data) === TRUE)
{
$r .= $this->_build_row($this->conf['cols']);
}
// edit
else
{
$col_short_names = array_keys($cols);
foreach ($cols[$col_short_names[0]] as $rows)
{
$r .= $this->_build_row($this->conf['cols'], $cols);
}
}
$r = "<div class='lg_multi-text-field'>".$r."</div> <a class='add-row'>Add row</a>";
This should check if there is actually data to unserialise and build the rows. If there is no record the extension is still storing an empty array. I’ll try and update it so that if there is an empty row it doesn’t get stored.
Cheers
Leevi, I’m trying this out but in my template the tags aren’t being parsed. Using the code…Hey Smallbeer, {lg_data_matrix … should be your custom filed short name. By the looks of things it could be {cf_news_links}? In the example my custom field was {lg_data_matrix} CheersI get {lg_data_matrix limit="10"}{rows}{cf_news_links_label} {/rows}{/lg_data_matrix} * {cf_news_links_label} is linked.{lg_data_matrix limit="10"} {rows} <li><a href="http://{cf_news_links_url}">{cf_news_links_label}</a></li> {/rows} {/lg_data_matrix}
Thanks mate, I am an idiot.
This is awesome! I actually wished for something like this in the feature request forum.
I did run into a few small issues. I can’t seem to get an “if” statement to work on the inner fields. Is this doable? Also, if there was some way to get this to work in an SAEF (by the way, your file upload for SAEF works like a charm), I’ll roll around on the floor like a happy dog.
Here’s an example of what I was trying to do for the output page.
Example:
{loc}
<dl>
<dt>{loc_name}</dt>
<dd>{loc_street}</dd>
{if loc_tel}<dd>phone: {loc_tel}</dd>{/if}
</dl>
{/loc}
When I did try it on an SAEF (along with the file upload extension) the file uploaded to the wrong field. The actual field currently has Mark Huot’s file for the custom field type, so maybe that’s causing a problem there? EDIT: The file upload extension works fine. I had the wrong ID. Ewps. The other issue is that the Data Matrix Fields don’t get filled.
Those I added like this:
<input value="" name="field_id_6[loc_name][]" type="text" />
<label>Event Location Street Address</label>
<input value="" name="field_id_6[loc_street][]" type="text" />
I still have issues with MarkItUp in weblogs where there is also a DataMatrix field. It works fine in any weblog where there’s NOT one, but it fails to display if there is one. I can PM you if you’d like to take a look. I’m now updated to v.0.0.5 and still have the issue.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.