Rate this article
3.67
  • email Email to a friend
  • print Print version
  • Plain text Plain text
Browsing: Home » How-Tos

Custom Field Mapping

Custom Field Mapping allows you to extend the functionality of your website by adding specific attributes to the system. For example, you can extend the article pages by adding a sub-headline, or "Author age", or whatever you need.

Requirement: basic MySQL, xHTML and PHP knowledge.

1. Create new field "source" in mySQl table (ie Articles)

field_map_1_230882617.jpg

2. Add new input field to your Article add/edit form

Open admin/templates/article_edit/form.xml in your favorite editor.

Add folowing code:

<div class="content_list_body_header_line1">
  Source: <input type="text" class="article_title" name="ARTICLE_source" value="{article.source}" />
</div>

field_map_2_421513631.jpg

Notice the name of input field ARTICLE_source (you need to use ARTICLE_your_field_name) and value article.source (also you would use article.your_field_name)

field_map_3_171291133.jpg

3. Add new field to your frontend template

Open templates/xhtml/article/default.tpl and add following code:

(<vte:value select="{article.source}" />)

field_map_4_435342195.jpg

after article title (or whereever)

field_map_5_708319094.jpg

NOTE: There is no sorting and filtering by custom fields.

Comments (0 posted):

You must be registered member of Vivvo.net to post a comment.