زمان کنونی: ۳۱-۱-۱۴۰۳, ۰۷:۱۹ عصر درود مهمان گرامی! (ورودثبت نام)


ارسال پاسخ 
 
امتیاز موضوع:
  • 0 رأی - میانگین امتیازات: 0
  • 1
  • 2
  • 3
  • 4
  • 5
آموزش افزودن فیلد جدید به مطالب جوملا
۲-۶-۱۳۹۱, ۰۲:۵۰ صبح
ارسال: #1
آموزش افزودن فیلد جدید به مطالب جوملا
نیاز هر کاربری هست که بتونه به بخش مطالب سایت یک فیلد جدید اضافه کنه

مخصوصا در سایت های خبری که نیاز شدید به یک فیلد تیتر و یک فیلد سرتیتر است!

کلی جستجو کردم در این مورد تنها یک آموزش انگلیسی پیدا کردم!

تا مراحل پایانی تونستم پیش برم اما آخرای کار رو متوجه نشدم

آموزش رو اینجا قرار میدم دوستان هرکس تونست بدون مترجم گوگل کامل و صحیح این رو توضیح بده تا بقیه دوستان هم استفاده کنند

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 http://localhost/phpmyadmin/index.php
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! 



منبع به سفارش دوست عزیز saso:
دیدن لینک ها برای شما امکان پذیر نیست. لطفا ثبت نام کنید یا وارد حساب خود شوید تا بتوانید لینک ها را ببینید.
امضاء سعید حمزه زاده
طراحی انواع وب سایت شرکتی، شخصی، پورتال خبری، فروشگاهی، انجمن های گفتگو، طراحی انواع صفحات اینترو، طراحی و پیاده سازی انواع نرم افزارهای مدیریت، حسابداری و حسابرسی بر پایه RFID و بارکد
طراحی و بهینه سازی وبسایت با قیمت استثنایی!
گروه نرم افزاری رادین : دیدن لینک ها برای شما امکان پذیر نیست. لطفا ثبت نام کنید یا وارد حساب خود شوید تا بتوانید لینک ها را ببینید.
مشاهده‌ی وب‌سایت کاربر یافتن تمامی ارسال‌های این کاربر
نقل قول این ارسال در یک پاسخ بازگشت به بالا
 سپاس شده توسط محمدرضا بهارلو
۲-۶-۱۳۹۱, ۰۶:۳۹ عصر
ارسال: #2
RE: آموزش افزودن فیلد جدید به مطالب جوملا
من قبلاً امتحان کردم ولی به نتیجه نرسیدم ولی دوباره اگه وقت بشه انجامش می دم
امضاء saso
من از سایت پارس جوم بیش از اندازه رضایت دارم تشکر از همگی بچه های انجمن پارس جوم
دیدن لینک ها برای شما امکان پذیر نیست. لطفا ثبت نام کنید یا وارد حساب خود شوید تا بتوانید لینک ها را ببینید.
مشاهده‌ی وب‌سایت کاربر یافتن تمامی ارسال‌های این کاربر
نقل قول این ارسال در یک پاسخ بازگشت به بالا
۲-۶-۱۳۹۱, ۰۷:۳۴ عصر
ارسال: #3
RE: آموزش افزودن فیلد جدید به مطالب جوملا
بنده انجام دادم، در فرم های ادمین فیلد اضافه میشه اما در ذخیره به مشکل بر میخوردم!

باید یک آموزش فارسی جامع برای این کار ایجاد بشه چون درخواست خیلی از کاربران بوده و در هیچ انجمنی آموزشی وجود نداره

Macho
امضاء سعید حمزه زاده
طراحی انواع وب سایت شرکتی، شخصی، پورتال خبری، فروشگاهی، انجمن های گفتگو، طراحی انواع صفحات اینترو، طراحی و پیاده سازی انواع نرم افزارهای مدیریت، حسابداری و حسابرسی بر پایه RFID و بارکد
طراحی و بهینه سازی وبسایت با قیمت استثنایی!
گروه نرم افزاری رادین : دیدن لینک ها برای شما امکان پذیر نیست. لطفا ثبت نام کنید یا وارد حساب خود شوید تا بتوانید لینک ها را ببینید.
مشاهده‌ی وب‌سایت کاربر یافتن تمامی ارسال‌های این کاربر
نقل قول این ارسال در یک پاسخ بازگشت به بالا
ارسال پاسخ 


پرش به انجمن:


کاربرانِ درحال بازدید از این موضوع: 1 مهمان