• Register
    • Help

    striker  0 Items
    Currently Supporting
    • Home
    • News
    • Forum
    • Wiki
    • Support
      • Manage Subscriptions
      • FAQ
      • Support For
        • VaultWiki 4.x Series
        • VaultWiki.org Site
    • What's New?
    • Buy Now
    • Manual
    • 
    • Support
    • VaultWiki 4.x Series
    • Feature
    • Support for XF custom fields

    1. Welcome to VaultWiki.org, home of the wiki add-on for vBulletin and XenForo!

      VaultWiki allows your existing forum users to collaborate on creating and managing a site's content pages. VaultWiki is a fully-featured and fully-supported wiki solution for vBulletin and XenForo.

      The VaultWiki Team encourages you to join our community of forum administrators and check out VaultWiki for yourself.

    Issue: Support for XF custom fields

    • Issue Tools
      • View Changes
    1. issueid=5523 October 28, 2018 1:25 PM
      Alfa1 Alfa1 is offline
      Distinguished Member
      Support for XF custom fields

      This is a function that I regularly need and which would make a lot of use of.
      I would for example create a dropdown field to assign statuses to articles. Or fill standardized information.

      By default xenforo has:
      • single line text box
      • Multi Line text box
      • Rich text box
      • drop down selection
      • radio buttons
      • multiple choice drop down
      • star rating


      Pretty much all XF addons with content types have this functionality. It would be mighty useful for Vaultwiki.

      XenForo has value display html for fields which allows us to do a wide spectrum of custom stuff.
      It also has field permissions.
      It also becomes possible to search for articles/pages that have certain field value.

      I'm sure that implementing this would implement several planned feature requests.
    Issue Details
    Issue Number 5523
    Issue Type Feature
    Project VaultWiki 4.x Series
    Category Editing Pages
    Status Implemented
    Priority 8 - Major Features / Enhancements
    Suggested Version 4.1.0 Alpha 1 Preview
    Implemented Version 4.1.0 RC 2
    Milestone (none)
    Software DependencyXenForo 1.x
    License TypePaid
    Votes for this feature 0
    Votes against this feature 0
    Attachments 0
    Assigned Users (none)
    Tags (none)




    1. November 8, 2018 5:45 PM
      Alfa1 Alfa1 is offline
      Distinguished Member
      Also consider the XF2.1 custom fields drag n drop feature:
      https://xenforo.com/community/thread...1/post-1294637
      Reply Reply  
    2. April 22, 2019 10:25 AM
      Alfa1 Alfa1 is offline
      Distinguished Member
      I'll illustrate one of the many ways how custom fields would be a massive step forward.

      Lets say we have a wiki about lizards.
      We could add a field 'forum ID' and add an explanation for users that they need to fill in the forum ID of the forum that relates to the wiki article.
      A user fills in the forum ID for the lizard forum.
      We can use the XenForo function 'value display html' to automatically create a link to the lizard forum which we can place in a sidebar widget or anywhere on the wiki page. We can take it a step further and have it generate a button 'Lizard Forum'.

      And that's just one of many things we could do if XenForo custom fields are implemented.
      Reply Reply  
    3. March 3, 2020 1:22 PM
      pegasus pegasus is offline
      VaultWiki Team
      This is implemented in the next release, at least for XenForo 2.x. We may backport support for other platforms if there is enough demand.

      I should note that this does not use the underlying AbstractField classes in XenForo 2. There are significant differences in the way the fields work that it became almost meaningless. You'll see as I explain the implementation.

      History

      Custom field values are tracked in a page's history, and are outlined in each revision's change summaries. When comparing revisions, custom fields are also diffed and highlighted accordingly. Custom field changes are also reverted by rollbacks.

      Admin Page

      For the most part, the new AdminCP > Content > Custom Fields is a clone of the Thread Fields page. Except you choose to apply each field to areas instead of forums. Additionally, you choose which wiki content-types the field applies to within those areas. And additionally you can choose which areas have templates that can populate the field (more on this later).

      Most of the field types and match types are clones of what you know from XenForo's Thread Fields. However, if you want to translate the phrases for a field, the names are as follows:
      - vw_custom_field_{fieldname}_{title|description}
      - vw_custom_field_{fieldname}_choice_{choiceValue}
      The date type has been changed to permit accepting times too.

      The following field types have been added:
      - Wiki Page
      - Wiki File
      For both of these, you can choose to render it as a link or to transclude/embed the target.

      The following display groups are available:
      - Top (between the title bar and the page content)
      - Bottom (between the page content and the categories, contributors, etc)
      - Infobox (makes it available to a new XF widget, which you'll need to setup separately in the Widgets AdminCP page if you use this grouping)
      - Details Tab (the page now has a Details tab, containing all fields in this grouping)
      - New Tab (the field renders as its own tab; you can define the URL's action parameter)
      - Metadata (the field is only used as invisible page metadata. How is this useful? See below)

      There is an option to make a field searchable. If this is selected, the search metadata is generated as follows:
      - The fields are rendered in plaintext and prepended to the wiki page's content. For choice-fields, the choice text is used. Keywords that appear in choice-text or textarea/bbcode/textbox-related fields will trigger search results.
      - Choice fields, number fields, wiki page, wiki file are available as search metadata fields (n.b. this kind of metadata supports matching only, not greater/less than comparisons). They can be used for custom search filters by other add-ons, or maybe we will expand on this in core in the future.

      Template Fields

      If you setup a field's config so that it is available to templates in an area, then you can template some field values, so that pages that use the template populate their own field values, if the page has that field but has left it blank. In this way, you can ignore filling a required field if you use a template that will fill it. Templated fields permit dynamically generated field values for any field type.

      When editing a template, in addition to any custom fields the template itself has (for its own metadata), the fields that can be templates are presented. However, regardless of the field type, you will be filling in a text box with BB-Code. That way you can use IF, VAR, template-parameters, etc in order to generate a value.

      Note that a page will only get a templated value if the field evaluates to one that validates based on the field type. Some examples:
      - If the underlying field type is supposed to a date, it must evaluate to date format.
      - If the field type is supposed to be a Wiki Page/File, it must evaluate to Prefix:PageTitle.
      - If the field type is supposed to be a select or radio, it must evaluate to one of the values therein. The editor will show the options and their corresponding values.
      - If the field type is supposed to be a multi-select or checkboxes, it must evaluate to a comma-separated list of the values therein. The editor will show the options and their corresponding values.

      VAR

      There is a new related option for the VAR BB-Code.

      Render a page's custom field:
      Code:
      [var]field|myFieldName[/var]
      Get the raw value for the page's custom field:
      Code:
      [var]field|myFieldName|raw[/var]
      Render a field from a different page:
      Code:
      [var]field|myFieldName|Prefix:PageTitle[/var]
      (add |raw to get the raw value)

      Note that when saving a page, values inherited from a template are not yet available to VAR, and cannot be made available -- there would be a chicken vs egg problem. This means you should not use VAR-field to retrieve values inherited from a template for certain purposes like: generating a link, defining a Wanted Category, passing to another template. In these cases, you must set a custom field value for the page itself in order for it to be available.
      Reply Reply  
    4. March 11, 2020 10:01 PM
      Alfa1 Alfa1 is offline
      Distinguished Member
      This is massive. It will be very interesting to play around with this.
      Reply Reply  
    5. April 14, 2020 7:56 AM
      expanserpb expanserpb is offline
      Junior Member
      What does the attachment field do? It just displays as a text box. I did turn attachment content back on briefly for this, but it's off again now.

      Searching for pages does not work. (For wiki content)

      Color does not work. On mine when you save it strips the # and displays as blank.

      https://chroniclesrp.net/Folklore/Sa...talline-Katana
      Reply Reply  
    6. April 14, 2020 11:47 AM
      pegasus pegasus is offline
      VaultWiki Team
      Except for color, the rest appear to be a broken Javascript file. Thanks for reporting that. Apparently there was a problem with our site's download system.

      When downloading Javascript files that were composite files of multiple smaller component files, the downloader delivered the composite at the time of the last component in the file, where the correct behavior should have been to deliver the composite at the time of the last-edited component in the file. In practice it means you received an icon-chooser file from Alpha 2, rather than RC 2, among other Javascript discrepancies. The problem has been corrected. Please download a new package and re-upload the js directory to your site.

      For the color problem, in src/addons/vw/vw/_core/model/customfield/vw.php, find:
      Code:
      				$value = $newhex;
      			}
      
      			return true;
      Replace with:
      Code:
      				$value = $newhex;
      			}
      
      			$value = '#' . $value;
      
      			return true;
      You will need to re-edit the color field.

      In the next release, fixed Wiki Attachment custom fields appearing in the editor while the content-type is disabled.
      Reply Reply  
    7. June 26, 2020 6:20 PM
      Alfa1 Alfa1 is offline
      Distinguished Member
      How do you filter an Area for a custom field value?
      For example, we have a custom field 'status' with the option 'complete'.
      How do I filter the area to display all Pages with the status 'complete' ?
      Reply Reply  
    8. June 27, 2020 12:18 PM
      pegasus pegasus is offline
      VaultWiki Team
      There is no way to do that. Searchable custom field values are indexed; they are not filterable. It is like the field value is included in the body text.
      Quote Originally Posted by pegasus
      There is an option to make a field searchable. If this is selected, the search metadata is generated as follows:
      - The fields are rendered in plaintext and prepended to the wiki page's content. For choice-fields, the choice text is used. Keywords that appear in choice-text or textarea/bbcode/textbox-related fields will trigger search results.
      - Choice fields, number fields, wiki page, wiki file are available as search metadata fields (n.b. this kind of metadata supports matching only, not greater/less than comparisons). They can be used for custom search filters by other add-ons, or maybe we will expand on this in core in the future.
      This states that you would currently need an add-on to make a filter for your custom field. We may add it in a future version, but the data is available now if you need it sooner.
      Reply Reply  
    9. June 27, 2020 8:14 PM
      Alfa1 Alfa1 is offline
      Distinguished Member
      It would be great to have. I have been using it on various XF addons. Including Article Management System. Since VW uses prefixes differently than forums, there doesn't seem to be a way to filter articles by status. We need a way to filter and figure out which articles need to be worked on and which are ready.
      Reply Reply  
    10. June 29, 2020 12:48 PM
      pegasus pegasus is offline
      VaultWiki Team
      In MediaWiki, and thus VaultWiki, the traditional status method was to use Categories to manage status.
      Category:Needs-Work
      Category:Needs-References
      etc

      In 4.1.0 RC 1, we fixed a regression from VaultWiki 3.x that was making this harder.

      Now, if you want to automate this through Custom Fields, you can currently do a setup like:
      - Have custom field "Status" with field ID "wiki_status" which is a drop-down field.
      - In the wiki template you use for articles, add code like:
      Code:
      [category][var]field|wiki_status|r[/var][/category]
      When a page uses that template, it is automatically added to a Wanted-Category with the same name as the selected wiki_status value that was selected for that article. Wanted-Categories are different from normal categories in that they require review due to being automated, and they do not need to exist. You can use Special:WantedCategories to find entries from non-existing categories. If the category exists, you can view the category normally and see wanted-entries.

      A technical discussion of Wanted-Categories can be found here: https://www.vaultwiki.org/issues/3488/#note32639
      Reply Reply  
    11. July 5, 2020 8:54 AM
      Alfa1 Alfa1 is offline
      Distinguished Member
      I have added an infobox to display on wiki sidebar/header/sidebar, and added an infobox field. Then edited a page infobox custom field and saved. Nothing shows. What am I missing here?
      Reply Reply  
    12. July 5, 2020 11:58 AM
      pegasus pegasus is offline
      VaultWiki Team
      AdminCP > Wiki > Area Manager > edit area > Widgets shown in this area
      Reply Reply  
    13. July 5, 2020 9:09 PM
      Alfa1 Alfa1 is offline
      Distinguished Member
      I still see nothing displayed.
      Reply Reply  
    14. July 6, 2020 12:00 PM
      pegasus pegasus is offline
      VaultWiki Team
      By any chance, do you have custom fields set to any custom infobox groupings/headings?
      I see a bug where if there are any groupings defined, then it is impossible to assign fields without a grouping to any infoboxes, and it is impossible to exclude a specific grouping from any infoboxes. In that case, if you have a page that has filled only ungrouped fields, then no infobox will appear because those fields are not assigned to an infobox.

      In src/addons/vw/vw/_core/controller/cp/block/infobox/vw.php, find:
      Code:
      		$groups = $input->clean_gpc('p', 'group', 'ARRAY');
      		$choices = $this->get_choices();
      		$selected = array();
      
      		foreach ($choices AS $choice)
      		{
      			if (!empty($groups["$choice"]))
      			{
      				$selected["$choice"] = 1;
      			}
      		}
      
      		if (empty($selected))
      		{
      			foreach ($choices AS $choice)
      Replace with (scrollbar):
      Code:
      		$groups = $input->clean_gpc('p', 'groups', 'ARRAY');
      		$choices = $this->get_choices();
      		$selected = array();
      
      		if (isset($groups[0]))
      		{
      			$groups[''] = $groups[0];
      			unset($groups[0]);
      		}
      
      		foreach ($choices AS $choice => $choicetext)
      		{
      			if (!empty($groups["$choice"]))
      			{
      				$selected["$choice"] = 1;
      			}
      		}
      
      		if (empty($selected))
      		{
      			foreach ($choices AS $choice => $choicetext)
      Then, if you re-edit the widget in the AdminCP, you should now be able to save your desired groupings selection so that they are included by the renderer.
      Reply Reply  
    + Reply

    Assigned Users
    Loading Please Wait
    Tags
    Loading Please Wait
    • Contact Us
    • License Agreement
    • Privacy
    • Terms
    • Top
    All times are GMT -4. The time now is 9:29 AM.
    This site uses cookies to help personalize content, to tailor your experience, and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Learn more… Accept Remind me later
  • striker
    Powered by vBulletin® Version 4.2.5 Beta 2
    Copyright © 2025 vBulletin Solutions Inc. All rights reserved.
    Search Engine Optimisation provided by DragonByte SEO (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
    Copyright © 2008 - 2024 VaultWiki Team, Cracked Egg Studios, LLC.