aminweb

افزودن فیلد به مطالب(کمک)

9 پست در این موضوع

با سلام خدمت اساتید و بزرگواران عزیز

بنده بعد از گشت و گزار فراوان بین افزونه ها متاسفانه نتونستم افزونه مناسب خبری پیدا کنم لذا قصد انجام تغییر در کامپوننت مطالب جوملا را دارم

و فقط یه آموزش به زبان انگلیسی پیدا کردم

میخواستم از اساتید به ویژه مهندس طالب عزیز درخواست کنم که یه نگاهی به این آموزش بندازن و راهنمایی کنن تا بتونم این کارو انجام بدم و یا اینکه اگر پیشنهاد خاصی در این زمینه دارید ممنون میشم بفرمایید.

با تشکر فراوان

To add custom article submission field:

Files needed to edit:

i. jos_content table in joomla database

ii. root/components/com_content/views/article/tmpl/default.php

iii. root/components/com_content/views/article/tmpl/form.php

iv. root/administrator/components/com_content/models/article.xml

v. root/administrator/components/admin.content.html.php

vi. root/administrator/components/config.xml

vii. root/libraries/joomla/database/table/content.php

1. jos_content table update

1.1. Open up phpMyAdmin or your respective mysql database editor

1.1.i. If you’re working on your local server

1.1.i.a. Copy this link in you’re browser window 404 Not Found

1.1.i.b. If you have a lamp set up with xampp open the control panel a

click on admin on the apache row and click on phpMyAdmin

1.2. Choose the respective database for the needed Joomla installation

1.3. Open the jos_content table

1.4. Click on structure

1.5. Scroll add form and add rows with the name of the custom fields

you will be adding

2. default.php

2.1. Open “root/components/com_content/views/article/tmpl/default.php”

2.2. Scroll to line 25 and insert the following code replace

“custom_field” with the name of its corresponding row in the

jos_content table:

<?php echo $this->escape($this->article-> custom_field); ?>

2.3. If you will be adding parameters to the field (i.e.: show

custom_field, link custom_field, etc..) use the following code:

<?php if ($this->params->get(‘show_ custom_field ‘)) : ?>

<sub width=”100%”>

<?php if ($this->params->get(‘link_ custom_field ‘) && $this-

>article->readmore_link != ”) : ?>

<a href=”<?php echo $this->article->readmore_link; ?>”

>

<?php echo $this->escape($this->article-> custom_field); ?></a>

<?php else : ?>

<?php echo $this->escape($this->article-> custom_field); ?>

<?php endif; ?>

</sub>

<?php endif; ?>

3. form.php

3.1. Let’s add our field to the front end submission form!

3.2. Open root/components/com_content/views/article/tmpl/form.php

3.3. Scroll to line 79

3.4. Insert <label> and <input> fields

3.4.i. Label Code:

<label for=”title”>

<?php echo JText::_( ‘custom_field ‘ ); ?>:

</label>

3.4.i.a. Replace “custom_field” with the text you would like to appear

on the submission form screen.

3.4.i.b. This code renders the label text next to the field box

3.4.ii. Input Code

<input type=”text” id=” custom_field ” name=”

custom_field ” size=”50″ maxlength=”100″ value=”<?php echo $this-

>escape($this->article-> custom_field); ?>” />

3.4.ii.a. Replace “custom_field” with the name of its corresponding

row in the “jos_content” table

3.4.ii.b. This code will render the text field for user entry

4. article.xml

4.1. Follow these intructions if you’d like to add parameters to

control the visibility and/or linkability of your field. And you can

disseminate these instructions to add more parameters.

4.2. Open root/administrator/components/com_content/models/article.xml

4.3. Scroll to line 27

4.4. To add a parameter to choose whether or not your field will be

visible on the front page add this code:

<param name=”show_ custom_field ” type=”list” default=”" label=”Show

custom_field ” description=”Show/Hide the articles subtitle”>

<option value=”">Use Global</option>

<option value=”0″>No</option>

<option value=”1″>Yes</option>

</param>

4.4.i. Replace “custom_field” with the name its corresponding row in

the jos_content table

4.4.ii. The “name” field must match the variable used in the

default.php to evaluate whether or not this parameter is set.

To add a parameter to make the field linkable to the current article

insert the following code:

<param name=”link_ custom_field” type=”list” default=”" label=”Linked

custom_field ” description=”TIPIFYESTITLECONTENTITEMS”>

<option value=”">Use Global</option>

<option value=”0″>No</option>

<option value=”1″>Yes</option>

</param>

4.4.iii. Replace “custom_field” with the name its corresponding row in

the jos_content table

4.4.iv. The “name” field must match the variable used in the

default.php to evaluate whether or not this parameter is set.

4.5. Both above codes render in the article editing view in the

administrator Backend

5. admin.content.html.php

5.1. Open root/administrator/components/admin.content.html.php

