Discuz Forum homepage and plate partitioning using different templates

Source: Internet
Author: User

DZ template production, a little bit very nonsense! is the Forum homepage and plate partition are all used discuz.htm as a template! In this case, if you want to make the Forum home page and plate partition using different templates is very troublesome, after one hours of research, found two methods:

The first kind, is into the background plate management inside the template, this method is more troublesome to use, no longer say.

The second method is to use PHP to determine the modification of discuz.htm

After observing the discuz.htm inside there

    1. <!--{if empty ($gid)}-->
    2. Content..........
    3. <!--{/if}--

The general sense of the above is that if the post comes to the gig if it is empty, execute the code inside ... Do you understand me? Forum homepage is/forum.php, plate page is forum.php?gid=xxx, that is, only the GID of the homepage is empty, only the plate partition has GID. Here's how to modify it:

We just need to

class = "MN" This div is put in

    1. <!--{if empty ($gid)}-->
    2. Content..........
    3. <!--{/if}--

This can be done in this way, so that the plate partitions are only displayed on the home page

Then plate partitioning uses the following code to

    1. &NBSP;
    2. <! --the partition template starts-->
    3. <!--{if $gid! = ""}--> /span>
    4. <!--[diy=diy_muban]--> <div id= "Diy_muban" class= "area" >< /div><!--[/diy]-->
    5. <!--{/if}-->
    6. <!--partition template end-->
    7. &NBSP;

The above code means that when the plate GID is not equal to empty when the DIY template is displayed, that is, only in the plate partition will display the above DIY template.

Then is to enter the plate to be modified to distinguish, and then add a DIY template, save the time must choose to apply only to the current page, and then modify the CSS on the line!

Discuz Forum homepage and plate partitioning using different templates

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.