[TH] Custom Fields [Deleted]

This is not the usual functionality as far as I am aware.

Code:
If not empty, this allows you to format the value of this field using HTML, allowing you to do things like link or mark up the output. You may use these placeholders: {$value} - the field's display value; {$valueUrl} - the field's display value for use in a URL, {$choice} - the underlying value of the chosen option, and {$fieldId} - the ID of this field (Retailer).

What is ValueURL for if you have to use <a href="{$value}/">{$value}</a> to get a URL?
 
Code:
If not empty, this allows you to format the value of this field using HTML, allowing you to do things like link or mark up the output. You may use these placeholders: {$value} - the field's display value; {$valueUrl} - the field's display value for use in a URL, {$choice} - the underlying value of the chosen option, and {$fieldId} - the ID of this field (Retailer).

What is ValueURL for if you have to use <a href="{$value}/">{$value}</a> to get a URL?
You should use:
<a href="{$valueUrl}/">{$value}</a>
to be sure that the link is formatted correctly.
 
Sorry to be a pain @Waindigo.

Latest version does not work with http://xenforo.com/community/resources/vfcoders-ajax-first-or-last-post-collapsable.1657/



Code:
PHP <div class="baseHtml"><h4>Template Errors: waindigo_header_node_customfields</h4><ol>
    <li><i>Invalid argument supplied for foreach()</i> in /var/sites/p/priceglitch.com/public_html/library/XenForo/Template/Abstract.php(265) : eval()'d code, line 5: <pre>4:            ';
