SOLVED Article type-a new field created and its type was given as Topic but cant display on template
  • I need help guys! on admin site I created a new field under the 'news' article type. the new field's type was chosen as Topic. On article edit page I can see the new field with the subtopics in the drop down box. how ever, on template, under the article_list I called the new field with this line $gimme->article->newfield  but it cant be displayed. Whats wrong? any help appreciated.

    here is the Articlemetadatatype table line ..
    type_name Ascending 

    field_name

    field_weight Ascending 2

    is_hidden

    comments_enabled

    fk_phrase_id

    field_type

    field_type_param

    is_content_field

    max_size

    affiliate300NULLtopicNULL0NULL
    news

    Post edited by akedemik calisma at 2014-07-14 16:13:55
  • 1 Comment sorted by
  • ok . I found the solution myself. for those having same issue, I am giving the details... actually it s a bug in MetaArticle.php under template_engine folder.

    the file location to be edited is template_engine/metaclasses/MetaArticle.php

    line is around 255... the old lines as follows:
    if ($articleFieldType->getType() == ArticleTypeField::TYPE_TOPIC) {
                        $fieldValue = new MetaTopic($fieldValue);
                    }

    you have to chnage these lines as follows:

                    if ($articleFieldType->getType() == ArticleTypeField::TYPE_TOPIC) {
                        $fieldValue = TopicName::GetTopicNames($fieldValue); //new MetaTopic($fieldValue);
                        $fieldValue = $fieldValue[$this->m_dbObject->getProperty('IdLanguage')];
                    }


    and that is all...