Home >Backend Development >PHP Tutorial >DreamWeaver imitation station study notes (1)

DreamWeaver imitation station study notes (1)

WBOY
WBOYOriginal
2016-07-29 09:01:591480browse

【PHP】Dreamweaver imitation site study notes (1)

The imitation site is to imitate the target website. The imitation website mainly imitates the page style and function.
What we usually call imitating a website is using CMS (Content Management System) as the backend of the website, and what is imitated is the static template of the target website. DEDECMS has relatively simple tags and is the first choice for imitating PHP websites.


Preparation

1. Target site (make sure you want to imitate the site)

DreamWeaver imitation station study notes (1)

2. Software

  • Wampserver Building and configuration completed
  • Dreamvear Installation and configuration completed
  • Dreamvear Software Installation Configuration completed
  • CSS image downloader
  • Lao Li imitation site dedicated tool
    DreamWeaver imitation station study notes (1)

Steps

1. Create dede template

  1. Start Wampserver, open the www directory
    DreamWeaver imitation station study notes (1)
  2. Find the dede installation directory and open it templets folder, create dede template (take try as an example here)
    DreamWeaver imitation station study notes (1)
  3. Create folders (images, style) and htm files (index, list_article, article_article) under try respectively
    Note: 1. dede templates are all based on
    2.dede exists in the form of htm mainly index (home page), list_article (list page), article_article (content page)
    3. There are css, js, etc. under style
    DreamWeaver imitation station study notes (1)

2. Analyze the website, Make dede template

1. First save the source file
(1) Right-click on the blank space of the web page to view the page source code, ctrl+A, ctrl+C, use DW to open index.htm, ctrl+V to save the source code Copy and paste it in, and click the blue font on the source code page to open the css and js saved in the previous style folder.
DreamWeaver imitation station study notes (1)
(2) Open the downloaded css image downloader, enter ① the path to the images established in step 1, ② the web page URL to be downloaded, ③ download, use the css image downloader to download the image directly to the specified location , saving a lot of tedious steps
DreamWeaver imitation station study notes (1)
2. Secondly, analyze the website. Take the following website as an example. There are three items in the home page navigation bar, which can be clicked to different web pages.
DreamWeaver imitation station study notes (1)
DreamWeaver imitation station study notes (1)
DreamWeaver imitation station study notes (1)
corresponding to dede, we can build three columns to implement , remember to create the column or click Generate after each update. The same goes for the homepage, otherwise there will be problems with the webpage (note: usually the contact page, optional cover template)
DreamWeaver imitation station study notes (1)
3. Convert the code
(1) Since we are Make the dede template, so we need to replace part of the code, open the Lao Li imitation site dedicated tool, and use the generated dede code to replace the following code
DreamWeaver imitation station study notes (1)
(2) Through code analysis, use a for loop to complete the navigation bar code replacement
DreamWeaver imitation station study notes (1)
Before replacement
DreamWeaver imitation station study notes (1)
After replacement
4. Update and debugging
The replaced website, homepage, and columns will be updated separately, open the browsing check, and debug until there are no problems
DreamWeaver imitation station study notes (1)

The above introduces the Dreamweaver imitation station study notes (1), including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.

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
Previous article:stickUp a jQuery pluginNext article:stickUp a jQuery plugin