5.2. Scroll to line 797 (Just after the <tr> that contains <?php echo

$lists[‘state’]; ?>

5.3. Insert the following code:

<tr>

<td>

<label for=” custom_field “>

<?php echo JText::_( ‘ custom_field ‘ ); ?>

</label>

</td>

<td>

<input type=”text” name=” custom_field ” id=”

custom_field ” size=”40″ maxlength=”255″ value=”<?php echo $row->

custom_field; ?>” />

</td>

</tr>

5.3.i. Replace “custom_field” with the label used for its

corresponding row in the jos_content table.

5.3.ii. This code will create a new row just below the “title” field

on the article submission form in the administrator backend.

6. config.xml

6.1. The following will add parameters to the article manager page

parameter list

6.2. Open “root/administrator/components/config.xml”

6.3. Scroll to line 16 and insert:

<param name=”show_subtitle” type=”radio” default=”1″ label=”Show

Article SubTitle” description=”Show/Hide the articles subtitle”>

<option value=”0″>No</option>

<option value=”1″>Yes</option>

</param>

<param name=”link_subtitles” type=”radio” default=”1″ label=”Linked

SubTitles” description=”TIPIFYESTITLECONTENTITEMS”>

<option value=”0″>No</option>

<option value=”1″>Yes</option>

</param>

6.3.i. The top <param> is the parameter defining whether the field

will be visible on the front end

6.3.ii. The bottom <param> defines whether the field is a link

6.3.iii. Compare with previous xml edit.

7. Content.php

7.1. Open “root/libraries/joomla/database/table/content.php”

7.2. Scroll to line 33

7.3. Insert:

var $subtitle = null;

/** @var string */

8. Extra notes

8.1. Steps 1,2,3, and 5 must be completed for a field to appear in the

submission forms(both front and back), and render on the front end.

8.2. Steps 4 and 6 are parameter creations that add extra control over

the fields.

8.3. To add the custom fields to the Section and Category view add:

<?php echo $this->escape($this->this-> custom_field); ?>

to the proper location and follow the page convention.

8.3.i. Insert in section/tmpl/blog_item.php line 25

8.3.ii. Add to section query compnents/com_content/models/section.php

line 414

8.3.iii. “a.subtitle”

8.3.iv. Add module query models/category/php line 361

8.3.v. “a.subtitle”

8.4. The parameters for section and category blog and list view can be

inserted in the same manner as the article parameters above. Find the

proper xml file and add parameters for the custom field!

Original article by Dan “Diggler” Proczko from http://groups.google.com/group/joomlagrandrapids/browse_thread/thread/10d2610576fadab5?pli=1

Share this post


Link to post
Share on other sites
آموزش ووکامرس قالب جوملا قالب وردپرس قالب رایگان وردپرس قالب رایگان جوملا هاست نامحدود هاست جوملا هاست لاراول هاست وردپرس هاست ارزان هاست ربات تلگرام خرید دامنه آموزش ساخت ربات تلگرام با php آموزش html و css آموزش لاراول آموزش cPanel آموزش php آموزش سئو وردپرس آموزش امنیت وردپرس آموزش وردپرس آموزش فرم ساز RSform آموزش سئو جوملا آموزش فروشگاه ساز Hikashop آموزش فروشگاه ساز ویرچومارت آموزش طراحی سایت آگهی تبلیغاتی آموزش امنیت جوملا آموزش طراحی سایت فروش فایل آموزش طراحی قالب ریسپانسیو با Helix آموزش جوملا 3 آموزش ساخت ربات دکمه ی شیشه ای آموزش ساخت ربات همکاری در فروش آموزش ساخت ربات جذب ممبر آموزش ساخت ربات ضد اسپم آموزش ساخت ربات پیوست فایل سورس ربات مدیر گروه | ربات مدیر گروه همسریابی
دوست عزيز با كامپوننت k2 كه ميتوني براي مطالبت فيلد بسازي!!!

با تشکر از پاسختون

اما کی 2 مشکلات عدیدی داره ... بهترین گزینه خود کامپوننت مطالب جوملاست

در صورت عدم توانایی در این زمینه به کای 2 فک میکنیم

اما ممنون میشم دوست عزیز که شما آموزش فیلد سازی در کای 2 رو براهنمایی کنید و بعنوان مثال چطور میتوان در کای 2 روتیتر تعریف کرد؟

با تشکر

منتظر نظرات دیگر دوستان هستم

Share this post


Link to post
Share on other sites
چرا از ایدا نیوز یا گلوبال نیوز استفاده نمیکنی ؟

چطور میشه در آیدا نیوز و گلوبال نیوز ار روتیتر استفاده کرد؟

Share this post


Link to post
Share on other sites
چطور میشه در آیدا نیوز و گلوبال نیوز ار روتیتر استفاده کرد؟

این افزونه ها این امکانات را نداره. ماژول خبری p30 این امکان را داره.

Share this post


Link to post
Share on other sites
این افزونه ها این امکانات را نداره. ماژول خبری p30 این امکان را داره.

اونم محدودیت های خیلی زیادی داره

تازه ساختار مطلب رو تغییر نمیده که

Share this post


Link to post
Share on other sites

میخواین چه فیلدهایی به کامپوننت مطلب جوملا اضافه کنید؟ روتیتر، سوتیتر و ....؟ دقیق تر بگید لطفا

Share this post


Link to post
Share on other sites
میخواین چه فیلدهایی به کامپوننت مطلب جوملا اضافه کنید؟ روتیتر، سوتیتر و ....؟ دقیق تر بگید لطفا

بله

برای ساختار مطالب در جوملا قصد ایجاد روتیتر دارم

فقط همین

Share this post


Link to post
Share on other sites

برای ارسال نظر یک حساب کاربری ایجاد کنید یا وارد حساب خود شوید

برای اینکه بتوانید نظر ارسال کنید نیاز دارید که کاربر سایت شوید

ایجاد یک حساب کاربری

برای حساب کاربری جدید در انجمن ما ثبت نام کنید. عضویت خیلی ساده است !


ثبت نام یک حساب کاربری جدید

ورود به حساب کاربری

دارای حساب کاربری هستید؟ از اینجا وارد شوید


ورود به حساب کاربری