473,654 Members | 3,115 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Tough designing and PHPing at the same time

1. I'm designing a PHP-based page that has a lot of design stuff in it. It's
very tough to mix the HTML and PHP and have it be readable. The site isn't
overall so complicated, there's just a lot of graphics. Is there some
commercial way to design the page in a design program, then to use the
designed page as a skeleton, or "template" or "fill in" page as a pre-cursor
for a real HTML page? For instance, I could replace the designed graphic
with a different graphic at runtime, or could switch off the href hyperlinks
to a different place. This would be really cool, and I wouldn't be so
hampered in my code.

2. What PHP editors exist out there which will do "intellisen se" parameter
fill-ins? I'm aware of DreamWeaver, but it's got it's minuses. Any other
apps I should try out?

thanks
Jul 17 '05 #1
3 1623
eric rudolph wrote:
1. I'm designing a PHP-based page that has a lot of design stuff in
it. It's very tough to mix the HTML and PHP and have it be readable.
The site isn't overall so complicated, there's just a lot of
graphics. Is there some commercial way to design the page in a design
program, then to use the designed page as a skeleton, or "template"
or "fill in" page as a pre-cursor for a real HTML page? For instance,
I could replace the designed graphic with a different graphic at
runtime, or could switch off the href hyperlinks to a different
place. This would be really cool, and I wouldn't be so hampered in my
code.
2. What PHP editors exist out there which will do "intellisen se"
parameter fill-ins? I'm aware of DreamWeaver, but it's got it's
minuses. Any other apps I should try out?

thanks

This is how I do it:

1. design a page in Photoshop or something like that

2. spend some time deciding how to transform images into HMTL, what is going
to be text, what images will stay as images, etc.... This is the CRUCIAL
step.

3. Create template in HTML, and validate it using xhtml or html strict (the
stricter the better).

4. take out common elements from HTML and put them into a separate file as
functions. I call this file _snippets.php and it may include functions like

function ender ($note) {
$v = '</div></div>.<p id="finalnote" >
'.$note.'
</p>';
return $v;
}

I usually have three functions in the _snippets.php file
a. starter with all the header info
b. ender with all the standard html at the bottom of the page
c. menuer, which contains a menu. I usually use the replace function to
highlight the current item in the menu by passing the file name to the
menuer function.

5. create individual php pages that look like this:
<?php
include_once("_ snippets.php");
//connect to database, etc...
//lots of php
//---------------------------------
echo starter($title, $subtitle, $icon, $color);
echo menuer($filenam e, $submenu);
?>
<!-- Content for the individual page here -->

<?php
echo ender($note);
?>
In that way I can
a. change the whole site at once in the _snippets.php file.
b. easily edit the content of the individual php pages without having any
structural elements in the way
c. All javascript is in one or more javascript files
d. All styles are in a stylesheet.

Personally, I find this a really powerful way to create a website and even
though I only use Notepad2 (similar to Notepad, but with a few powerful
functions and colour coding). I dont loose track of things, because I
minimize the amount of coding to the bare minimum and I know exactly where
is what because I created it and not some program that often adds lots
extras.

- Nicolaas
Jul 17 '05 #2
"eric rudolph" <ne**@digitalme diaman.com> wrote in message
news:Bc******** ************@co mcast.com...
1. I'm designing a PHP-based page that has a lot of design stuff in it. It's very tough to mix the HTML and PHP and have it be readable. The site isn't
overall so complicated, there's just a lot of graphics. Is there some
commercial way to design the page in a design program, then to use the
designed page as a skeleton, or "template" or "fill in" page as a pre-cursor for a real HTML page? For instance, I could replace the designed graphic
with a different graphic at runtime, or could switch off the href hyperlinks to a different place. This would be really cool, and I wouldn't be so
hampered in my code.


you could try some of the many php templating solutions like Smarty for
instance.

<plug>
Or even better you could try my TemplateTamer, that combines template
engine with IDE to work effectively with php and templates, and gives you
for each page 2 separate files, html template, and php file that contains
presentation logic in clean php..
</plug>

