search
HomeBackend DevelopmentPHP Tutorialphpcms replaces homepage
phpcms replaces homepageFeb 18, 2017 pm 04:01 PM
phpcms

To use phpcms to create a corporate website, you must first replace the static corporate homepage with a dynamic homepage that can be edited in the background.

First make a static corporate website homepage:

nbsp;html>

	
		<meta>
		<title></title>
	
	<style>
		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>
	
		 <p>
    	</p>
                   

新闻<a>更多</a> 

腐败发布啊

公告<a>更多</a>

大牛坊三年级

关于<a>更多</a>

打你叫你

招聘<a>更多</a>

的毛囊烦恼

 

Operation effect:

phpcms 替换首页

Import all the JS and CSS in the web page into JS and CSS files and put them into the corresponding locations under the statics folder.

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

phpcms 替换首页

1. Set the template to be used

Change the default template in phpcms to your own template.

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

phpcms 替换首页

Create a content folder under this folder

phpcms 替换首页

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

phpcms 替换首页

Log in to the phpcms backend, you can see the newly added template will be displayed in the interface - "Template style"

phpcms 替换首页

Settings -"Select the template style in site management, click OK.

phpcms 替换首页

Update the cache and generate the home page

phpcms 替换首页

phpcms 替换首页

At this time, click on the homepage of the site and you will see that the template has been changed successfully:

phpcms 替换首页

2. Split the template

Split the template into headers Header code, content code, and tail code

are newly created as header.html footer.html. The content part is still retained in index.html

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

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

3. Add a column

In header.html

First add a link to the navigation bar:

Place


 

 

Modified to:

{pc:content action="category" catid="0" num="5" siteid="$siteid" order="listorder ASC"}
        	
        {/pc}

 

num is the maximum number of columns

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

<p>
		 </p>
      {if $top_parentid==0}     
  • 首页
  •       {else}     
  • 首页
  •   {/if}   {pc:content action="category" catid="0" num="5" siteid="$siteid" order="listorder ASC"}          {if $catid==$r[catid] || $top_parentid==$r[catid]}              
  • {$r[catname]}
  •            {else}             
  • {$r[catname]}
  •            {/if}          {/pc}            
              

 

Display effect:

phpcms 替换首页

Only display the homepage

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.

Display:

phpcms 替换首页

4. Add content to the column

Achieved in the following four p's Dynamic content

phpcms 替换首页

#Modify the code of index.html

首先给更多添加内部链接:

代码:

<a>更多</a>

 中间的数字代表phpcms后台中栏目代号

 

给p的内容设置动态:

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

{$val[title]}

{$val[description]}

{/loop}          {/pc}

 

其余三个都是同样的方法

phpcms 替换首页

尾部 footer.html也是与头部同样的方法遍历

更多phpcms 替换首页 相关文章请关注PHP中文网!

 

Statement
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
phpcms是什么框架phpcms是什么框架Apr 20, 2024 pm 10:51 PM

PHP CMS 是一种基于 PHP 的开源内容管理系统,用于管理网站内容,其特点包括易用性、强大功能、可扩展性、安全性高和免费开源。它可以节省时间、提升网站质量、增强协作并降低开发成本,广泛应用于新闻网站、博客、企业网站、电子商务网站和社区论坛等各种网站。

phpcms怎么跳转到详情页phpcms怎么跳转到详情页Jul 27, 2023 pm 05:23 PM

phpcms跳转到详情页方法:1、使用header函数来生成跳转链接;2、循环遍历内容列表;3、获取内容的标题和详情页链接;4、生成跳转链接即可。

微信登录集成指南:PHPCMS实战微信登录集成指南:PHPCMS实战Mar 29, 2024 am 09:18 AM

标题:微信登录集成指南:PHPCMS实战在今天的互联网时代,社交化登录已经成为网站必备的功能之一。微信作为国内最流行的社交平台之一,其登录功能也被越来越多的网站所采用。本文将介绍如何在PHPCMS网站中集成微信登录功能,并提供具体的代码示例。第一步:注册微信开放平台账号首先,我们需要在微信开放平台上注册一个开发者账号,申请相应的开发权限。登录[微信开放平台]

phpcms是什么意思phpcms是什么意思Apr 20, 2024 pm 10:39 PM

PHPCMS 是一款免费开源的内容管理系统 (CMS),特点包括:开放源码、模块化、灵活、用户友好和社区支持。它可用于创建各种类型的网站,包括企业网站、电子商务网站、博客和社区论坛。技术要求包括:PHP 5.6 或更高版本、MySQL、MariaDB 或 PostgreSQL 数据库以及 Apache 或 Nginx Web 服务器。

phpcms不是免费吗phpcms不是免费吗Mar 01, 2023 am 10:24 AM

phpcms不是完全免费的。phpcms属于开源cms系统,但是开源并不等于免费,它有两个版本:免费版和商业版,免费版仅限于个人非商业用途,而商业版需要购买授权;个人可以作为研究使用,如果商业应用,需要支付一定费用。

phpcms用什么数据库phpcms用什么数据库Feb 21, 2023 pm 06:57 PM

phpcms用mysql数据库。phpcms是一个PHP开源网站管理系统,采用PHP+MYSQL做为技术基础进行开发。PHPCMS V9采用OOP方式进行基础运行框架搭建,支持的PHP版本是PHP5及以上、支持的MYSQL版本是MySql 4.1以上版本。

2023年最新phpcms视频教程推荐(二次开发必学)2023年最新phpcms视频教程推荐(二次开发必学)Oct 25, 2019 pm 03:45 PM

很多站长使用PHPCMS进行二次开发建站,PHP中文网特意推出了phpcms视频教程,大家可以随时随地免费观看视频教程,不需要从百度网盘下载,非常方便。

phpcms怎么修改站点名称phpcms怎么修改站点名称Feb 24, 2023 am 09:29 AM

phpcms修改站点名称的方法:1、使用管理员登录后台页面;2、在顶部的菜单栏找到“设置”选项单击,然后在左侧的菜单出找到“站点管理”;3、找到需要修改的站点,点击该站点域名右面的修改链接;4、在弹出的窗口中修改站点名称即可。

See all articles

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)
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft