Tuesday, October 2, 2012

Adding custom columns/fields to Joomla article, section and user

Run:
ALTER TABLE `jos_content` ADD `article_image` VARCHAR( 255 ) NOT NULL
in for instance phpMyAdmin.

Edit administrator/components/com_content/models/article.xml add:

in the first params section for instance below the access entry.
Add
  1. var $article_image = null;
to libraries/joomla/database/table/content.php
Add
  1. $form->set('article_image', $row);
to editContent() in administrator/components/com_content/controller.php

The result is that you now have a new field called article_image that can be used in various ways to display a separate image that is not a part of the article, similar to what you have per default for categories and sections.

Source: http://saigonphuyen.com/showthread.php?381

No comments:

Router Packet Networking

Đây là video ngắn khá hay, mô tả đường đi của một gói tin trên Mạng Internet.