Home CMS Tutorial PHPCMS How to replace the home page in phpcms

How to replace the home page in phpcms

Oct 30, 2019 am 11:41 AM
phpcms front page

How to replace the home page in phpcms

How to replace the homepage with phpcms:

First make a static corporate website homepage:

<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title></title>
    </head>
    <style type="text/css">
        ul li{
            list-style: none;
            display: block;
            position: relative;
            float: left;
            width: 100px;
             
             
        }
        ul{
            height: 50px;
        }
        .base{
            color: #000000;
        }
        .col{
            color: #0000FF;
        }
         
        ul li a{
            text-decoration: none;
             
        }
        #header{
            width: 1200px;
            height: 50px;
            border: solid 2px #000000;
        }
         
        #footer{
            width: 1200px;
            height: 50px;
            border: solid 2px #000000;
        }
        .list{
            position: relative;
            width: 500px;
            height: 250px;
            margin-left: 50px;
            border: solid 2px #000000;
            margin-top: 10px;
            float: left;
        }
        #content{
            width: 1200px;
            height: 550px;
        }
    </style>
    <body>
         <div id="header">
        <ul>
            <li ><a class="col" href="">首页</a></li>
            <li ><a class="base" href="">新闻</a></li>
            <li ><a class="base" href="">公告</a></li>
            <li ><a class="base" href="">关于我们</a></li>
            <li ><a class="base" href="">加入我们</a></li>
        </ul>
         
    </div>
     
    <div id="content">
        <div class="list">新闻<span style="padding-left: 430px;"><a href="#">更多</a></span> <p>腐败发布啊</p></div>
        <div class="list">公告<span style="padding-left: 430px;"><a href="#">更多</a></span><p>大牛坊三年级</p></div>
        <div class="list">关于<span style="padding-left: 430px;"><a href="#">更多</a></span><p>打你叫你</p></div>
        <div class="list">招聘<span style="padding-left: 430px;"><a href="#">更多</a></span><p>的毛囊烦恼</p></div>
    </div>
     
    <div id="footer">
        <ul>
            <li ><a class="base" href="">友情链接</a></li>
            <li ><a class="base" href="">链接1</a></li>
            <li ><a class="base" href="">链接2</a></li>
            <li ><a class="base" href="">链接3</a></li>
            <li ><a class="base" href="">链接4</a></li>
        </ul>
    </div>
    </body>
</html>
Copy after login

Operation effect:

How to replace the home page in phpcmsPut the JS and CSS files in the web page to the corresponding location under the statics folder.

How to replace the home page in phpcms

And modify the file address according to the following format:

Replacement method:

{CSS_PATH} represents the CSS storage path defined by CMS

{JS_PATH} represents the JS storage path defined by CMS

{IMG_PATH} represents the image storage path defined by CMS

How to replace the home page in phpcms

1. Setting requirements Template used

Change the default template in phpcms to the template you made.

Create a new English folder in phpcms/install_package/phpcms/templates

How to replace the home page in phpcms

Create a content folder under this folder

How to replace the home page in phpcms

Change the created .html web page file name to index.html and put it into the content folder

How to replace the home page in phpcms

Log in to the phpcms background, You can see that the newly added template

How to replace the home page in phpcms

will be displayed in the interface-》Template Style-》Select the template style in Site Management and click OK.

How to replace the home page in phpcms

Update the cache and generate the home page

How to replace the home page in phpcms

How to replace the home page in phpcmsAt this time, click on the home page of the site and you will see that the template has been changed successfully :

1How to replace the home page in phpcms

2. Split the template

Split the template into header code, content code, and tail code

Create new headers respectively The content part of .html footer.html is still retained in index.html

Add the code {template "content","header"} to the head of index.html to import header.html

Add the code {template "content","footer"} at the end of index.html to import footer.html

3. Add the column

in the header. In html

first add a link to the navigation bar:

Change

<ul>
            <li ><a class="col" href="">首页</a></li>
            <li ><a class="base" href="">新闻</a></li>
            <li ><a class="base" href="">公告</a></li>
            <li ><a class="base" href="">关于我们</a></li>
            <li ><a class="base" href="">加入我们</a></li>
        </ul>
Copy after login

to:

{pc:content action="category" catid="0" num="5" siteid="$siteid" order="listorder ASC"}
            <ul >
            <li><a class="base" href="{siteurl($siteid)}"><span>首页</span></a></li>
            {loop $data $r}
            <li><a class="base" href="{$r[url]}"><span>{$r[catname]}</span></a></li>
            {/loop}
            </ul>
        {/pc}
Copy after login

num is the maximum number of columns

If you want to increase the navigation monitoring effect, add the code:

<div id="header">
         <ul>
            {if $top_parentid==0}<!--判断首页显示的是不是首页-->
            <li><a href="{siteurl($siteid)}" class="col">首页</a></li> <!--如果是首页,给首页加属性字体显示白色。-->   
            {else}
            <li><a href="{siteurl($siteid)}">首页</a></li><!--如果不是首页,内容正常显示。-->
            {/if}
            {pc:content action="category" catid="0" num="5" siteid="$siteid" order="listorder ASC"}
            {if $catid==$r[catid] || $top_parentid==$r[catid]}<!--判断显示的catid,如果是显示的catid-->
            <li><a href="{$r[url]}" class="col">{$r[catname]}</a></li><!--加属性,字体显示白色-->
            {else}
            <li><a href="{$r[url]}" class="base">{$r[catname]}</a></li><!--如果显示的不是,内容正常显示-->
            {/if}
            {/pc}
         
         </ul>   
         
         
    </div>