rush
--
http://www.templatetamer.com/
http://www.folderscavenger.com/
Jul 17 '05 #3
Nel
"eric rudolph" <ne**@digitalme diaman.com> wrote in message
news:Bc******** ************@co mcast.com...
1. I'm designing a PHP-based page that has a lot of design stuff in it.
It's very tough to mix the HTML and PHP and have it be readable. The site
isn't overall so complicated, there's just a lot of graphics. Is there
some commercial way to design the page in a design program, then to use
the designed page as a skeleton, or "template" or "fill in" page as a
pre-cursor for a real HTML page? For instance, I could replace the
designed graphic with a different graphic at runtime, or could switch off
the href hyperlinks to a different place. This would be really cool, and I
wouldn't be so hampered in my code.

2. What PHP editors exist out there which will do "intellisen se" parameter
fill-ins? I'm aware of DreamWeaver, but it's got it's minuses. Any other
apps I should try out?

thanks

Create your own template system - easy to do and you have complete control
over it.

1. Create a stylish looking page in the designer of your choice. Replace
key parts of the page with template tags (i.e. {pagetext} or {mainmenu}). -
Save as template.htm
2. Define your tags (i.e. Get $pagetext from a database, include a file that
defines $mainmenu)
3. Read the template.htm into a string called $output and replace all the
template tags with the string values you have defined. (I have show a simple
script to do this below)
4. Output the final version (echo $output;)

That's it!

Nel

Replace script...

$pat = array("/{{pagetext}}/s",
"/{pagetitle}/s",
"/{mainmenu}/s",
"/{submenu}/s"
);
$rep = array("$pagetex t",
"$pagetitle ",
"$mainmenu" ,
$submenu
);
// replace all occurences of search patterns with according replacements
$output = preg_replace($p at, $rep, $output);
Jul 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
1971
by: Abyss | last post by:
My view. anyone that doesn't like it tough, click off and stop reading it. I have spent the last 45 minutes reading through all the posts, and I believe that you have all missed the mark of that post. The post was not about strict or transitional pages, it wasn't even about
12
1885
by: James Brown | last post by:
Hi all, Having problems designing a template-class. I'll describe my scenario first then show what I've come up with so far: Need a class to provide pointer/array-like access to an area of physical memory located on a piece of custom hardware - this memory is only accessible using machine specific i/o so I want to hide all this in a class. I'm imagining
198
11490
by: Sy Borg | last post by:
Hello: We are designing two multi-user client server applications that performs large number of transactions on database servers. On an average Application A has a 50% mix of select and update/insert/delete statements and application B has 80-20 mix of select and update/insert/delete statements. Being able to scale the databases as needed so the performance is unaffected, is one of our critical requirements. We've been investigating...
6
1525
by: Kennedy_f | last post by:
I did better in terms of score on this one than 291, but I found it much harder. Wordings of questions are difficult like the rest, but the DNS and CA scenarios were very tough to figure out. Take your time on the questions. I used uecrtify exam simulation. Make sure you know exactly what they are asking for and think it through. You will not pass unless you have experience with the product and have done a lot of prep work. Read the...
6
2940
by: Gary James | last post by:
This may not be a direct C# question, but since I'll be using using C# for development, I thought I'd pose the question here. I'll soon be involved in the design of a new software product that will employ a software "Plug-In" architecture. Taking the plug-in route will give us a design that can adapt to, as yet, undefined future requirements (within the scope of the plug-in interface spec of course). In the past I've done this with...
2
1405
by: Sky Sigal | last post by:
Hello: I'm currently messing around, and need as much feedback/help as I can get, trying to find the most economical/graceful way to build usercontrols that rely on styling to look any good... It's the last part that has got me all frazzled (the 'rely on...to look good')... Let me explain -- and please bear with me as it's a bit longer than my usual questions:
1
1280
by: slonocode | last post by:
I'm wondering if there are certain processes that I could follow to learn to design better classes? Where could I find these processes? Is designing classes more of an art that comes from experience or can it at least be somewhat done by a process? I have the most trouble with abstracting the specifics, such that a class could be reused or just be generic such that anyone could use them.
9
17817
by: denis | last post by:
Hi there, I got a tough interview questions lately, and I would like to hear your opinion: An array of N chars is given Write an efficient algorithm to find all the repeating substring with a minimal size
1
1325
by: Cowboy \(Gregory A. Beamer\) | last post by:
If you have a tough time getting your head around Lambda Expressions, see if this blog entry helps: http://tinyurl.com/4yeckd I would gladly welcome comments, critiques and questions, as I am hoping this entry really helps those who are struggling with this topic. -- Gregory A. Beamer MVP, MCP: +I, SE, SD, DBA
0
8290
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8815
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8708
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8489
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8594
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6161
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5622
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4149
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4294
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.