The channel is referenced in Dede Channelartlist and the style of the current selection class is set, temporarily without effect. SPECIAL HAIR Help!!!!

Source: Internet
Author: User

In Dede you need to reach the current selection of the class, the style is different. If it's channelartlist. You can use the following conditions:

1 {dede:channelartlist typeid= ' 6 ' row= ' 3 ' currentstyle= ' current '}2     class= ' {dede:field.currentstyle/} ' >3         <a href= ' {dede:field name= ' typeurl '/} ' >4             {dede: Field name= ' TypeName '/}5         </a>6     </li>7 {/dede: Channelartlist}

This default has no effect. The following steps need to be done in channelartlist.lib.php:

Add the following in this line

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         Ten         ###########################################################

You can add the above code.

If only the channel is used. You can use the following to implement. This refers to the figure "Yuanxi". Thanks also for the help of "Yuanxi".

But. If there are two sets together. It can't be achieved. The following posts my code.
1{dede:channelartlist typeid= ' 6 ' row= ' 3 ' currentstyle= ' current '}2<liclass= ' {dede:field.currentstyle/} ' >3<a href= ' {dede:field name= ' typeurl '/} ' >4{Dede:field name= ' typename '/}5</a>6<ulclass= "FAQ_UL2" >7{dede:channel type= ' son ' noself= ' yes ' currentstyle= '8 <li class= ' TestClass ' >9<a href= ' ~typelink~ ' title= "~typename~">~typename~</a>Ten </li> One"} A<li> -<a title= "[field:typename/]" href= "[field:typelink/]" >--[field:typename/]</a> -</li> the{/dede:Channel} -</ul> -</li> -{/dede:channelartlist}

This way the channelartlist will have a class style. But internal channel does not have class= "TestClass", is very puzzled.

Then decide to check the underlying PHP file. Test the output in channel.lib.php.

1                 //handle the style of the current column in the sibling column2                 if( ($row[' ID ']==$typeid|| ($topid==$row[' ID '] &&$type= ' top ') &&$currentstyle! = " )3                 {4                     Print' Test_4 ';//Test Output5                     $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);Ten                     $linkOkstr=Str_replace("~typename~",$row[' TypeName '],$linkOkstr); One                     $likeType.=$linkOkstr; A                 } -                 Else -                 { the                     Print' Test_5 ';//Test Output -                     $row[' typelink '] =$row[' typeurl '] = Getonetypeurla ($row); -                     if(Is_array($DTP 2-CTags)) -                     { +                         foreach($DTP 2->ctags as $tagid=$ctag) -                         { +                             if(isset($row[$ctag->getname ()]))$DTP 2->assign ($tagid,$row[$ctag-GetName ()]); A                         } at                     } -                     $likeType.=$DTP 2-GetResult (); -                      -}

Look at the output of the test_5. Puzzled. Make a record. I hope you will give us a lesson.

Do not have an individual effect. has been implemented. Or little brother there is a place where understanding is not right. Please point out.

The main need

11111111111111111

1-2

1-3

222222222222222222-12-2 If there is a choice of 2-1. The style of 2-1 changes.

The channel is referenced in Dede Channelartlist and the style of the current selection class is set, temporarily without effect. SPECIAL HAIR Help!!!!

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.