Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • austenn01 Friend
    #731383

    Hello,

    I have an issue with JoomlArt CCK extra fields in the Medicare template.

    When I have added new Fields in the xml file that already exists as the Medicare template uses Extra Fields, I add my fileds, and they show in the BACKEND Article edit extra fields TAB. I can add text to the fields and save it.

    The issue, is that any NEW fields I add, they do not show on the Frontend view after i have added the required code.

    As a test scenario, I did the following:

    1) In the xml file, I renamed the First Extra Filed from:

    <field name="jdepartment_name"
    type="text"
    default=""
    label="TPL_EX_DEPARTMENT"
    description="TPL_EX_DEPARTMENT_DESC" />

    TO:

    <field name="doctor_education"
    type="text"
    default=""
    label="TPL_EX_DEPARTMENT"
    description="TPL_EX_DEPARTMENT_DESC" />

    Then, in the folder templates/ja_medicare/html/mod_jacontentslider , i changed the default.php on line 545 from:

    <?php

    //Check extrafields

    if($extrafields['jdepartment_name']): ?>

    <span class="department small"> - <?php echo $extrafields['jdepartment_name'];?></span>

    <?php

    endif;

    ?>

    TO:

    <?php

    //Check extrafields

    if($extrafields['doctor_education']): ?>

    <span class="department small"> - <?php echo $extrafields['doctor_education'];?></span>

    <?php

    endif;

    ?>

    When i do the above (for the Extra Fields that came packaged with the Medicare template, the Extra Filed doesnt show anymore on the frontend.

    Can anyone suggest why this is the case, as there should be no reason why this doesnt work. I have used Extra Fields before with no issue, but this is driving me nuts.

    P.S. For the JoomlArt support staff, all my files should be back to standard settings, except I have my new extra fields added to the .xml file

    Pankaj Sharma Moderator
    #751099

    Hi
    Here is documentation to add Extra Fields in Articles .

    I also tried to check your site customization but the admin details you submitted for JA staff is not working .
    Kindly check it .

    austenn01 Friend
    #751133

    <em>@pankajsharma 496453 wrote:</em><blockquote>Hi
    Here is documentation to add Extra Fields in Articles .

    I also tried to check your site customization but the admin details you submitted for JA staff is not working .
    Kindly check it .</blockquote>

    Hello,

    The logins are working.

    Yes I have already used that link…as per my original post, i have setup and used extra fields before.

    There is one difference with the way it seems JoomlArt is using Extra Fields in this Medicare template, which makes me wonder if there are other files I need to edit…but, there is this file in the template root folder

    ja_medicare/templateHelper.php

    In this php file, it references thee extra fields that come with JA Medicare. I did add my new field names to this file, and it still doesn’t work…so i got no clue what going on..

    class MedicareHelper {

    public static function loadParamsContents($item, $pdata = 'attribs'){
    $data = $item->$pdata;
    if(is_string($pdata)){
    $data = new JRegistry;
    $data->loadString($item->$pdata);
    }

    if($data instanceof JRegistry){
    return array(
    'jdepartment_name' => $data->get('jdepartment_name', ''),
    'facebook_link'=>$data->get('facebook_link', ''),
    'flickr_link'=>$data->get('flickr_link', ''),
    'google_plus_link'=>$data->get('google_plus_link', ''),
    'twitter_link'=>$data->get('twitter_link', ''),
    'jdoctor_education' => $data->get('jdoctor_education', '')
    );
    }

    return array(
    'jdepartment_name' => '',
    'facebook_link'=> '',
    'flickr_link'=>'',
    'google_plus_link'=>'',
    'twitter_link'=>'',
    'jdoctor_education' => ''
    );
    }

    but what annoys me, is the tutorial you linked to above, it says nothing about needing to edit the templateHelper.php file…so why is it being used? And why is it referencing the extra fields that come with JA Medicare template? Are there are files other than whats mentioned in the tutorial link above that have to be edited now?

    austenn01 Friend
    #751139

    I was testing this in a copy of my dev site, and it wasn’t working (as per my original and subsequent posts)…but i just tried it in my real dev site and it is working.

    The ISSUE is what i said in my last post, for some reason the JA Medicare template requires you to add your new extra fields to this file:

    ja_medicare/templateHelper.php

    If we dont add them to this file, they they dont work!!!!

    So WHY JOOMLART, is the templageHelper.php file not mentioned in your tutorial??? This one thing has driven me crazy and wasted so much of my time!

    By the way, some of the info on how to create Extra Fields is slightly different between your Blog Post:

    http://www.joomlart.com/tutorials/joomla-tutorials/adding-joomla-custom-fields-in-article-with-t3-framework

    And you tutorials in the T3 Framework site:

    http://www.t3-framework.org/documentation/extend-com-content.html#add-extra-fields

    But, NEITHER of these 2 tutorial sources mentions the templateHelper.php file!

    It would be great if this all could get cleared up and fixed so as to make your solution more approachable.

    Pankaj Sharma Moderator
    #751289

    Hi
    In JA Medicare template to add extra fields
    First you need to add the extrafiled in xml file : templatesja_medicareetcextrafieldsdoctors.xml
    here : http://prntscr.com/8qaxz5
    Then Go to templatesja_medicarehtmlcom_contentarticledefault.php
    and define new extra fields value here Line 103 : http://prntscr.com/8qayej
    and here Line 106 : http://prntscr.com/8qayhw
    The at last you need to define it in TemlateHelper file here : http://prntscr.com/8qays6
    Now u can see new Extra field in the Article options and u can add your value .

    PS : For template Helper issue i will check it and forward to concern team .

    austenn01 Friend
    #751450

    <em>@pankajsharma 496882 wrote:</em><blockquote>Hi
    In JA Medicare template to add extra fields
    First you need to add the extrafiled in xml file : templatesja_medicareetcextrafieldsdoctors.xml
    here : http://prntscr.com/8qaxz5
    Then Go to templatesja_medicarehtmlcom_contentarticledefault.php
    and define new extra fields value here Line 103 : http://prntscr.com/8qayej
    and here Line 106 : http://prntscr.com/8qayhw
    The at last you need to define it in TemlateHelper file here : http://prntscr.com/8qays6
    Now u can see new Extra field in the Article options and u can add your value .

    PS : For template Helper issue i will check it and forward to concern team .</blockquote>

    Yes, as i said I have it working and have used Extra Fields many times before.

    The ISSUE, as stated, is the Medicare template uses the templateHelper.php file, but none of the tutorials use this…BUT, the templateHelper.php file is NOT needed in more recent versions of T3 framework.

    I have gone back and looked at many of the JoomlArt templates since you guys started using your Extra Fields, and many of these templates use different methods than what you have in your tutorial…and if we only do what the tutorial says, then we would never be able to add new extra fields to your older templates.

    Then there is of course your ‘Content type Plugin’…which adds yet another different way to add extra fields.

    Just a little consistency would be very nice…or at least update your older templates to adhere to how your tutorials tell us to use Extra Fields??

    Pankaj Sharma Moderator
    #751454

    Hi
    thanks for the valuable feedback , i will forward it to concern team for review on it and documentation for extra fields .

Viewing 7 posts - 1 through 7 (of 7 total)

This topic contains 7 replies, has 2 voices, and was last updated by  Pankaj Sharma 8 years, 6 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum