Start networking and exchanging professional insights

Register now or log in to join your professional community.

Follow

What is the ideal way to use HTML ready-made design templates with PHP?

user-image
Question added by Adel Ezat Fawzy Ellozy , Webdeveloper. , Saudi Arabian Maritiem Sports Federation
Date Posted: 2016/12/15
Md. Shaheb Ali
by Md. Shaheb Ali , Web Application Developer , AdPeople World Wide, YR Wunderman, Enfatico and Microsoft

off course! you have to edit first, before you work with php as per your necessary, because  ready made template has lot of features, which you may no need. but PHP has no bindings with template either ready made or made by your self. Best and Ideal way is, you first delete unnecessary part or file of the template and make it simple, just make sure no repeated siblings of any part of html in template to work with PHP . See below example-

in ready made template you may see ul li like this...

<ul>

<li><a href="#">....</a></li>

<li><a href="#">....</a></li>

<li><a href="#">....</a></li>

<li><a href="#">....</a></li>

<li><a href="#">....</a></li>

<li><a href="#">....</a></li>

<li><a href="#">....</a></li>

</ul>

Then you just remove all siblings of <li/> like below-

<ul>

<li><a href="#">....</a></li>

</ul>

and do it for all html code.

 

and then write your php code like below, you may make it better, I just shown an example.

<ul>

<?php for($i=0; $i<count($data); $i++): ?>

<li><a href="#" title="<?php echo $data[$i]; ?>"><?php echo $data[$i]; ?></a></li>

<?php endfor;?>

</ul>

Thanks, hope you understand, if not please knock me.

 

Parvez Ahmed
by Parvez Ahmed , Frontend Developer (Angular) , GREEN DELTA INSURANCE COMPANY LIMITED

You  can edit the html template according your requirment on php.html markup help you to work but php need for security.

 

Bilal Zahid
by Bilal Zahid , Internee , MCB House

You have to edit the html template according to php

Arunkumar S
by Arunkumar S , Software developer , GrailsBrains

The ideal way to use is by editing it.

Muhammed Shihabudeen Labba
by Muhammed Shihabudeen Labba , Tech Lead , Spire Software

We need to add php scripts wherever required. 

Suppose a home page html named 'home.html'. Copy that to our local server and renamed it as 'home.php'

There will be a lot of contents/datas hardcoded in the html file. Fetch those contents from database and echo it using php. 

If there is a list of contents, we just need to use 'for' loop and we can minimize the length of the file.

Use <?php ?> tag before writing php code.

In the html file there will be lot of css files and js files. While converting that to php, we have another option to keep those css and js files in a single file and include that file using a single line in our php file.For example, write all our css and js files in 'header.php' and in home.php, just use include('header.php'); at the beginning.

Edit the template according to the php

Pushpendra Khadka
by Pushpendra Khadka , PHP Programmer, Search Engine Optimizer & Online Markiting officer , Xenatech Nepal Pvt Ltd

Hello Adel Ezat Fawzy Ellozy ;

You have not mentioned the framework. If you want to use in simple php/html hard coding you can edit as per your need.

You can google various html templates which will reduce your design and css time. If you want to use templates to frames works like word press, CI, laravel etc. There also you can change the design and coding as per your need. 

Ideal way to use ready made template is first understand the template and design then Edit template according to their own requirements step by step and also check the action after one changes.

alaa liswe
by alaa liswe , ِAdministrative Assistant , Arab Open University

You  can edit the html template according your requirment on php.html markup .

 

php is among the game changers of contenemporaryweb designing, so much so that designers are careful about selecting template.

Ehab  Shaker
by Ehab Shaker , Dot Net Developer , Info Strategic

PHP often have a separate HTML output.

So you can search for the appropriate section within the HTML template to put your PHP code output.

and you can customize some elements within the template such as colors,fonts,size  and delete unnecessary parts.

More Questions Like This

Do you need help in adding the right keywords to your CV? Let our CV writing experts help you.