5: foreach ($thread['customFields'] AS $groupId =&gt; $groupCustomFields)
6: {
</pre></li>
</ol></div>

{"templateHtml":"\n\n\n\n\n<li id=\"post-22\" class=\"message    staff \" data-author=\"glitcher\">\n\n\t\n\n<div class=\"messageUserInfo\" itemscope=\"itemscope\" itemtype=\"http:\/\/data-vocabulary.org\/Person\">\t\n<div class=\"messageUserBlock\">\n\t\n\t\t<div class=\"avatarHolder\">\n\t\t\t<span class=\"helper\"><\/span>\n\t\t\t<a href=\"members\/glitcher.1\/\" class=\"avatar Av1m\" data-avatarHtml=\"true\"><span class=\"img m\" style=\"background-image: url('data\/avatars\/m\/0\/1.jpg?1364681369')\"><\/span><\/a>\n\t\t\t<!-- slot: message_user_info_avatar -->\n\t\n\n\t\n\n\t<div class=\"userMood\">\n\t\t\n\t\t\t<a href=\"moods\/mood-chooser?redirect=%2Fafpch%2Fajax-first-post\" class=\"OverlayTrigger Tooltip\" title=\"Mood Chooser\" data-cacheOverlay=\"false\" data-offsetY=\"-8\">\n\t\t\t\t<img src=\"styles\/default\/xenmoods\/Cloud_9.gif\" alt=\"Cloud_9\" \/>\n\t\t\t<\/a>\n\t\t\n\t<\/div>\n\n\t\t<\/div>\n\t\n\n\n\t\n\t\t<h3 class=\"userText\">\n\t\t\t<a href=\"members\/glitcher.1\/\" class=\"username\" itemprop=\"name\">glitcher<\/a>\n\t\t\t<em class=\"userTitle\" itemprop=\"title\">Administrator<\/em>\n\t\t\t<!-- slot: message_user_info_text -->\n\t\t<\/h3>\n\t\n\t\t\n\t\n\t\t\n\n\n\t<span class=\"arrow\"><span><\/span><\/span>\n<\/div>\n<\/div>\n\t\n\t<div class=\"messageInfo primaryContent\">\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t<div class=\"messageContent\">\t\t\n\t\t\t<div><a class=\"callToAction\" href=\"http:\/\/xenforo.com\/community\/forums\/announcements\/\" rel=\"nofollow\" target=\"_blank\"><span>\n        Find more info at Tesco\n        <small class=\"minorText\">Replies: 1, Latest: Today at 11:45 AM<\/small>\n    <\/span><\/a>\n<\/div><article>\n\t\t\t\t<div id=\"likes-post-22\"><\/div>\n\t\t\t\t<blockquote class=\"messageText ugc baseHtml\">\n\t\t\t\t\t\n\t\t\t\t\ttest\n\t\t\t\t<\/blockquote>\n\t\t\t<\/article><a href=\"http:\/\/www.webshrinker.com\/thumbnails\/show\/key:513b5fbe7d6fd\/size:xlarge\/url:http:\/\/xenforo.com\/community\/forums\/announcements\/\" class=\"LbTrigger\" data-href=\"misc\/lightbox\"><img alt=\"Detour\" border=\"0\" src=\"http:\/\/www.webshrinker.com\/thumbnails\/show\/key:513b5fbe7d6fd\/size:verysmall\/url:http:\/\/xenforo.com\/community\/forums\/announcements\/\" class=\"LbImage\" title=\"Detour\" \/><\/a>\n\t\t\t\n\t\t\t\n\t\t<\/div>\n\t\t\n\t\n\t\n\t\t\n\t\n\n\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\t\t\n\t\t<div class=\"messageMeta\">\n\t\t    \t\n\t\t\t<div class=\"privateControls\">\n\t\t\t\t<span class=\"item muted\">\n\t\t\t\t\t<a href=\"members\/glitcher.1\/\" class=\"username author\">glitcher<\/a>,\n\t\t\t\t\t<a href=\"threads\/w.20\/\" title=\"Permalink\" class=\"datePermalink\"><abbr class=\"DateTime\" data-time=\"1373538153\" data-diff=\"8104\" data-datestring=\"Jul 11, 2013\" data-timestring=\"11:22 AM\">Jul 11, 2013 at 11:22 AM<\/abbr><\/a>\n\t\t\t\t<\/span>\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t<a href=\"posts\/22\/edit\" class=\"item control edit OverlayTrigger\"\n\t\t\t\t\t\tdata-href=\"posts\/22\/edit-inline\" data-overlayOptions=\"{&quot;fixed&quot;:false}\"\n\t\t\t\t\t\tdata-messageSelector=\"#post-22\"><span><\/span>Edit<\/a>\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t<a href=\"posts\/22\/delete\" class=\"item control delete OverlayTrigger\"><span><\/span>Delete<\/a>\n\t\t\t\t\n\t\t\t\t<a href=\"posts\/22\/ip\" class=\"item control ip OverlayTrigger\"><span><\/span>IP<\/a>\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t<a href=\"posts\/22\/report\" class=\"OverlayTrigger item control report\" data-cacheOverlay=\"false\"><span><\/span>Report<\/a>\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t<\/div>\n\t\t\t\n\t\t\t<div class=\"publicControls\">\n\t\t\t\t<a href=\"threads\/w.20\/\" title=\"Permalink\" class=\"item muted postNumber hashPermalink OverlayTrigger\" data-href=\"posts\/22\/permalink\">#1<\/a>\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t<a href=\"threads\/w.20\/reply?quote=22\" data-postUrl=\"posts\/22\/quote\" class=\"ReplyQuote item control reply\" title=\"Reply, quoting this message\"><span><\/span>Quote<\/a>\n\t\t\t\t\n\t\t\t\t\n\t\t\t<\/div>\n                    \n\t\t<\/div>            \n\t\n\t\t\n\t\t<div id=\"likes-post-22\"><\/div>\n\t<\/div>\n\n\t\n\t\n\t\n\t\n<\/li>","threadId":20,"postId":22,"css":{"stylesheets":["mood_display","message_user_info","bb_code","message"],"urlTemplate":"css.php?css=__sentinel__&style=3&dir=LTR&d=1373545944"},"js":["js\/xenforo\/discussion.js?_v=9f987161"],"_visitor_conversationsUnread":"0","_visitor_alertsUnread":"0"}
 
Not at all. We rely on members of the community to let us know when there are incompatibilities with other add-ons.

You can stop this error by replacing line 285 of /library/Waindigo/CustomFields/Listener/TemplateHook.php:
PHP:
$this->_render('waindigo_header_node_customfields', $viewParams) .
with:
PHP:
(isset($viewParams['thread']['customFields']) ? $this->_render('waindigo_header_node_customfields', $viewParams) : '') .

I will add this code to the next update.
 
Last edited:
Still the same:

upload_2013-7-11_14-23-39.webp

Code:
--
[14:21:46.704] PHP <div class="baseHtml"><h4>Template Errors: waindigo_header_node_customfields</h4><ol>
    <li><i>Invalid argument supplied for foreach()</i> in /var/sites/p/priceglitch.com/public_html/library/XenForo/Template/Abstract.php(265) : eval()'d code, line 5: <pre>4:            ';
5: foreach ($thread['customFields'] AS $groupId =&gt; $groupCustomFields)
6: {
</pre></li>
</ol></div>
 
Sorry, I made a mistake copying the code (have now corrected above). It should be:
Rich (BB code):
(isset($viewParams['thread']['customFields']) ? $this->_render('waindigo_header_node_customfields', $viewParams) : '') .
 
Last edited:
any chance of adding date picker ?

'textbox','textarea','select','radio','checkbox','multiselect','callback','datepicker'

Added to "custom_field_edit"
Code:
<xen:if is="{$field.field_type} == 'textbox'">
            <input type="text" name="custom_fields[{$field.field_id}]" value="{$field.field_value}"
                id="ctrl_custom_field_{$field.field_id}"
                data-validatorname="custom_field_{$field.field_id}"
                class="textCtrl" maxlength="{xen:if $field.max_length, $field.max_length}"
            />
        <xen:elseif is="{$field.field_type} == 'datepicker'" />
            <input type="date" name="custom_fields[{$field.field_id}]" value="{$field.field_value}"

Seems to work ok.
 
any chance of adding date picker ?

'textbox','textarea','select','radio','checkbox','multiselect','callback','datepicker'

Added to "custom_field_edit"
Code:
<xen:if is="{$field.field_type} == 'textbox'">
            <input type="text" name="custom_fields[{$field.field_id}]" value="{$field.field_value}"
                id="ctrl_custom_field_{$field.field_id}"
                data-validatorname="custom_field_{$field.field_id}"
                class="textCtrl" maxlength="{xen:if $field.max_length, $field.max_length}"
            />
        <xen:elseif is="{$field.field_type} == 'datepicker'" />
            <input type="date" name="custom_fields[{$field.field_id}]" value="{$field.field_value}"

Seems to work ok.
How about this:
http://xenforo.com/community/resources/date-field-for-custom-fields-1-1-x-custom-field-xml.2070/
 
My only suggestion would be to not autopopulate the date fields as if field isn't mandatory, you can't click on date highlight and then delete. You have to put cursor to right and then backspace. Not a big deal though.
 
My only suggestion would be to not autopopulate the date fields as if field isn't mandatory, you can't click on date highlight and then delete. You have to put cursor to right and then backspace. Not a big deal though.
If you post in the forum for that resource I'll try and figure out what code you need to change. I've just left the office though (it is 2am after all) so I'll look later.
 
ok so after getting it working ok in our staging server I just tried pushing across to the production environment and get the following error for any page with custom fields:

HTML:
An exception occurred: Undefined index: customPostFields in /var/app/current/public_html/forums/library/Waindigo/CustomFields/Listener/TemplatePostRender.php on line 202

XenForo_Application::handlePhpError() in Waindigo/CustomFields/Listener/TemplatePostRender.php at line 202
Waindigo_CustomFields_Listener_TemplatePostRender->_postEdit() in Waindigo/CustomFields/Listener/TemplatePostRender.php at line 243
Waindigo_CustomFields_Listener_TemplatePostRender->_threadView()
call_user_func_array() in Waindigo/Listener/TemplatePostRender/20130522.php at line 100
Waindigo_Listener_TemplatePostRender->_runTemplateCallback() in Waindigo/Listener/TemplatePostRender/20130522.php at line 53
Waindigo_Listener_TemplatePostRender->run() in Waindigo/CustomFields/Listener/TemplatePostRender.php at line 36
Waindigo_CustomFields_Listener_TemplatePostRender::templatePostRender()
call_user_func_array() in XenForo/CodeEvent.php at line 54
XenForo_CodeEvent::fire() in XenForo/Template/Abstract.php at line 195
XenForo_Template_Abstract->render() in XenForo/Template/Public.php at line 110
XenForo_Template_Public->render() in XenForo/ViewRenderer/HtmlPublic.php at line 119
XenForo_ViewRenderer_HtmlPublic->renderContainer() in XenForo/FrontController.php at line 568
XenForo_FrontController->renderView() in XenForo/FrontController.php at line 156
XenForo_FrontController->run() in /var/app/current/public_html/forums/index.php at line 13

Help!
 
Custom Post Fields:

I created Fields the Mobi and websites, but I do not find option Field is required

and content of these two fields are not displayed in post

12321.webp
1221.webp
 
I created a mandatory custom thread field, tested it out and it worked fine. I then went to update the description of the field and this field was no longer mandatory. I went to the node and the Required Fields were no longer checked.
 
ok so after getting it working ok in our staging server I just tried pushing across to the production environment and get the following error for any page with custom fields:

HTML:
An exception occurred: Undefined index: customPostFields in /var/app/current/public_html/forums/library/Waindigo/CustomFields/Listener/TemplatePostRender.php on line 202

XenForo_Application::handlePhpError() in Waindigo/CustomFields/Listener/TemplatePostRender.php at line 202
Waindigo_CustomFields_Listener_TemplatePostRender->_postEdit() in Waindigo/CustomFields/Listener/TemplatePostRender.php at line 243
Waindigo_CustomFields_Listener_TemplatePostRender->_threadView()
call_user_func_array() in Waindigo/Listener/TemplatePostRender/20130522.php at line 100
Waindigo_Listener_TemplatePostRender->_runTemplateCallback() in Waindigo/Listener/TemplatePostRender/20130522.php at line 53
Waindigo_Listener_TemplatePostRender->run() in Waindigo/CustomFields/Listener/TemplatePostRender.php at line 36
Waindigo_CustomFields_Listener_TemplatePostRender::templatePostRender()
call_user_func_array() in XenForo/CodeEvent.php at line 54
XenForo_CodeEvent::fire() in XenForo/Template/Abstract.php at line 195
XenForo_Template_Abstract->render() in XenForo/Template/Public.php at line 110
XenForo_Template_Public->render() in XenForo/ViewRenderer/HtmlPublic.php at line 119
XenForo_ViewRenderer_HtmlPublic->renderContainer() in XenForo/FrontController.php at line 568
XenForo_FrontController->renderView() in XenForo/FrontController.php at line 156
XenForo_FrontController->run() in /var/app/current/public_html/forums/index.php at line 13

Help!

Hi @Waindigo - We could really use help with this - we have had to disable the add-on and we had some really cool things with it going on in our forums. :( Please help.
 
Top Bottom