Copy after login

Display effect:

1How to replace the home page in phpcms

##Add column:

In the phpcms background , Content-》Add Column in Management Column

Just add the columns that need to be added. Note that the template in the template settings must be modified to the current template.

4. Add content to the column

Modify the code of index.html

First add more internal links:

Code:

<a href="{$CATEGORYS[10][url]}">更多</a>
Copy after login

The number in the middle represents the column code in the phpcms background

Set dynamics for the content of the div:

新闻<a href="{$CATEGORYS[10][url]}">更多</a> {pc:content action="lists" catid="10" num="1" siteid="$siteid" order="id DESC"} {loop $data $r $val}

{$val[title]}

{$val[description]}

{/loop} {/pc}
Copy after login
Recommendation:

php server

The above is the detailed content of How to replace the home page in phpcms. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
1 months ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to set up Google Chrome homepage How to set up Google Chrome homepage Mar 02, 2024 pm 04:04 PM

How to set up Google Chrome homepage? Google Chrome is the most popular web browser software today. This browser has simple and efficient features that users like. When using browsers, different people have different settings preferences. Some people like to use Google Chrome. The browser is set as the default homepage, and some people like to set the homepage as other search engines, so where should it be set? Next, the editor will bring you a quick method to set up the homepage of Google Chrome. I hope it can be helpful to you. How to quickly set the Google Chrome homepage 1. Open Google Chrome (as shown in the picture). 2. Click the menu button in the upper right corner of the interface (as shown in the picture). 3. Select the "Settings" option (as shown in the picture). 4. In the settings menu, find "Search Engine" (such as

How to jump to the details page in phpcms How to jump to the details page in phpcms Jul 27, 2023 pm 05:23 PM

How to jump to the details page in phpcms: 1. Use the header function to generate a jump link; 2. Loop through the content list; 3. Get the title and details page link of the content; 4. Generate a jump link.

What framework is phpcms? What framework is phpcms? Apr 20, 2024 pm 10:51 PM

PHP CMS is a PHP-based open source content management system for managing website content. Its features include ease of use, powerful functionality, scalability, high security, and free open source. It can save time, improve website quality, enhance collaboration and reduce development costs, and is widely used in various websites such as news websites, blogs, corporate websites, e-commerce websites and community forums.

What should I do if the Google Chrome homepage changes to 360? Restore the Google Chrome homepage What should I do if the Google Chrome homepage changes to 360? Restore the Google Chrome homepage Mar 15, 2024 am 08:16 AM

What should I do if the Google Chrome homepage changes to 360? Google Chrome is a simple and convenient browser, but many friends find that the simple homepage has been replaced by a 360 homepage during use. If they want to restore it to its original style, how should it be set? Below, the editor will show you how to restore the Google Chrome homepage. Solution: 1. First open Google Chrome. 2. If you want to change it to the default, click the three dots in the upper right corner. 3. Click [Settings] to open the settings page. 4. Click [Startup]. 5. As shown in the picture, [Open a specific web page or a group of web pages] here is the URL of 360 Navigation. 6. Click the three dots on the right side of the 360 ​​navigation. 7. Click [Remove].​

WeChat Login Integration Guide: PHPCMS Practical Combat WeChat Login Integration Guide: PHPCMS Practical Combat Mar 29, 2024 am 09:18 AM

Title: WeChat Login Integration Guide: PHPCMS in Action In today’s Internet era, social login has become one of the essential functions of a website. As one of the most popular social platforms in China, WeChat’s login function is also used by more and more websites. This article will introduce how to integrate the WeChat login function in the PHPCMS website and provide specific code examples. Step 1: Register a WeChat Open Platform Account First, we need to register a developer account on the WeChat Open Platform and apply for the corresponding development permissions. Log in [WeChat open platform]

UniApp realizes the design and development method of home page and navigation page UniApp realizes the design and development method of home page and navigation page Jul 07, 2023 pm 09:09 PM

Design and development method of UniApp to realize home page and navigation page 1. Introduction UniApp is a cross-platform development tool built on the Vue.js framework, which can compile a set of codes to produce applications for multiple platforms. In UniApp, the homepage and navigation page are two necessary pages when developing applications. This article will introduce how to design and develop these two pages in UniApp, and provide corresponding code examples. 2. Home page design and development method Page structure UniApp’s home page generally includes a title bar, carousel, and classification

What does phpcms mean? What does phpcms mean? Apr 20, 2024 pm 10:39 PM

PHPCMS is a free and open source content management system (CMS) that features: open source, modularity, flexibility, user-friendliness and community support. It can be used to create various types of websites, including corporate websites, e-commerce websites, blogs, and community forums. Technical requirements include: PHP 5.6 or higher, MySQL, MariaDB or PostgreSQL database, and Apache or Nginx web server.

Isn't phpcms free? Isn't phpcms free? Mar 01, 2023 am 10:24 AM

phpcms is not completely free. phpcms is an open source cms system, but open source does not mean free. It has two versions: free version and commercial version. The free version is limited to personal non-commercial use, while the commercial version requires purchasing a license; individuals can use it for research, and if it is commercial application , you need to pay a certain fee.

See all articles