RE: How can I?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Well it's not "just" stylesheet changes.  We have links that are different
for the different folders.  For example we have a left navigation bar,
those links displayed there will change based on the directory, as well as a
couple H1 tags that display some basic info that differs directory
to directory.   It's awhole lot easier to have all this in one file and then
switch the output based on the directory location, then it is to have
seperate files for each, not to mention in an dynamic page where everything
on that page is changeable, how do you add the proper link to
that stylesheet or function page? .. Sure you could fopen the page after
it's been created and then fwrite the link in, but you'd still need a
switch to know what link to fwrite in and opening sockets like that is just
an invite to trouble.

Atleast thats my opinion on the matter.  Remember they can create pages on
the fly, and these people who create the pages are how do we
say, HTML challenged?  I think thats the politically correct term.

Thanks,

Tony D.

-----Original Message-----
From: Gryffyn, Trevor [mailto:TGryffyn@xxxxxxxxxxxxxxxxx]
Sent: Monday, November 22, 2004 11:48 AM
To: Php-Windows
Cc: tdevlin@xxxxxxxxxxxxx
Subject: RE:  How can I?


I think you're over-thinking this one or maybe doing it the hard way.

If everything in a particular folder is always going to have the same
theme, then just put the stylesheet in that folder and references it in
the HTML you output.

"localstyle.css"

Something like that.

If you want to be able to have 'themes', then dynically alter the
filename vial PHP:


"$themename-localstyle.css"


You could do the same thing with getting the directory name and using
that like you'd use a $themename.

Anyway, that's what I'd do instead of worrying about switch statements
and all.

Would that work for what you're trying to do?

-TG

> -----Original Message-----
> From: Tony Devlin [mailto:tdevlin@xxxxxxxxxxxxx]
> Sent: Monday, November 22, 2004 11:20 AM
> To: Php-Windows
> Subject: RE:  How can I?
>
>
> The reasoning for this is so that I can apply different
> stylesheets and
> formatting to different pages inside a specific site.  The
> entire site is
> dynamic and changeable, they can add pages/subtract pages,
> etc.. so the
> layout information needs to be controlled on the header page, the only
> static/untouchable page.
>
> Let's say everything in compayn folder is blue text, but I
> want everything
> in the customer folder to be green text.  How do you control
> that when you
> have dynamic pages? .. easy you find a way to establish what
> your path is,
> check it against known paths, if it exists use a certain
> stylesheet.  There
> may be an easier way to do this than switches, but I have yet
> to find one.
>
> Tony
>
>
> -----Original Message-----
> From: Gryffyn, Trevor [mailto:TGryffyn@xxxxxxxxxxxxxxxxx]
> Sent: Monday, November 22, 2004 11:11 AM
> To: Php-Windows
> Cc: tdevlin@xxxxxxxxxxxxx
> Subject: RE:  How can I?
>
>
> I'm not quite sure what you're asking for here, but let me
> take a shot:
>
> Do you want the scripts in, say, your index.php's to know what folder
> they're in and act accordingly?
>
> So you'd essentially have exactly the same index.php in every folder,
> but they would do different things depending on if they were in
> /company/ or in /customer/ or in /tips/?
>
> If so, you could get the SCRIPT_NAME from the server
> variables, then use
> the dirname() function and some parsing to get the last directory name
> in the path.  But that seems to lead to the "too many SWITCH
> statements"
> thing that you're trying to avoid.
>
> Maybe if you could clarify what you're trying to do, it might help us
> determine the best course of action.
>
> -TG
>
> > -----Original Message-----
> > From: Tony Devlin [mailto:tdevlin@xxxxxxxxxxxxx]
> > Sent: Monday, November 22, 2004 9:20 AM
> >
> > Onto the real question.  I'm trying to make a switch
> > statement that switches a header file based upon
> > what folder you are in...
> >
> > An example:
> >
> > Let's say I have 3 folders with some files inside.
> >
> > /company/
> >  --> index.php
> >  --> contact.php
> >
> > /customer/
> >  --> index.php
> >  --> profile.php
> >
> > /tips/
> >  --> index.php
> >
> >
> > Basically instead of building a huge switch with EVERY full
> > path file name included,  I want to just make a switch based
> > on folder, then every file inside that folder will have
> > the switch applied to it.  I am sure this is
> > possible, anyone have any ideas about how to do this?
> >
> > Greatly appreciated,
> >
> > Tony Devlin
> >
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux