English 中文(简体)
在Joomla 1.7 com_content
原标题:Add new image field to Joomla 1.7 com_content

I m trying to make some changes to com_content component of Joomla 1.7 There are not many docs on specific topic for Joomla 1.7

Maybe you could help me out on this one.

我想有一个单独的外观图像领域,具体来说就是特意。

在行政长官的第一部分中,我设法补充了这个领域——就在html,然后输入xml文档,最后又输入到亚洲开发银行。

现在,我试图在我对特稿的“html”看法中展示这一记录。

I just used simple code echo $this->item->addimage; but unfortunately it s not displayed.

Any ideas how to achieve that?

感谢!

我已经注意到,在Joomla 1.7,部分发展结构、非行登记等等也发生了改变。 任何有益联系,凡事都得到很好的解释?

问题回答

好。 如果你确信你执行你所做的工作是行之有效的。 页: 1 在数据库中储存了来自您所补充的外地的受照图像或单纯的URL链接,可以查阅网页:/components/com_content/views/featured/tmpl/default_item.php

您应当把本金加特;项目和项目加权变量等放在:

<img src="<?php echo $this->item->addimage; ?>" />

如果你储存URL链接,或

<img src="image/png;base64,<?php echo $this->item->addimage; ?>" />

如果您将图像储存为REW基64 编码数据


Edit: This should solve your problem if you add your articles from frontend (if backend, just let me know)

  1. Firstly create a new column in jos_content table like:

addimage varchar(255) DEFAULT NULL

然后修改以下档案:

  1. ./com_content/views/featured/tmpl/default_image.php [LINE: 29]

    29:#</h2>

    30:#<?php endif;?>

    32: <?php if(!empty($this->item->addimage)): ?>

    33:<img src='<?php re$this->item->addimage; ?>” alt=“ADDIMAGE”/>

    34: <?php endif; ?>

    36: #<?php if ($params->get( show_print_icon ) || $params->get( show_email_icon ) || $canEdit) : ?>

  2. ./com_content/models/articles.php [LINE: 160]

    160:#$this->getState (

    页: 1 选编

    162: a.id, a.title, a.alias, a. entitled_alias, a.introtext, a.addimage,

    163:# a.checked_out, a.checked_out_time,

  3. .com_content/models/forms/article.xml [ADD SOMEWHERE]

    <field id="addimage" name="addimage" type="text" label="Add Image" class="inputbox" />

  4. ./com_content/views/form/tmpl/edit.php [LINE: 82]

    82:#<?php re$this->form->getInput(创设_by_alias );?>

    83:#</div>

    85:<div category=“formelm”>

    86:<?php re$this->form->getLabel(添加image );?>

    87:<?php re$this->form->getInput( Addimage );?>

    88:</div>

    90:#<?php if (this->item->params->get(access-change ): ?>

com_content is really not the way for creating variable content in joomla anymore. It s still the same unflexible code since mambo days. You should try solutions like K2, flexicontent or my favourite ZOO. They are easy to learn and you can do lots of cool stuff with them. Extra Fields? No Proble., Some of them already exist for Joomla 1.7/2.5. Hacking the core is always bad. Mainly because you loose your update path.





相关问题
cross platform issues in webpages

I am developing some basic html pages, i am setting colors of text usimg color code #e7eddf it seems fine in windows but seems different in mac. Can you explain me why its happening and also ...

How to create breadcumb for custom component in Joomla?

I have a custom component in which I want to have a breadcumb to help the user navigate the previous page visits. The basic feature in my component is to show our product releases. The workflow is: ...

Preloading images

i ve a navigation bar like the one below..for each it changes the background color on mouseover and mouseout and there is a lag to load those images which looks awful :( i wanna know how to preload ...

Joomla conditional menu item

I d like to create a menu item in Joomla that points to one article when the user is logged out, and a different article when the user is logged in. I tried creating two menu items, and make them ...

unable to connect to database on AWS

actually I have my website build with Joomla hosted on hostmonster but all Joomla website need a database support to run this database is on AWS configuration files need to be updated for that I ...

How can you test if you re on the homepage in Joomla?

I m working on a Joomla site, and I need the front page to look slightly different from the rest of the pages, but not enough to warrant the use of two themes (it s a pain to have to update two ...

How to get the current Joomla username?

I m trying to get the current Joomla username. I was able to get it by using $user =& JFactory::getUser(); echo $user->username; But now I ve installed Joomla on my local server and it doesn ...

热门标签