Ergebnis 1 bis 28 von 28

Thema: Mehrsprachigkeit und eine variable regionale Sprache?

  1. #1
    Contao-Fan
    Registriert seit
    03.09.2013.
    Beiträge
    493

    Standard Mehrsprachigkeit und eine variable regionale Sprache?

    Hi,

    ich habe drei Seitenbaume, .de .com und .fr, das sind die Grundsprachen. Augeben lasse ich das im template so:

    PHP-Code:
    <?php
                            
    switch($GLOBALS['TL_LANGUAGE'])
                            {
                                case 
    'de':
                                    echo 
    $entry->field('beschreibung')->html();
                                    break;
                                case 
    'en':
                                    echo 
    $entry->field('beschreibung_englisch')->html();
                                    break;
                                case 
    'fr':
                                    echo 
    $entry->field('beschreibung_franzoesisch')->html();
                                    break;
                                default:
                                    echo 
    $entry->field('beschreibung_englisch')->html();
                                    break;
                            }
                            
    ?>
    Mein problem ist jetzt, es gibt noch eine Textarea "Regional" für z.b. für spanisch, schwedisch und so. Wie kann ich, wenn jmd mit einem schwedischen browser kommt, wenn vorhanden, die schwedische Beschreibung anzigen lassen, ansonsten wie gehabt englisch?

    LG & Danke

  2. #2
    Contao-Fan
    Registriert seit
    03.09.2013.
    Beiträge
    493

    Standard

    Ok dann anders, wie kann ich denn mit Contao die browsersprache ermitteln?

  3. #3
    Administratorin Avatar von lucina
    Registriert seit
    19.06.2009.
    Ort
    Kiel (DE)
    Beiträge
    7.376
    Partner-ID
    152
    User beschenken
    Wunschliste
    Contao-Projekt unterstützen

    Support Contao

    Standard

    Mal aus Interesse gefragt: Warum nutzt Du nicht das{{iflng}}-Inserttag?

  4. #4
    Community-Moderator
    Wandelndes Contao-Lexikon
    Avatar von Spooky
    Registriert seit
    12.04.2012.
    Ort
    Scotland
    Beiträge
    35.517
    Partner-ID
    10107

    Standard

    So wird von Contao die Sprache des Browsers ermittelt: https://github.com/contao/core/blob/...alize.php#L184
    PHP-Code:
    \Environment::get('httpAcceptLanguage'); 
    liefert dir ein Array mit allen Sprachen, die der Browser definiert hat (gereiht nach Priorität). Der String kann aber in der form 'de' oder 'de_DE' sein (evt. auch 'de-DE'). Wahrscheinlich interessieren dich aber eh nur die ersten zwei Buchstaben, also bspw.
    PHP-Code:
    $lang strtolowersubstr$lang0) ); 
    Geändert von Spooky (14.07.2015 um 09:44 Uhr)

  5. #5
    Contao-Fan
    Registriert seit
    03.09.2013.
    Beiträge
    493

    Standard

    Ich hätte dann eine abfrage geschrieben, wenn regional Sprache vorhanden in Contao + die selbe wie im Browser, ansonsten dann englisch, funktioniert das damit?

  6. #6
    Community-Moderator
    Wandelndes Contao-Lexikon
    Avatar von Spooky
    Registriert seit
    12.04.2012.
    Ort
    Scotland
    Beiträge
    35.517
    Partner-ID
    10107

    Standard

    Zitat Zitat von Steve_0 Beitrag anzeigen
    Ich hätte dann eine abfrage geschrieben, wenn regional Sprache vorhanden in Contao + die selbe wie im Browser, ansonsten dann englisch, funktioniert das damit?
    Ich weiß nicht genau was dein Vorhaben ist...

    Du hast einen Seitenbaum, in Englisch, möchtest aber an manchen Stellen übersetzte Texte anzeigen, abhängig von der Browser Sprache?

  7. #7
    Contao-Fan
    Registriert seit
    03.09.2013.
    Beiträge
    493

    Standard

    Also ich habe eine Erweiterung CustomCatalog, dort habe ich drei Sprachen hinterlegt, dies ist vorallem wichtig bei den Beschreibungen der Partner. Jetzt gibt es aber auch Partner die noch zusätzlich für landsleute, die Beschreibung in der regionalen Sprache anzeigen lassen möchten, anstatt nur in englisch.

  8. #8
    Administratorin Avatar von lucina
    Registriert seit
    19.06.2009.
    Ort
    Kiel (DE)
    Beiträge
    7.376
    Partner-ID
    152
    User beschenken
    Wunschliste
    Contao-Projekt unterstützen

    Support Contao

    Standard

    Das soltest Du dann wohl den Verkäufer des CustomCatalogs fragen wie das sinnvollerweise am besten zu lösen ist.

    Closed Source, dass können wir hier sicher nicht vollständig supporten.

  9. #9
    Community-Moderator
    Wandelndes Contao-Lexikon
    Avatar von Spooky
    Registriert seit
    12.04.2012.
    Ort
    Scotland
    Beiträge
    35.517
    Partner-ID
    10107

    Standard

    Verstehe, ich schätze mal du hast dann zwei zusätzliche Felder, ein Feld für den language code der Beschreibung für die "Landsleute" und einmal eben die Beschreibung in dieser Sprache, richtig? Dann würde ich das ungefähr so machen:
    PHP-Code:
    // get the http accept languages
    $langs = \Environment::get('httpAcceptLanguage');

    // convert 'de-DE' & 'de_DE' to 'de'
    $langs array_map( function( $lang ) { return $lang strtolowersubstr$lang0) ); }, $langs ); 

    // check if custom language exists
    if( in_array$entry->field('beschreibung_custom_lang'), $langs ) )
    {
        echo 
    $entry->field('beschreibung_custom')->html();
    }
    // otherwise show default languages
    else
    {
        switch(
    $GLOBALS['TL_LANGUAGE'])
        {
            case 
    'de':
                echo 
    $entry->field('beschreibung')->html();
                break;
            case 
    'fr':
                echo 
    $entry->field('beschreibung_franzoesisch')->html();
                break;
            case 
    'en':
            default:
                echo 
    $entry->field('beschreibung_englisch')->html();
        } 

    Geändert von Spooky (14.07.2015 um 11:59 Uhr)

  10. #10
    Contao-Fan
    Registriert seit
    03.09.2013.
    Beiträge
    493

    Standard

    Super danke, nur kurz für mich zum besseren verständnis:

    PHP-Code:
    if( in_array$entry->field('beschreibung_custom_lang'), $langs ) ) 
    Hier wird nachgeschaut ob der angegebene regionale Ländercode der selbe ist wie in $lang, wenn ja, dann wird die regionale Beschreibung ausgegeben?

  11. #11
    Community-Moderator
    Wandelndes Contao-Lexikon
    Avatar von Spooky
    Registriert seit
    12.04.2012.
    Ort
    Scotland
    Beiträge
    35.517
    Partner-ID
    10107

    Standard

    Ja, bzw. genauer gesagt, es wird überprüft, ob der angegebene Regionalcode in den vom Browser definierten Sprachen vorhanden ist, wenn nicht, wird wie üblich Deutsch, Englisch oder Französisch ausgegeben.

  12. #12
    Contao-Fan
    Registriert seit
    03.09.2013.
    Beiträge
    493

    Standard

    Momentan bekomme ich noch keine Ausgabe, das ist mein code:
    PHP-Code:
    // get the http accept languages
                            
    $langs = \Environment::get('httpAcceptLanguage');

                            
    // convert 'de-DE' & 'de_DE' to 'de'
                            
    $langs array_map( function( $lang ) { return $lang strtolowersubstr$lang0) ); }, $langs );

                            
    // check if custom language exists
                            
    if( in_array$entry->field('regionale_sprache'), $langs ) )
                            {
                                echo 
    $entry->field('beschreibung_regional')->html();
                            }
                            
    // otherwise show default languages
                            
    else
                            {
                                switch(
    $GLOBALS['TL_LANGUAGE'])
                                    {
                                        case 
    'de':
                                            echo 
    $entry->field('beschreibung')->html();
                                            break;
                                        case 
    'en':
                                            echo 
    $entry->field('beschreibung_englisch')->html();
                                            break;
                                        case 
    'fr':
                                            echo 
    $entry->field('beschreibung_franzoesisch')->html();
                                            break;
                                        default:
                                            echo 
    $entry->field('beschreibung_englisch')->html();
                                            break;
                                    }
                            }
                            echo 
    $entry->field('regionale_sprache')->html(); 
    $entry->field('regionale_sprache')->html(); gibt z.b. "cn" aus, was ja laut dieser Liste:
    https://de.wikipedia.org/wiki/ISO-3166-1-Kodierliste
    China sein muss aber ich bekomme keinen Chinesischen Text.

  13. #13
    Community-Moderator
    Wandelndes Contao-Lexikon
    Avatar von Spooky
    Registriert seit
    12.04.2012.
    Ort
    Scotland
    Beiträge
    35.517
    Partner-ID
    10107

    Standard

    Das heißt, du hast die primäre Sprache deines Browsers auf Chinesisch gestellt, siehst aber trotzdem nur Englisch?

  14. #14
    Contao-Fan
    Registriert seit
    03.09.2013.
    Beiträge
    493

    Standard

    Genau, mein Opera ist auf Chinesisch gestellt:
    16-07-_2015_10-49-09.jpg

  15. #15
    Community-Moderator
    Wandelndes Contao-Lexikon
    Avatar von Spooky
    Registriert seit
    12.04.2012.
    Ort
    Scotland
    Beiträge
    35.517
    Partner-ID
    10107

    Standard

    Naja, mach halt direkt vor dem
    PHP-Code:
    if( in_array$entry->field('regionale_sprache'), $langs ) ) 
    eine Debug Ausgabe mit
    PHP-Code:
    var_dump$langs );
    var_dump$entry->field('regionale_sprache') ); 
    Dann siehst du ja, warum die Bedingung nicht true wird.

  16. #16
    Contao-Fan
    Registriert seit
    03.09.2013.
    Beiträge
    493

    Standard

    Da bekomme ich alles ausgegeben, da wird auch die reginale sprache augegeben:

    Code:
    ["beschreibung_regional"]=> string(1380) "
    易商互动软件技术咨询有限公司成立于2008年5月,致力于电子商务的技术开发和营销钻研,为客户提供系统开发、离岸研发中心、市场营销咨询等服务,以金 融保险电商和多渠道电子商务解决方案见长,业务触及核心系统开发、策划与运营以及整合营销事。
    Woran sehe ich jetzt was falsch ist?

  17. #17
    Community-Moderator
    Wandelndes Contao-Lexikon
    Avatar von Spooky
    Registriert seit
    12.04.2012.
    Ort
    Scotland
    Beiträge
    35.517
    Partner-ID
    10107

    Standard

    Das was du gepostet hast ist aber nicht die Ausgabe von dem was ich gepostet habe. Poste die Ausgabe von
    PHP-Code:
    var_dump$langs );
    var_dump$entry->field('regionale_sprache') ); 
    dann siehst du (und wir) warum die Bedingung nicht true wird. Die Bedingung ist dann true, wenn sich innerhalb von $langs ein sprachkürzel befindet, dass dem Sprachkürzel in $entry->field('regionale_sprache') gleicht. Theoretisch jedenfalls.

    Zitat Zitat von Steve_0 Beitrag anzeigen
    Woran sehe ich jetzt was falsch ist?
    Mit grundsätzlichen Programmierkenntnissen?

  18. #18
    Contao-Fan
    Registriert seit
    03.09.2013.
    Beiträge
    493

    Standard

    Ok hier die Ausgabe:

    Code:
    array(4) { [0]=> string(2) "zh" [1]=> string(2) "zh" [2]=> string(2) "en" [3]=> string(2) "en" } object(PCT\CustomElements\Core\TemplateAttribute)#316 (6) { ["attribute"]=> object(PCT\CustomElements\Plugins\CustomCatalog\Core\Attribute)#315 (12) { ["arrData":protected]=> array(84) { ["id"]=> string(3) "118" ["pid"]=> string(2) "10" ["sorting"]=> string(4) "1288" ["tstamp"]=> string(10) "1437039868" ["uuid"]=> string(15) "8drcwvccphekjpf" ["alias"]=> string(17) "regionale_sprache" ["type"]=> string(8) "selectdb" ["title"]=> string(17) "Regionale Sprache" ["description"]=> string(0) "" ["template"]=> string(26) "customelement_attr_default" ["protected"]=> string(0) "" ["user_groups"]=> NULL ["cssID"]=> string(28) "a:2:{i:0;s:0:"";i:1;s:0:"";}" ["published"]=> string(1) "1" ["options"]=> NULL ["hidden"]=> string(0) "" ["defaultValue"]=> NULL ["eval_mandatory"]=> string(0) "" ["eval_rgxp"]=> string(0) "" ["eval_rowscols"]=> string(0) "" ["eval_multiple"]=> string(0) "" ["eval_size"]=> string(0) "" ["eval_rte"]=> string(0) "" ["eval_submitOnChange"]=> string(0) "" ["eval_allowHtml"]=> string(0) "" ["eval_files"]=> string(0) "" ["eval_filesOnly"]=> string(0) "" ["eval_extensions"]=> string(0) "" ["eval_path"]=> NULL ["eval_attributeType"]=> string(0) "" ["eval_includeBlankOption"]=> string(1) "1" ["eval_datepicker"]=> string(0) "" ["eval_pagepicker"]=> string(0) "" ["eval_tl_style"]=> string(0) "" ["eval_minlength"]=> string(1) "0" ["eval_maxlength"]=> string(1) "0" ["eval_tl_class_w50"]=> string(0) "" ["eval_tl_class_clr"]=> string(0) "" ["eval_tl_class_m12"]=> string(0) "" ["eval_tl_class_long"]=> string(0) "" ["be_visible"]=> string(0) "" ["isDownload"]=> string(0) "" ["sortBy"]=> string(0) "" ["tinyTpl"]=> string(0) "" ["isRadio"]=> string(0) "" ["size"]=> string(0) "" ["include_type"]=> string(0) "" ["include_item"]=> string(1) "0" ["date_format"]=> string(0) "" ["date_rgxp"]=> string(8) "datetime" ["min_value"]=> string(0) "" ["max_value"]=> string(0) "" ["number_format"]=> string(0) "" ["galleryTpl"]=> string(0) "" ["tag_roots"]=> NULL ["tag_custom"]=> string(0) "" ["tag_table"]=> string(0) "" ["tag_key"]=> string(2) "id" ["tag_value"]=> string(0) "" ["tag_sorting"]=> string(0) "" ["tag_where"]=> string(0) "" ["tag_translations"]=> string(0) "" ["aliasSource"]=> string(1) "0" ["selectdb_table"]=> string(10) "sprachcode" ["selectdb_key"]=> string(2) "id" ["selectdb_value"]=> string(4) "code" ["selectdb_sorting"]=> string(4) "name" ["selectdb_translations"]=> string(0) "" ["selectdb_where"]=> string(0) "" ["rateit_counter"]=> string(1) "0" ["allowNotelistVariants"]=> string(0) "" ["notelistVariants"]=> NULL ["isSelector"]=> string(0) "" ["subpalettes"]=> NULL ["be_filter"]=> string(0) "" ["be_search"]=> string(0) "" ["be_sorting"]=> string(0) "" ["ref_attribute"]=> string(1) "0" ["isToggler"]=> string(0) "" ["icon"]=> NULL ["icon_off"]=> NULL ["eval_unique"]=> string(0) "" ["addFontIcon"]=> string(0) "" ["fontIcon"]=> string(0) "" } ["objWidget":protected]=> NULL ["objOrigin":protected]=> NULL ["arrChildAttributes":protected]=> array(0) { } ["strFieldTemplate":protected]=> string(22) "be_field_customelement" ["varValue":protected]=> string(1) "4" ["arrModified":protected]=> array(1) { ["varValue"]=> bool(true) } ["arrOptionValues":protected]=> array(0) { } ["arrTranslations":protected]=> array(0) { } ["uuid"]=> string(17) "regionale_sprache" ["objActiveRecord"]=> object(Contao\Database\Mysqli\Result)#267 (6) { ["resResult":protected]=> object(mysqli_result)#266 (5) { ["current_field"]=> int(0) ["field_count"]=> int(20) ["lengths"]=> array(20) { [0]=> int(2) [1]=> int(1) [2]=> int(10) [3]=> int(1) [4]=> int(0) [5]=> int(23) [6]=> int(16) [7]=> int(0) [8]=> int(33) [9]=> int(16) [10]=> int(0) [11]=> int(32) [12]=> int(19) [13]=> int(20) [14]=> int(19) [15]=> int(1) [16]=> int(1113) [17]=> int(0) [18]=> int(1380) [19]=> int(1) } ["num_rows"]=> int(1) ["type"]=> int(0) } ["strQuery":protected]=> string(49) "SELECT * FROM partnerpool WHERE id='93' LIMIT 0,1" ["intIndex":"Contao\Database\Result":private]=> int(0) ["blnDone":"Contao\Database\Result":private]=> bool(false) ["blnModified":"Contao\Database\Result":private]=> bool(false) ["arrCache":protected]=> array(20) { ["id"]=> string(2) "93" ["pid"]=> string(1) "0" ["tstamp"]=> string(10) "1437040548" ["sorting"]=> string(1) "0" ["ptable"]=> string(0) "" ["name"]=> string(23) "eBiz Interactive Co Ltd" ["alias"]=> string(16) "ebiz-interactive" ["adresse"]=> string(0) "" ["webseite"]=> string(33) "http://www.ebiz-interactive.info/" ["logo"]=> string(16) "��bȿ���PV�^�" ["beschreibung"]=> string(0) "" ["partnertyp"]=> string(32) "a:2:{i:0;s:2:"84";i:1;s:2:"86";}" ["partner_status"]=> string(19) "a:1:{i:0;s:2:"92";}" ["land"]=> string(20) "a:1:{i:0;s:3:"172";}" ["geschaeftsgebiet"]=> string(19) "a:1:{i:0;s:2:"99";}" ["veroeffentlichen"]=> string(1) "1" ["beschreibung_englisch"]=> string(1113) "
    Ebiz-interactive Software Technology Consulting Limited Company was founded in May, 2008. We are dedicated to developing e-commerce technology and its marketing strategy, providing services such as system development, offshore development, and marketing consulting. With financial insurance e-commerce and multi-channel e-commerce solutions being our advantages, eBiz-interactive has established long-term and stable cooperation with dozens of enterprises home and abroad since its foundation; the industries involved are IT, financial insurance, public relations and exhibitions, transportation and tourism, sports, education, mining, food, media, lottery, etc. Our work in core business system, cyber marketing, e-commerce, online entertainment, enterprise management and other application areas has been widely recognized by the clients. We commit to delivering value beyond expectations to the clients with reasonable charges, and provide the newest and best products and services with principles of honesty, reciprocity and credibility, which make eBiz-interactive the most reliable long-term partner.
    
    " ["beschreibung_franzoesisch"]=> string(0) "" ["beschreibung_regional"]=> string(1380) "
    易商互动软件技术咨询有限公司成立于2008年5月,致力于电子商务的技术开发和营销钻研,为客户提供系统开发、离岸研发中心、市场营销咨询等服务,以金 融保险电商和多渠道电子商务解决方案见长,业务触及核心系统开发、策划与运营以及整合营销事业,向企业提供一站式全套服务。自公司成立以来,已经与国内外 数十家客户建立了长期稳定的合作关系,所涉及的行业包括信息技术、金融保险、公关会展、交通旅游、体育竞技、教育、矿业、食品、媒体、博彩等,在核心业务 系统、网络营销、电子商务、在线娱乐、企业管理等应用领域颇具建树。在日新月异的市场环境下,我们寻求新业务拓展的步伐从未停歇。在不断深化自身多渠道电 商、金融电商自身优势的同时,也根据客户的迫切需求开展了整体运营策划和广告营销推广的相关工作。本着前瞻性的工作原则,易商互动已经在未来的市场前景中 占据了更加具有竞争力的战略阵地,我们始终承诺以合理的价格,向客户交付超越期待的价值,以坦诚、互利、守信的工作原则将最新、最好、最优的产品和服务奉 献给客户,并因此与客户成为能够持续发展的长期商业伙伴。
    
    " ["regionale_sprache"]=> string(1) "4" } } ["objCustomCatalog"]=> object(PCT\CustomElements\Plugins\CustomCatalog\Core\CustomCatalog)#246 (16) { ["arrFilters":protected]=> array(1) { [0]=> object(PCT\CustomElements\Filters\SimpleFilter)#188 (10) { ["arrData":protected]=> array(0) { } ["arrValue":protected]=> array(0) { } ["strName":protected]=> string(0) "" ["strField":protected]=> string(0) "" ["bolIsStrict":protected]=> bool(true) ["arrModified":protected]=> array(1) { [0]=> string(10) "arrOptions" } ["arrTranslations":protected]=> array(0) { } ["objOrigin":protected]=> *RECURSION* ["strTable":protected]=> string(11) "partnerpool" ["arrOptions":protected]=> array(3) { ["column"]=> string(2) "id" ["operation"]=> string(2) "IN" ["value"]=> array(1) { [0]=> string(2) "93" } } } } ["intLimit":protected]=> int(0) ["intOffset":protected]=> int(0) ["objCustomElement":protected]=> NULL ["strSortField":protected]=> string(0) "" ["strSortOrder":protected]=> string(0) "" ["arrSorting":protected]=> array(0) { } ["arrVisibles":protected]=> array(0) { } ["strLanguage":protected]=> string(0) "" ["arrDefaultVisibles":protected]=> array(2) { [0]=> string(2) "id" [1]=> string(3) "pid" } ["objOrigin":protected]=> object(Contao\ModuleModel)#236 (5) { ["arrData":protected]=> array(184) { ["id"]=> string(3) "217" ["pid"]=> string(1) "2" ["tstamp"]=> string(10) "1436450308" ["name"]=> string(27) "CC Partnerpool - leser - de" ["headline"]=> string(45) "a:2:{s:4:"unit";s:2:"h1";s:5:"value";s:0:"";}" ["type"]=> string(19) "customcatalogreader" ["levelOffset"]=> string(1) "0" ["showLevel"]=> string(1) "0" ["hardLimit"]=> string(0) "" ["showProtected"]=> string(0) "" ["defineRoot"]=> string(0) "" ["rootPage"]=> string(1) "0" ["navigationTpl"]=> string(0) "" ["pages"]=> NULL ["orderPages"]=> NULL ["showHidden"]=> string(0) "" ["customLabel"]=> string(0) "" ["autologin"]=> string(0) "" ["jumpTo"]=> string(1) "0" ["redirectBack"]=> string(0) "" ["cols"]=> string(3) "2cl" ["editable"]=> NULL ["memberTpl"]=> string(0) "" ["tableless"]=> string(0) "" ["form"]=> string(1) "0" ["queryType"]=> string(3) "and" ["fuzzy"]=> string(0) "" ["contextLength"]=> string(2) "48" ["totalLength"]=> string(4) "1000" ["perPage"]=> string(1) "0" ["searchType"]=> string(6) "simple" ["searchTpl"]=> string(0) "" ["inColumn"]=> string(4) "main" ["skipFirst"]=> string(1) "0" ["loadFirst"]=> string(0) "" ["size"]=> string(0) "" ["transparent"]=> string(0) "" ["flashvars"]=> string(0) "" ["altContent"]=> NULL ["source"]=> string(8) "internal" ["singleSRC"]=> NULL ["url"]=> string(0) "" ["interactive"]=> string(0) "" ["flashID"]=> string(0) "" ["flashJS"]=> NULL ["imgSize"]=> string(0) "" ["useCaption"]=> string(0) "" ["fullsize"]=> string(0) "" ["multiSRC"]=> NULL ["orderSRC"]=> NULL ["html"]=> NULL ["rss_cache"]=> string(4) "3600" ["rss_feed"]=> NULL ["rss_template"]=> string(11) "rss_default" ["numberOfItems"]=> string(1) "3" ["disableCaptcha"]=> string(0) "" ["reg_groups"]=> NULL ["reg_allowLogin"]=> string(0) "" ["reg_skipName"]=> string(0) "" ["reg_close"]=> string(0) "" ["reg_assignDir"]=> string(0) "" ["reg_homeDir"]=> NULL ["reg_activate"]=> string(0) "" ["reg_jumpTo"]=> string(1) "0" ["reg_text"]=> NULL ["reg_password"]=> NULL ["protected"]=> string(0) "" ["groups"]=> NULL ["guests"]=> string(0) "" ["cssID"]=> string(28) "a:2:{i:0;s:0:"";i:1;s:0:"";}" ["space"]=> string(28) "a:2:{i:0;s:0:"";i:1;s:0:"";}" ["cal_calendar"]=> NULL ["cal_noSpan"]=> string(0) "" ["cal_startDay"]=> string(1) "1" ["cal_format"]=> string(9) "cal_month" ["cal_ignoreDynamic"]=> string(0) "" ["cal_order"]=> string(9) "ascending" ["cal_readerModule"]=> string(1) "0" ["cal_limit"]=> string(1) "0" ["cal_template"]=> string(10) "event_full" ["cal_ctemplate"]=> string(11) "cal_default" ["cal_showQuantity"]=> string(0) "" ["com_order"]=> string(9) "ascending" ["com_moderate"]=> string(0) "" ["com_bbcode"]=> string(0) "" ["com_requireLogin"]=> string(0) "" ["com_disableCaptcha"]=> string(0) "" ["com_template"]=> string(11) "com_default" ["faq_categories"]=> NULL ["faq_readerModule"]=> string(1) "0" ["list_table"]=> string(0) "" ["list_fields"]=> string(0) "" ["list_where"]=> string(0) "" ["list_search"]=> string(0) "" ["list_sort"]=> string(0) "" ["list_info"]=> string(0) "" ["list_info_where"]=> string(0) "" ["list_layout"]=> string(12) "list_default" ["list_info_layout"]=> string(12) "info_default" ["news_archives"]=> NULL ["news_featured"]=> string(9) "all_items" ["news_jumpToCurrent"]=> string(0) "" ["news_readerModule"]=> string(1) "0" ["news_metaFields"]=> string(38) "a:2:{i:0;s:4:"date";i:1;s:6:"author";}" ["news_template"]=> string(11) "news_latest" ["news_format"]=> string(10) "news_month" ["news_startDay"]=> string(1) "0" ["news_order"]=> string(10) "descending" ["news_showQuantity"]=> string(0) "" ["newsletters"]=> NULL ["nl_channels"]=> NULL ["nl_hideChannels"]=> string(0) "" ["nl_subscribe"]=> NULL ["nl_unsubscribe"]=> NULL ["nl_template"]=> string(9) "nl_simple" ["dk_cfsMultiSRC"]=> NULL ["dk_cfsSortBy"]=> string(0) "" ["dk_cfsImageSize"]=> string(0) "" ["dk_cfsFullsize"]=> string(0) "" ["dk_cfsNumberOfItems"]=> string(1) "0" ["dk_cfsUseThumbnails"]=> string(0) "" ["dk_cfsThumbnailsVisibleSelect"]=> string(0) "" ["dk_cfsThumbnailSize"]=> string(0) "" ["dk_cfsThumbnailsVisible"]=> string(1) "5" ["dk_cfsThumbnailsPosition"]=> string(6) "bottom" ["dk_cfsThumbnailsAlign"]=> string(6) "center" ["dk_cfsThumbnailsWidth"]=> string(0) "" ["dk_cfsThumbnailsHeight"]=> string(0) "" ["dk_cfsCarouFredSel"]=> string(0) "" ["dk_cfsSynchronise"]=> string(0) "" ["dk_cfsHtmlTpl"]=> string(0) "" ["dk_cfsCssTpl"]=> string(0) "" ["dk_cfsJsTpl"]=> string(0) "" ["dk_cfsGalleryTpl"]=> string(0) "" ["metamodel"]=> string(1) "0" ["metamodel_layout"]=> string(0) "" ["metamodel_use_limit"]=> string(0) "" ["metamodel_limit"]=> string(1) "0" ["metamodel_offset"]=> string(1) "0" ["metamodel_sortby"]=> string(0) "" ["metamodel_sortby_direction"]=> string(0) "" ["metamodel_filtering"]=> string(1) "0" ["metamodel_rendersettings"]=> string(1) "0" ["metamodel_noparsing"]=> string(0) "" ["metamodel_donotindex"]=> string(0) "" ["metamodel_available_values"]=> string(0) "" ["metamodel_filterparams"]=> NULL ["metamodel_jumpTo"]=> string(1) "0" ["metamodel_fef_params"]=> NULL ["metamodel_fef_autosubmit"]=> string(1) "1" ["metamodel_fef_hideclearfilter"]=> string(0) "" ["metamodel_fef_template"]=> string(10) "event_full" ["metamodel_meta_title"]=> string(0) "" ["metamodel_meta_description"]=> string(0) "" ["module_template"]=> string(0) "" ["showTeaser"]=> string(0) "" ["randomArticle"]=> string(0) "" ["keepArticle"]=> string(2) "10" ["numberOfArticles"]=> string(1) "1" ["dma_eg_data"]=> NULL ["customcatalog"]=> string(11) "partnerpool" ["customcatalog_jumpTo"]=> string(1) "0" ["customcatalog_limit"]=> string(1) "0" ["customcatalog_offset"]=> string(1) "0" ["customcatalog_perPage"]=> string(1) "0" ["customcatalog_setVisibles"]=> string(0) "" ["customcatalog_visibles"]=> NULL ["customcatalog_sortField"]=> string(0) "" ["customcatalog_sorting"]=> string(4) "desc" ["customcatalog_attr_image"]=> NULL ["customcatalog_imgSize"]=> string(0) "" ["customcatalog_filtersets"]=> NULL ["customcatalog_filter_submit"]=> string(0) "" ["customcatalog_filter_method"]=> string(0) "" ["customcatalog_filter_formID"]=> string(0) "" ["customcatalog_filter_showAll"]=> string(1) "1" ["customcatalog_filter_actLang"]=> string(1) "1" ["customcatalog_filter_start"]=> string(1) "0" ["customcatalog_filter_stop"]=> string(1) "0" ["customcatalog_template"]=> string(31) "customcatalog_partnerpool_leser" ["customcatalog_mod_template"]=> string(17) "mod_customcatalog" ["customcatalog_sqlWhere"]=> NULL ["customcatalog_sqlSorting"]=> NULL ["typePrefix"]=> string(3) "ce_" } ["arrModified":protected]=> array(1) { ["typePrefix"]=> NULL } ["arrRelations":protected]=> array(7) { ["pid"]=> array(4) { ["table"]=> string(8) "tl_theme" ["field"]=> string(2) "id" ["type"]=> string(9) "belongsTo" ["load"]=> string(4) "lazy" } ["rootPage"]=> array(4) { ["table"]=> string(7) "tl_page" ["field"]=> string(2) "id" ["type"]=> string(6) "hasOne" ["load"]=> string(4) "lazy" } ["pages"]=> array(4) { ["table"]=> string(7) "tl_page" ["field"]=> string(2) "id" ["type"]=> string(7) "hasMany" ["load"]=> string(4) "lazy" } ["jumpTo"]=> array(4) { ["table"]=> string(7) "tl_page" ["field"]=> string(2) "id" ["type"]=> string(6) "hasOne" ["load"]=> string(5) "eager" } ["reg_groups"]=> array(4) { ["table"]=> string(15) "tl_member_group" ["field"]=> string(2) "id" ["type"]=> string(7) "hasMany" ["load"]=> string(4) "lazy" } ["reg_jumpTo"]=> array(4) { ["table"]=> string(7) "tl_page" ["field"]=> string(2) "id" ["type"]=> string(6) "hasOne" ["load"]=> string(4) "lazy" } ["groups"]=> array(4) { ["table"]=> string(15) "tl_member_group" ["field"]=> string(2) "id" ["type"]=> string(7) "hasMany" ["load"]=> string(4) "lazy" } } ["arrRelated":protected]=> array(1) { ["jumpTo"]=> NULL } ["blnPreventSaving":protected]=> bool(false) } ["bolSkipPagination":protected]=> bool(false) ["strTable":protected]=> string(11) "partnerpool" ["arrData":protected]=> array(47) { ["id"]=> string(1) "3" ["pid"]=> string(1) "3" ["tstamp"]=> string(10) "1437042551" ["title"]=> string(11) "Partnerpool" ["useTitleAsName"]=> string(1) "1" ["protected"]=> string(0) "" ["user_groups"]=> NULL ["tableName"]=> string(11) "partnerpool" ["mode"]=> string(3) "new" ["moreTables"]=> string(1) "1" ["tables"]=> string(23) "a:1:{i:0;s:6:"kunden";}" ["cTables"]=> NULL ["pTable"]=> NULL ["existingTable"]=> string(0) "" ["beSection"]=> string(7) "content" ["injectBelow"]=> string(13) "__beforeAll__" ["newSection"]=> string(0) "" ["sectionName"]=> string(0) "" ["sectionAlias"]=> string(0) "" ["hidden"]=> string(0) "" ["showMenu"]=> string(1) "1" ["icon"]=> string(16) "A��$���HPV�^�" ["active"]=> string(1) "1" ["publishedField"]=> string(2) "82" ["isManageable"]=> string(0) "" ["list_mode"]=> string(1) "1" ["list_fields"]=> string(21) "a:1:{i:0;s:4:"name";}" ["list_headerFields"]=> NULL ["list_flag"]=> string(1) "1" ["list_panelLayout"]=> string(24) "filter;sort;search,limit" ["list_disableGrouping"]=> string(0) "" ["list_operations"]=> string(99) "a:6:{i:0;s:4:"edit";i:1;s:6:"delete";i:2;s:4:"copy";i:3;s:4:"show";i:4;s:3:"cut";i:5;s:6:"toggle";}" ["label_overwrite"]=> string(1) "1" ["label_html"]=> string(8) "" ["aliasField"]=> string(2) "73" ["multilanguage"]=> string(0) "" ["languages"]=> string(45) "a:3:{i:0;s:2:"de";i:1;s:2:"en";i:2;s:2:"fr";}" ["allowComments"]=> string(0) "" ["com_notify"]=> string(12) "notify_admin" ["com_sortOrder"]=> string(9) "ascending" ["com_perPage"]=> string(1) "0" ["com_moderate"]=> string(0) "" ["com_bbcode"]=> string(0) "" ["com_requireLogin"]=> string(0) "" ["com_disableCaptcha"]=> string(0) "" ["restrictCte"]=> string(0) "" ["restrictedCte"]=> NULL } ["arrOptions":protected]=> array(5) { ["table"]=> string(11) "partnerpool" ["columns"]=> array(2) { [0]=> array(3) { ["column"]=> string(2) "id" ["operation"]=> string(2) "IN" ["value"]=> array(1) { [0]=> string(2) "93" } } [1]=> array(3) { ["column"]=> string(16) "veroeffentlichen" ["operation"]=> string(1) "=" ["value"]=> int(1) } } ["limit"]=> array(0) { } ["order"]=> string(0) "" ["fields"]=> array(0) { } } ["arrModified":protected]=> array(1) { [0]=> string(10) "arrOptions" } } } ["value"]=> string(1) "4" ["class"]=> string(32) "field regionale_sprache field_14" ["label"]=> string(17) "Regionale Sprache" ["name"]=> string(17) "regionale_sprache" ["hidden"]=> bool(false) }
    cn
    Ganz unten steht false und woran könnte das liegen?

  19. #19
    Community-Moderator
    Wandelndes Contao-Lexikon
    Avatar von Spooky
    Registriert seit
    12.04.2012.
    Ort
    Scotland
    Beiträge
    35.517
    Partner-ID
    10107

    Standard

    Das ist die Ausgabe des $langs Array:
    PHP-Code:
    array(4) { [0]=> string(2"zh" [1]=> string(2"zh" [2]=> string(2"en" [3]=> string(2"en" 
    Sieh's dir genau an, dann weißt du wo das Problem ist

    // ah und du musst auch bei der Überprüfung von in_array
    PHP-Code:
    $entry->field('regionale_sprache')->html() 
    statt
    PHP-Code:
    $entry->field('regionale_sprache'
    sonst wird dort ja nicht der eigentliche Language String verglichen.
    Geändert von Spooky (16.07.2015 um 16:41 Uhr)

  20. #20
    Contao-Fan
    Registriert seit
    03.09.2013.
    Beiträge
    493

    Standard

    In dem array ist kein chinesischer ländercode, oder?

    Ich musste auch von der variable:
    PHP-Code:
    $entry->field('regionale_sprache')->html() 
    Das template abändern, da es noch ein div ausgegeben hat.

  21. #21
    Community-Moderator
    Wandelndes Contao-Lexikon
    Avatar von Spooky
    Registriert seit
    12.04.2012.
    Ort
    Scotland
    Beiträge
    35.517
    Partner-ID
    10107

    Standard

    Zitat Zitat von Steve_0 Beitrag anzeigen
    In dem array ist kein chinesischer ländercode, oder?
    Doch, aber der Country Code für Chinesisch ist zh, nicht cn.

  22. #22
    Contao-Fan
    Registriert seit
    03.09.2013.
    Beiträge
    493

    Standard

    Aber das ist doch der code für China:
    27-07-_2015_12-03-39.jpg

    Und das ist im browser eingestellt:
    27-07-_2015_12-03-05.jpg

  23. #23
    Contao-Fan
    Registriert seit
    03.09.2013.
    Beiträge
    493

    Standard

    Hmm..ich gehe dann einfach mal nach dem code hier:
    http://www.metamodpro.com/browser-language-codes

  24. #24
    Contao-Fan
    Registriert seit
    03.09.2013.
    Beiträge
    493

    Standard

    Ich habe jetzt den Sprachcode in "zh" geändert.
    $langs schaut so aus:
    PHP-Code:
    array(4) { [0]=> string(2"zh" [1]=> string(2"zh" [2]=> string(2"en" [3]=> string(2"en" 
    Ich bekomme aber immer noch keine Ausgabe der regionalen Sprache.

  25. #25
    Community-Moderator
    Wandelndes Contao-Lexikon
    Avatar von Spooky
    Registriert seit
    12.04.2012.
    Ort
    Scotland
    Beiträge
    35.517
    Partner-ID
    10107

    Standard

    Wie sieht dein Code nun aus? Und poste auch nochmal den Output von
    PHP-Code:
    var_dump$entry->field('regionale_sprache')->html() ); 
    Hat CustomCatalog für die Felder eigentlich auch noch andere Methoden außer ->html()?

  26. #26
    Contao-Fan
    Registriert seit
    03.09.2013.
    Beiträge
    493

    Standard

    Code:
                           
    
        zh 
    array(4) {
      [0]=&gt;
      string(2) "zh"
      [1]=&gt;
      string(2) "zh"
      [2]=&gt;
      string(2) "en"
      [3]=&gt;
      string(2) "en"
    }
    object(PCT\CustomElements\Core\TemplateAttribute)#315 (7) {
      ["attribute"]=&gt;
      object(PCT\CustomElements\Plugins\CustomCatalog\Core\Attribute)#314 (12) {
        ["arrData":protected]=&gt;
        array(84) {
          ["id"]=&gt;
          string(3) "118"
          ["pid"]=&gt;
          string(2) "10"
          ["sorting"]=&gt;
          string(4) "1288"
          ["tstamp"]=&gt;
          string(10) "1437989228"
          ["uuid"]=&gt;
          string(15) "8drcwvccphekjpf"
          ["alias"]=&gt;
          string(17) "regionale_sprache"
          ["type"]=&gt;
          string(8) "selectdb"
          ["title"]=&gt;
          string(17) "Regionale Sprache"
          ["description"]=&gt;
          string(0) ""
          ["template"]=&gt;
          string(24) "customelement_attr_clean"
          ["protected"]=&gt;
          string(0) ""
          ["user_groups"]=&gt;
          NULL
          ["cssID"]=&gt;
          string(28) "a:2:{i:0;s:0:"";i:1;s:0:"";}"
          ["published"]=&gt;
          string(1) "1"
          ["options"]=&gt;
          NULL
          ["hidden"]=&gt;
          string(0) ""
          ["defaultValue"]=&gt;
          NULL
          ["eval_mandatory"]=&gt;
          string(0) ""
          ["eval_rgxp"]=&gt;
          string(0) ""
          ["eval_rowscols"]=&gt;
          string(0) ""
          ["eval_multiple"]=&gt;
          string(0) ""
          ["eval_size"]=&gt;
          string(0) ""
          ["eval_rte"]=&gt;
          string(0) ""
          ["eval_submitOnChange"]=&gt;
          string(0) ""
          ["eval_allowHtml"]=&gt;
          string(0) ""
          ["eval_files"]=&gt;
          string(0) ""
          ["eval_filesOnly"]=&gt;
          string(0) ""
          ["eval_extensions"]=&gt;
          string(0) ""
          ["eval_path"]=&gt;
          NULL
          ["eval_attributeType"]=&gt;
          string(0) ""
          ["eval_includeBlankOption"]=&gt;
          string(1) "1"
          ["eval_datepicker"]=&gt;
          string(0) ""
          ["eval_pagepicker"]=&gt;
          string(0) ""
          ["eval_tl_style"]=&gt;
          string(0) ""
          ["eval_minlength"]=&gt;
          string(1) "0"
          ["eval_maxlength"]=&gt;
          string(1) "0"
          ["eval_tl_class_w50"]=&gt;
          string(0) ""
          ["eval_tl_class_clr"]=&gt;
          string(0) ""
          ["eval_tl_class_m12"]=&gt;
          string(0) ""
          ["eval_tl_class_long"]=&gt;
          string(0) ""
          ["be_visible"]=&gt;
          string(0) ""
          ["isDownload"]=&gt;
          string(0) ""
          ["sortBy"]=&gt;
          string(0) ""
          ["tinyTpl"]=&gt;
          string(0) ""
          ["isRadio"]=&gt;
          string(0) ""
          ["size"]=&gt;
          string(0) ""
          ["include_type"]=&gt;
          string(0) ""
          ["include_item"]=&gt;
          string(1) "0"
          ["date_format"]=&gt;
          string(0) ""
          ["date_rgxp"]=&gt;
          string(8) "datetime"
          ["min_value"]=&gt;
          string(0) ""
          ["max_value"]=&gt;
          string(0) ""
          ["number_format"]=&gt;
          string(0) ""
          ["galleryTpl"]=&gt;
          string(0) ""
          ["tag_roots"]=&gt;
          NULL
          ["tag_custom"]=&gt;
          string(0) ""
          ["tag_table"]=&gt;
          string(0) ""
          ["tag_key"]=&gt;
          string(2) "id"
          ["tag_value"]=&gt;
          string(0) ""
          ["tag_sorting"]=&gt;
          string(0) ""
          ["tag_where"]=&gt;
          string(0) ""
          ["tag_translations"]=&gt;
          string(0) ""
          ["aliasSource"]=&gt;
          string(1) "0"
          ["selectdb_table"]=&gt;
          string(10) "sprachcode"
          ["selectdb_key"]=&gt;
          string(2) "id"
          ["selectdb_value"]=&gt;
          string(4) "code"
          ["selectdb_sorting"]=&gt;
          string(4) "name"
          ["selectdb_translations"]=&gt;
          string(0) ""
          ["selectdb_where"]=&gt;
          string(0) ""
          ["rateit_counter"]=&gt;
          string(1) "0"
          ["allowNotelistVariants"]=&gt;
          string(0) ""
          ["notelistVariants"]=&gt;
          NULL
          ["isSelector"]=&gt;
          string(0) ""
          ["subpalettes"]=&gt;
          NULL
          ["be_filter"]=&gt;
          string(0) ""
          ["be_search"]=&gt;
          string(0) ""
          ["be_sorting"]=&gt;
          string(0) ""
          ["ref_attribute"]=&gt;
          string(1) "0"
          ["isToggler"]=&gt;
          string(0) ""
          ["icon"]=&gt;
          NULL
          ["icon_off"]=&gt;
          NULL
          ["eval_unique"]=&gt;
          string(0) ""
          ["addFontIcon"]=&gt;
          string(0) ""
          ["fontIcon"]=&gt;
          string(0) ""
        }
        ["objWidget":protected]=&gt;
        NULL
        ["objOrigin":protected]=&gt;
        NULL
        ["arrChildAttributes":protected]=&gt;
        array(0) {
        }
        ["strFieldTemplate":protected]=&gt;
        string(22) "be_field_customelement"
        ["varValue":protected]=&gt;
        string(1) "4"
        ["arrModified":protected]=&gt;
        array(1) {
          ["varValue"]=&gt;
          bool(true)
        }
        ["arrOptionValues":protected]=&gt;
        array(0) {
        }
        ["arrTranslations":protected]=&gt;
        array(0) {
        }
        ["uuid"]=&gt;
        string(17) "regionale_sprache"
        ["objActiveRecord"]=&gt;
        object(Contao\Database\Mysqli\Result)#266 (6) {
          ["resResult":protected]=&gt;
          object(mysqli_result)#265 (5) {
            ["current_field"]=&gt;
            int(0)
            ["field_count"]=&gt;
            int(20)
            ["lengths"]=&gt;
            array(20) {
              [0]=&gt;
              int(2)
              [1]=&gt;
              int(1)
              [2]=&gt;
              int(10)
              [3]=&gt;
              int(1)
              [4]=&gt;
              int(0)
              [5]=&gt;
              int(23)
              [6]=&gt;
              int(16)
              [7]=&gt;
              int(0)
              [8]=&gt;
              int(33)
              [9]=&gt;
              int(16)
              [10]=&gt;
              int(0)
              [11]=&gt;
              int(32)
              [12]=&gt;
              int(19)
              [13]=&gt;
              int(20)
              [14]=&gt;
              int(19)
              [15]=&gt;
              int(1)
              [16]=&gt;
              int(1113)
              [17]=&gt;
              int(0)
              [18]=&gt;
              int(1380)
              [19]=&gt;
              int(1)
            }
            ["num_rows"]=&gt;
            int(1)
            ["type"]=&gt;
            int(0)
          }
          ["strQuery":protected]=&gt;
          string(49) "SELECT * FROM partnerpool WHERE id='93' LIMIT 0,1"
          ["intIndex":"Contao\Database\Result":private]=&gt;
          int(0)
          ["blnDone":"Contao\Database\Result":private]=&gt;
          bool(false)
          ["blnModified":"Contao\Database\Result":private]=&gt;
          bool(false)
          ["arrCache":protected]=&gt;
          array(20) {
            ["id"]=&gt;
            string(2) "93"
            ["pid"]=&gt;
            string(1) "0"
            ["tstamp"]=&gt;
            string(10) "1437040548"
            ["sorting"]=&gt;
            string(1) "0"
            ["ptable"]=&gt;
            string(0) ""
            ["name"]=&gt;
            string(23) "eBiz Interactive Co Ltd"
            ["alias"]=&gt;
            string(16) "ebiz-interactive"
            ["adresse"]=&gt;
            string(0) ""
            ["webseite"]=&gt;
            string(33) "http://www.ebiz-interactive.info/"
            ["logo"]=&gt;
            string(16) "��bȿ���PV�^�"
            ["beschreibung"]=&gt;
            string(0) ""
            ["partnertyp"]=&gt;
            string(32) "a:2:{i:0;s:2:"84";i:1;s:2:"86";}"
            ["partner_status"]=&gt;
            string(19) "a:1:{i:0;s:2:"92";}"
            ["land"]=&gt;
            string(20) "a:1:{i:0;s:3:"172";}"
            ["geschaeftsgebiet"]=&gt;
            string(19) "a:1:{i:0;s:2:"99";}"
            ["veroeffentlichen"]=&gt;
            string(1) "1"
            ["beschreibung_englisch"]=&gt;
            string(1113) "<p>Ebiz-interactive Software Technology Consulting Limited Company was founded in May, 2008. We are dedicated to developing e-commerce technology and its marketing strategy, providing services such as system development, offshore development, and marketing consulting. With financial insurance e-commerce and multi-channel e-commerce solutions being our advantages, eBiz-interactive has established long-term and stable cooperation with dozens of enterprises home and abroad since its foundation; the industries involved are IT, financial insurance, public relations and exhibitions, transportation and tourism, sports, education, mining, food, media, lottery, etc. Our work in core business system, cyber marketing, e-commerce, online entertainment, enterprise management and other application areas has been widely recognized by the clients. We commit to delivering value beyond expectations to the clients with reasonable charges, and provide the newest and best products and services with principles of honesty, reciprocity and credibility, which make eBiz-interactive the most reliable long-term partner.</p>"
            ["beschreibung_franzoesisch"]=&gt;
            string(0) ""
            ["beschreibung_regional"]=&gt;
            string(1380) "<p>易商互动软件技术咨询有限公司成立于2008年5月,致力于电子商务的技术开发和营销钻研,为客户提供系统开发、离岸研发中心、市场营销咨询等服务,以金 融保险电商和多渠道电子商务解决方案见长,业务触及核心系统开发、策划与运营以及整合营销事业,向企业提供一站式全套服务。自公司成立以来,已经与国内外 数十家客户建立了长期稳定的合作关系,所涉及的行业包括信息技术、金融保险、公关会展、交通旅游、体育竞技、教育、矿业、食品、媒体、博彩等,在核心业务 系统、网络营销、电子商务、在线娱乐、企业管理等应用领域颇具建树。在日新月异的市场环境下,我们寻求新业务拓展的步伐从未停歇。在不断深化自身多渠道电 商、金融电商自身优势的同时,也根据客户的迫切需求开展了整体运营策划和广告营销推广的相关工作。本着前瞻性的工作原则,易商互动已经在未来的市场前景中 占据了更加具有竞争力的战略阵地,我们始终承诺以合理的价格,向客户交付超越期待的价值,以坦诚、互利、守信的工作原则将最新、最好、最优的产品和服务奉 献给客户,并因此与客户成为能够持续发展的长期商业伙伴。</p>"
            ["regionale_sprache"]=&gt;
            string(1) "4"
          }
        }
        ["objCustomCatalog"]=&gt;
        object(PCT\CustomElements\Plugins\CustomCatalog\Core\CustomCatalog)#250 (16) {
          ["arrFilters":protected]=&gt;
          array(1) {
            [0]=&gt;
            object(PCT\CustomElements\Filters\SimpleFilter)#188 (10) {
              ["arrData":protected]=&gt;
              array(0) {
              }
              ["arrValue":protected]=&gt;
              array(0) {
              }
              ["strName":protected]=&gt;
              string(0) ""
              ["strField":protected]=&gt;
              string(0) ""
              ["bolIsStrict":protected]=&gt;
              bool(true)
              ["arrModified":protected]=&gt;
              array(1) {
                [0]=&gt;
                string(10) "arrOptions"
              }
              ["arrTranslations":protected]=&gt;
              array(0) {
              }
              ["objOrigin":protected]=&gt;
              *RECURSION*
              ["strTable":protected]=&gt;
              string(11) "partnerpool"
              ["arrOptions":protected]=&gt;
              array(3) {
                ["column"]=&gt;
                string(2) "id"
                ["operation"]=&gt;
                string(2) "IN"
                ["value"]=&gt;
                array(1) {
                  [0]=&gt;
                  string(2) "93"
                }
              }
            }
          }
          ["intLimit":protected]=&gt;
          int(0)
          ["intOffset":protected]=&gt;
          int(0)
          ["objCustomElement":protected]=&gt;
          NULL
          ["strSortField":protected]=&gt;
          string(0) ""
          ["strSortOrder":protected]=&gt;
          string(0) ""
          ["arrSorting":protected]=&gt;
          array(0) {
          }
          ["arrVisibles":protected]=&gt;
          array(0) {
          }
          ["strLanguage":protected]=&gt;
          string(0) ""
          ["arrDefaultVisibles":protected]=&gt;
          array(2) {
            [0]=&gt;
            string(2) "id"
            [1]=&gt;
            string(3) "pid"
          }
          ["objOrigin":protected]=&gt;
          object(Contao\ModuleModel)#240 (5) {
            ["arrData":protected]=&gt;
            array(184) {
              ["id"]=&gt;
              string(3) "217"
              ["pid"]=&gt;
              string(1) "2"
              ["tstamp"]=&gt;
              string(10) "1436450308"
              ["name"]=&gt;
              string(27) "CC Partnerpool - leser - de"
              ["headline"]=&gt;
              string(45) "a:2:{s:4:"unit";s:2:"h1";s:5:"value";s:0:"";}"
              ["type"]=&gt;
              string(19) "customcatalogreader"
              ["levelOffset"]=&gt;
              string(1) "0"
              ["showLevel"]=&gt;
              string(1) "0"
              ["hardLimit"]=&gt;
              string(0) ""
              ["showProtected"]=&gt;
              string(0) ""
              ["defineRoot"]=&gt;
              string(0) ""
              ["rootPage"]=&gt;
              string(1) "0"
              ["navigationTpl"]=&gt;
              string(0) ""
              ["pages"]=&gt;
              NULL
              ["orderPages"]=&gt;
              NULL
              ["showHidden"]=&gt;
              string(0) ""
              ["customLabel"]=&gt;
              string(0) ""
              ["autologin"]=&gt;
              string(0) ""
              ["jumpTo"]=&gt;
              string(1) "0"
              ["redirectBack"]=&gt;
              string(0) ""
              ["cols"]=&gt;
              string(3) "2cl"
              ["editable"]=&gt;
              NULL
              ["memberTpl"]=&gt;
              string(0) ""
              ["tableless"]=&gt;
              string(0) ""
              ["form"]=&gt;
              string(1) "0"
              ["queryType"]=&gt;
              string(3) "and"
              ["fuzzy"]=&gt;
              string(0) ""
              ["contextLength"]=&gt;
              string(2) "48"
              ["totalLength"]=&gt;
              string(4) "1000"
              ["perPage"]=&gt;
              string(1) "0"
              ["searchType"]=&gt;
              string(6) "simple"
              ["searchTpl"]=&gt;
              string(0) ""
              ["inColumn"]=&gt;
              string(4) "main"
              ["skipFirst"]=&gt;
              string(1) "0"
              ["loadFirst"]=&gt;
              string(0) ""
              ["size"]=&gt;
              string(0) ""
              ["transparent"]=&gt;
              string(0) ""
              ["flashvars"]=&gt;
              string(0) ""
              ["altContent"]=&gt;
              NULL
              ["source"]=&gt;
              string(8) "internal"
              ["singleSRC"]=&gt;
              NULL
              ["url"]=&gt;
              string(0) ""
              ["interactive"]=&gt;
              string(0) ""
              ["flashID"]=&gt;
              string(0) ""
              ["flashJS"]=&gt;
              NULL
              ["imgSize"]=&gt;
              string(0) ""
              ["useCaption"]=&gt;
              string(0) ""
              ["fullsize"]=&gt;
              string(0) ""
              ["multiSRC"]=&gt;
              NULL
              ["orderSRC"]=&gt;
              NULL
              ["html"]=&gt;
              NULL
              ["rss_cache"]=&gt;
              string(4) "3600"
              ["rss_feed"]=&gt;
              NULL
              ["rss_template"]=&gt;
              string(11) "rss_default"
              ["numberOfItems"]=&gt;
              string(1) "3"
              ["disableCaptcha"]=&gt;
              string(0) ""
              ["reg_groups"]=&gt;
              NULL
              ["reg_allowLogin"]=&gt;
              string(0) ""
              ["reg_skipName"]=&gt;
              string(0) ""
              ["reg_close"]=&gt;
              string(0) ""
              ["reg_assignDir"]=&gt;
              string(0) ""
              ["reg_homeDir"]=&gt;
              NULL
              ["reg_activate"]=&gt;
              string(0) ""
              ["reg_jumpTo"]=&gt;
              string(1) "0"
              ["reg_text"]=&gt;
              NULL
              ["reg_password"]=&gt;
              NULL
              ["protected"]=&gt;
              string(0) ""
              ["groups"]=&gt;
              NULL
              ["guests"]=&gt;
              string(0) ""
              ["cssID"]=&gt;
              string(28) "a:2:{i:0;s:0:"";i:1;s:0:"";}"
              ["space"]=&gt;
              string(28) "a:2:{i:0;s:0:"";i:1;s:0:"";}"
              ["cal_calendar"]=&gt;
              NULL
              ["cal_noSpan"]=&gt;
              string(0) ""
              ["cal_startDay"]=&gt;
              string(1) "1"
              ["cal_format"]=&gt;
              string(9) "cal_month"
              ["cal_ignoreDynamic"]=&gt;
              string(0) ""
              ["cal_order"]=&gt;
              string(9) "ascending"
              ["cal_readerModule"]=&gt;
              string(1) "0"
              ["cal_limit"]=&gt;
              string(1) "0"
              ["cal_template"]=&gt;
              string(10) "event_full"
              ["cal_ctemplate"]=&gt;
              string(11) "cal_default"
              ["cal_showQuantity"]=&gt;
              string(0) ""
              ["com_order"]=&gt;
              string(9) "ascending"
              ["com_moderate"]=&gt;
              string(0) ""
              ["com_bbcode"]=&gt;
              string(0) ""
              ["com_requireLogin"]=&gt;
              string(0) ""
              ["com_disableCaptcha"]=&gt;
              string(0) ""
              ["com_template"]=&gt;
              string(11) "com_default"
              ["faq_categories"]=&gt;
              NULL
              ["faq_readerModule"]=&gt;
              string(1) "0"
              ["list_table"]=&gt;
              string(0) ""
              ["list_fields"]=&gt;
              string(0) ""
              ["list_where"]=&gt;
              string(0) ""
              ["list_search"]=&gt;
              string(0) ""
              ["list_sort"]=&gt;
              string(0) ""
              ["list_info"]=&gt;
              string(0) ""
              ["list_info_where"]=&gt;
              string(0) ""
              ["list_layout"]=&gt;
              string(12) "list_default"
              ["list_info_layout"]=&gt;
              string(12) "info_default"
              ["news_archives"]=&gt;
              NULL
              ["news_featured"]=&gt;
              string(9) "all_items"
              ["news_jumpToCurrent"]=&gt;
              string(0) ""
              ["news_readerModule"]=&gt;
              string(1) "0"
              ["news_metaFields"]=&gt;
              string(38) "a:2:{i:0;s:4:"date";i:1;s:6:"author";}"
              ["news_template"]=&gt;
              string(11) "news_latest"
              ["news_format"]=&gt;
              string(10) "news_month"
              ["news_startDay"]=&gt;
              string(1) "0"
              ["news_order"]=&gt;
              string(10) "descending"
              ["news_showQuantity"]=&gt;
              string(0) ""
              ["newsletters"]=&gt;
              NULL
              ["nl_channels"]=&gt;
              NULL
              ["nl_hideChannels"]=&gt;
              string(0) ""
              ["nl_subscribe"]=&gt;
              NULL
              ["nl_unsubscribe"]=&gt;
              NULL
              ["nl_template"]=&gt;
              string(9) "nl_simple"
              ["dk_cfsMultiSRC"]=&gt;
              NULL
              ["dk_cfsSortBy"]=&gt;
              string(0) ""
              ["dk_cfsImageSize"]=&gt;
              string(0) ""
              ["dk_cfsFullsize"]=&gt;
              string(0) ""
              ["dk_cfsNumberOfItems"]=&gt;
              string(1) "0"
              ["dk_cfsUseThumbnails"]=&gt;
              string(0) ""
              ["dk_cfsThumbnailsVisibleSelect"]=&gt;
              string(0) ""
              ["dk_cfsThumbnailSize"]=&gt;
              string(0) ""
              ["dk_cfsThumbnailsVisible"]=&gt;
              string(1) "5"
              ["dk_cfsThumbnailsPosition"]=&gt;
              string(6) "bottom"
              ["dk_cfsThumbnailsAlign"]=&gt;
              string(6) "center"
              ["dk_cfsThumbnailsWidth"]=&gt;
              string(0) ""
              ["dk_cfsThumbnailsHeight"]=&gt;
              string(0) ""
              ["dk_cfsCarouFredSel"]=&gt;
              string(0) ""
              ["dk_cfsSynchronise"]=&gt;
              string(0) ""
              ["dk_cfsHtmlTpl"]=&gt;
              string(0) ""
              ["dk_cfsCssTpl"]=&gt;
              string(0) ""
              ["dk_cfsJsTpl"]=&gt;
              string(0) ""
              ["dk_cfsGalleryTpl"]=&gt;
              string(0) ""
              ["metamodel"]=&gt;
              string(1) "0"
              ["metamodel_layout"]=&gt;
              string(0) ""
              ["metamodel_use_limit"]=&gt;
              string(0) ""
              ["metamodel_limit"]=&gt;
              string(1) "0"
              ["metamodel_offset"]=&gt;
              string(1) "0"
              ["metamodel_sortby"]=&gt;
              string(0) ""
              ["metamodel_sortby_direction"]=&gt;
              string(0) ""
              ["metamodel_filtering"]=&gt;
              string(1) "0"
              ["metamodel_rendersettings"]=&gt;
              string(1) "0"
              ["metamodel_noparsing"]=&gt;
              string(0) ""
              ["metamodel_donotindex"]=&gt;
              string(0) ""
              ["metamodel_available_values"]=&gt;
              string(0) ""
              ["metamodel_filterparams"]=&gt;
              NULL
              ["metamodel_jumpTo"]=&gt;
              string(1) "0"
              ["metamodel_fef_params"]=&gt;
              NULL
              ["metamodel_fef_autosubmit"]=&gt;
              string(1) "1"
              ["metamodel_fef_hideclearfilter"]=&gt;
              string(0) ""
              ["metamodel_fef_template"]=&gt;
              string(10) "event_full"
              ["metamodel_meta_title"]=&gt;
              string(0) ""
              ["metamodel_meta_description"]=&gt;
              string(0) ""
              ["module_template"]=&gt;
              string(0) ""
              ["showTeaser"]=&gt;
              string(0) ""
              ["randomArticle"]=&gt;
              string(0) ""
              ["keepArticle"]=&gt;
              string(2) "10"
              ["numberOfArticles"]=&gt;
              string(1) "1"
              ["dma_eg_data"]=&gt;
              NULL
              ["customcatalog"]=&gt;
              string(11) "partnerpool"
              ["customcatalog_jumpTo"]=&gt;
              string(1) "0"
              ["customcatalog_limit"]=&gt;
              string(1) "0"
              ["customcatalog_offset"]=&gt;
              string(1) "0"
              ["customcatalog_perPage"]=&gt;
              string(1) "0"
              ["customcatalog_setVisibles"]=&gt;
              string(0) ""
              ["customcatalog_visibles"]=&gt;
              NULL
              ["customcatalog_sortField"]=&gt;
              string(0) ""
              ["customcatalog_sorting"]=&gt;
              string(4) "desc"
              ["customcatalog_attr_image"]=&gt;
              NULL
              ["customcatalog_imgSize"]=&gt;
              string(0) ""
              ["customcatalog_filtersets"]=&gt;
              NULL
              ["customcatalog_filter_submit"]=&gt;
              string(0) ""
              ["customcatalog_filter_method"]=&gt;
              string(0) ""
              ["customcatalog_filter_formID"]=&gt;
              string(0) ""
              ["customcatalog_filter_showAll"]=&gt;
              string(1) "1"
              ["customcatalog_filter_actLang"]=&gt;
              string(1) "1"
              ["customcatalog_filter_start"]=&gt;
              string(1) "0"
              ["customcatalog_filter_stop"]=&gt;
              string(1) "0"
              ["customcatalog_template"]=&gt;
              string(31) "customcatalog_partnerpool_leser"
              ["customcatalog_mod_template"]=&gt;
              string(17) "mod_customcatalog"
              ["customcatalog_sqlWhere"]=&gt;
              NULL
              ["customcatalog_sqlSorting"]=&gt;
              NULL
              ["typePrefix"]=&gt;
              string(3) "ce_"
            }
            ["arrModified":protected]=&gt;
            array(1) {
              ["typePrefix"]=&gt;
              NULL
            }
            ["arrRelations":protected]=&gt;
            array(7) {
              ["pid"]=&gt;
              array(4) {
                ["table"]=&gt;
                string(8) "tl_theme"
                ["field"]=&gt;
                string(2) "id"
                ["type"]=&gt;
                string(9) "belongsTo"
                ["load"]=&gt;
                string(4) "lazy"
              }
              ["rootPage"]=&gt;
              array(4) {
                ["table"]=&gt;
                string(7) "tl_page"
                ["field"]=&gt;
                string(2) "id"
                ["type"]=&gt;
                string(6) "hasOne"
                ["load"]=&gt;
                string(4) "lazy"
              }
              ["pages"]=&gt;
              array(4) {
                ["table"]=&gt;
                string(7) "tl_page"
                ["field"]=&gt;
                string(2) "id"
                ["type"]=&gt;
                string(7) "hasMany"
                ["load"]=&gt;
                string(4) "lazy"
              }
              ["jumpTo"]=&gt;
              array(4) {
                ["table"]=&gt;
                string(7) "tl_page"
                ["field"]=&gt;
                string(2) "id"
                ["type"]=&gt;
                string(6) "hasOne"
                ["load"]=&gt;
                string(5) "eager"
              }
              ["reg_groups"]=&gt;
              array(4) {
                ["table"]=&gt;
                string(15) "tl_member_group"
                ["field"]=&gt;
                string(2) "id"
                ["type"]=&gt;
                string(7) "hasMany"
                ["load"]=&gt;
                string(4) "lazy"
              }
              ["reg_jumpTo"]=&gt;
              array(4) {
                ["table"]=&gt;
                string(7) "tl_page"
                ["field"]=&gt;
                string(2) "id"
                ["type"]=&gt;
                string(6) "hasOne"
                ["load"]=&gt;
                string(4) "lazy"
              }
              ["groups"]=&gt;
              array(4) {
                ["table"]=&gt;
                string(15) "tl_member_group"
                ["field"]=&gt;
                string(2) "id"
                ["type"]=&gt;
                string(7) "hasMany"
                ["load"]=&gt;
                string(4) "lazy"
              }
            }
            ["arrRelated":protected]=&gt;
            array(1) {
              ["jumpTo"]=&gt;
              NULL
            }
            ["blnPreventSaving":protected]=&gt;
            bool(false)
          }
          ["bolSkipPagination":protected]=&gt;
          bool(false)
          ["strTable":protected]=&gt;
          string(11) "partnerpool"
          ["arrData":protected]=&gt;
          array(47) {
            ["id"]=&gt;
            string(1) "3"
            ["pid"]=&gt;
            string(1) "3"
            ["tstamp"]=&gt;
            string(10) "1437042551"
            ["title"]=&gt;
            string(11) "Partnerpool"
            ["useTitleAsName"]=&gt;
            string(1) "1"
            ["protected"]=&gt;
            string(0) ""
            ["user_groups"]=&gt;
            NULL
            ["tableName"]=&gt;
            string(11) "partnerpool"
            ["mode"]=&gt;
            string(3) "new"
            ["moreTables"]=&gt;
            string(1) "1"
            ["tables"]=&gt;
            string(23) "a:1:{i:0;s:6:"kunden";}"
            ["cTables"]=&gt;
            NULL
            ["pTable"]=&gt;
            NULL
            ["existingTable"]=&gt;
            string(0) ""
            ["beSection"]=&gt;
            string(7) "content"
            ["injectBelow"]=&gt;
            string(13) "__beforeAll__"
            ["newSection"]=&gt;
            string(0) ""
            ["sectionName"]=&gt;
            string(0) ""
            ["sectionAlias"]=&gt;
            string(0) ""
            ["hidden"]=&gt;
            string(0) ""
            ["showMenu"]=&gt;
            string(1) "1"
            ["icon"]=&gt;
            string(16) "A��$���HPV�^�"
            ["active"]=&gt;
            string(1) "1"
            ["publishedField"]=&gt;
            string(2) "82"
            ["isManageable"]=&gt;
            string(0) ""
            ["list_mode"]=&gt;
            string(1) "1"
            ["list_fields"]=&gt;
            string(21) "a:1:{i:0;s:4:"name";}"
            ["list_headerFields"]=&gt;
            NULL
            ["list_flag"]=&gt;
            string(1) "1"
            ["list_panelLayout"]=&gt;
            string(24) "filter;sort;search,limit"
            ["list_disableGrouping"]=&gt;
            string(0) ""
            ["list_operations"]=&gt;
            string(99) "a:6:{i:0;s:4:"edit";i:1;s:6:"delete";i:2;s:4:"copy";i:3;s:4:"show";i:4;s:3:"cut";i:5;s:6:"toggle";}"
            ["label_overwrite"]=&gt;
            string(1) "1"
            ["label_html"]=&gt;
            string(8) ""
            ["aliasField"]=&gt;
            string(2) "73"
            ["multilanguage"]=&gt;
            string(0) ""
            ["languages"]=&gt;
            string(45) "a:3:{i:0;s:2:"de";i:1;s:2:"en";i:2;s:2:"fr";}"
            ["allowComments"]=&gt;
            string(0) ""
            ["com_notify"]=&gt;
            string(12) "notify_admin"
            ["com_sortOrder"]=&gt;
            string(9) "ascending"
            ["com_perPage"]=&gt;
            string(1) "0"
            ["com_moderate"]=&gt;
            string(0) ""
            ["com_bbcode"]=&gt;
            string(0) ""
            ["com_requireLogin"]=&gt;
            string(0) ""
            ["com_disableCaptcha"]=&gt;
            string(0) ""
            ["restrictCte"]=&gt;
            string(0) ""
            ["restrictedCte"]=&gt;
            NULL
          }
          ["arrOptions":protected]=&gt;
          array(5) {
            ["table"]=&gt;
            string(11) "partnerpool"
            ["columns"]=&gt;
            array(2) {
              [0]=&gt;
              array(3) {
                ["column"]=&gt;
                string(2) "id"
                ["operation"]=&gt;
                string(2) "IN"
                ["value"]=&gt;
                array(1) {
                  [0]=&gt;
                  string(2) "93"
                }
              }
              [1]=&gt;
              array(3) {
                ["column"]=&gt;
                string(16) "veroeffentlichen"
                ["operation"]=&gt;
                string(1) "="
                ["value"]=&gt;
                int(1)
              }
            }
            ["limit"]=&gt;
            array(0) {
            }
            ["order"]=&gt;
            string(0) ""
            ["fields"]=&gt;
            array(0) {
            }
          }
          ["arrModified":protected]=&gt;
          array(1) {
            [0]=&gt;
            string(10) "arrOptions"
          }
        }
      }
      ["value"]=&gt;
      string(1) "4"
      ["class"]=&gt;
      string(32) "field regionale_sprache field_14"
      ["label"]=&gt;
      string(17) "Regionale Sprache"
      ["name"]=&gt;
      string(17) "regionale_sprache"
      ["hidden"]=&gt;
      bool(false)
      ["html"]=&gt;
      string(7) "
        zh"
    }
    Es gibt statt html(), noch value() aber dann wird die id ausgegeben.

  27. #27
    Community-Moderator
    Wandelndes Contao-Lexikon
    Avatar von Spooky
    Registriert seit
    12.04.2012.
    Ort
    Scotland
    Beiträge
    35.517
    Partner-ID
    10107

    Standard

    Code:
      ["html"]=&gt;
      string(7) "
        zh"
    Wie du hier siehst, gibt
    PHP-Code:
    $entry->field('regionale_sprache')->html() 
    nicht einfach nur "zh" aus, sondern
    Code:
    "
        zh"
    Also da ist zusätzlicher Whitespace drin, daher musst du bei deiner Überprüfung
    PHP-Code:
    trim() 
    anwenden. Also:
    PHP-Code:
    // get the http accept languages
    $langs = \Environment::get('httpAcceptLanguage');

    // convert 'de-DE' & 'de_DE' to 'de'
    $langs array_map( function( $lang ) { return $lang strtolowersubstr$lang0) ); }, $langs );

    // check if custom language exists
    if( in_arraytrimstrip_tags$entry->field('regionale_sprache')->html() ) ), $langs ) )
    {
        echo 
    $entry->field('beschreibung_regional')->html();
    }
    // otherwise show default languages
    else
    {
        switch(
    $GLOBALS['TL_LANGUAGE'])
            {
                case 
    'de':
                    echo 
    $entry->field('beschreibung')->html();
                    break;
                case 
    'en':
                    echo 
    $entry->field('beschreibung_englisch')->html();
                    break;
                case 
    'fr':
                    echo 
    $entry->field('beschreibung_franzoesisch')->html();
                    break;
                default:
                    echo 
    $entry->field('beschreibung_englisch')->html();
                    break;
            }

    (Habe auch zusätzlich ein strip_tags eingebaut.)

  28. #28
    Contao-Fan
    Registriert seit
    03.09.2013.
    Beiträge
    493

    Standard

    Wow Danke, was macht denn das "trim" bzw das "strip_tags"?

Aktive Benutzer

Aktive Benutzer

Aktive Benutzer in diesem Thema: 1 (Registrierte Benutzer: 0, Gäste: 1)

Berechtigungen

  • Neue Themen erstellen: Nein
  • Themen beantworten: Nein
  • Anhänge hochladen: Nein
  • Beiträge bearbeiten: Nein
  •