In dedechannelartlist, the channel is referenced and the style of the selected class is set. Currently, currentstyle has no effect. please try again !!!! -Samcao

Source: Internet
Author: User
In dedechannelartlist, the channel is referenced and the style of the selected class is set. Currently, currentstyle has no effect. please try again !!!! -Samcao needs to reach the selected class in dede, and the style is different. if it is channelartlist, you can use the following situation:

1 {dede:channelartlist typeid='6' row='3' currentstyle='current'}2     
  • 3 4 {dede:field name='typename'/}5 6
  • 7 {/dede:channelartlist}

    This is ineffective by default. you need to perform the following steps in channelartlist. lib. php:

    Add

    1 $pv->Fields['typeurl'] = GetOneTypeUrlA($typeids[$i]);

     1         ########################################################## 2          3          if($typeids[$i]['id'] == $refObj->TypeLink->TypeInfos['id'] || $typeids[$i]['id'] == $refObj->TypeLink->TypeInfos['topid'] ){  4             $pv->Fields['currentstyle'] = $currentstyle ? $currentstyle : 'current';  5         }  6         else{  7             $pv->Fields['currentstyle'] = '';  8         }  9         10         ###########################################################

    Only the above code can be added.

    If you only use the channel, you can use the following to implement it. here we reference the "Yuan Xi" graph. thank you for your help.

    However, if the two sets are together, they won't be implemented. I will post my code below.

     1 {dede:channelartlist typeid='6' row='3' currentstyle='current'} 2     
  • 3 4 {dede:field name='typename'/} 5 6
      7 {dede:channel type='son' noself='yes' currentstyle=" 8
    • 9 >~typename~10
    • 11 "}12
    • 13 --[field:typename/]14
    • 15 {/dede:channel}16
    17
  • 18 {/dede:channelartlist}

    In this way, channelartlist has a class style, but the internal channel does not have class = "testclass", which is hard to understand.

    So I decided to check it in the underlying PHP file. Test the output in channel. lib. php.

    1 // process columns of the same level, style 2 of the current column if ($ row ['id'] = $ typeid | ($ topid = $ row ['id'] & $ type =' top ')) & $ currentstyle! = '') 3 {4 print 'test _ 4'; // test output 5 $ linkOkstr = $ currentstyle; 6 $ row ['typelink'] = GetOneTypeUrlA ($ row ); 7 $ linkOkstr = str_replace ("~ Rel ~ ", $ Row ['Rel '], $ linkOkstr); 8 $ linkOkstr = str_replace ("~ Id ~ ", $ Row ['id'], $ linkOkstr); 9 $ linkOkstr = str_replace ("~ Typelink ~ ", $ Row ['typelink'], $ linkOkstr); 10 $ linkOkstr = str_replace ("~ Typename ~ ", $ Row ['typename'], $ linkOkstr); 11 $ likeType. = $ linkOkstr; 12} 13 else14 {15 print 'test _ 5 '; // test output 16 $ row ['typelink'] = $ row ['typeurl'] = GetOneTypeUrlA ($ row); 17 if (is_array ($ dtp2-> CTags )) 18 {19 foreach ($ dtp2-> CTags as $ tagid => $ ctag) 20 {21 if (isset ($ row [$ ctag-> GetName ()]) $ dtp2-> Assign ($ tagid, $ row [$ ctag-> GetName ()]); 22} 23} 24 $ likeType. = $ dtp2-> GetResult (); 25 26}

    The output is test_5. I don't know. I want to keep a record for now.

    It should not be a single effect. it has already been achieved. or the younger brother has something wrong with it. please point it out.

    Mainly required

    11111111111111111

    1-2

    1-3

    22222222222222222

    2-1

    2-2

    If 2-1 is selected, the. 2-1 style changes.

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.