Home > Archive > PHP Smarty Templates > May 2004 > Re: [SMARTY] limiting xhtml css tags output
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Re: [SMARTY] limiting xhtml css tags output
|
|
| Vonleigh Simmons 2004-05-30, 12:41 am |
| > assuming there needs to be some tag soup for every design on top of
> the functional structure of the page why not just create 1 extra
> template
> for each design which stores the tag soup and include the relevant
> file.
That was my first proposal. The problem with this approach is that I
end up with a template for every single gallery page. Assuming hundreds
will be built, I would end up with hundreds of templates.
Now say I add a new feature where I can put the person's name on the
top of the page with a nice picture. Since now I have hundreds of
additional templates, I would have to go in and add that information
into each one (instead of one central template).
--
Re-reading your post, I think you mean to include only the display
part in additional templates. But I don't think that's possible because
the tags would be intermingled into the design. For example someone
might have custom id's for paragraphs, or other functional tags.
> has been removed so that Internet Exploder doesn't put great big gaps
> between the images.).
> It looks like a nightmare but runs fine:
That's the kind of mess I want to avoid if possible. It is a solution,
but I think it's not terribly elegant (I can't imagine myself going
into something like that to add or edit, 3 years in the future, and
still know what's going on : )).
As a sidenote, I have a whitespace filter installed in smarty that I
got off the wiki page. You might want to try that (or edit it a bit if
it doesn't filter as much as you'd like), so that your template can
look all spaced and easily readable while still getting the whitespace
filtered out:
" There's already a better method implemented by Monte Ohrt himself.
Instead of simply replacing all \n, \r, \t and spaces the following
function only replaces the ones not enclosed by <script>, <textarea> or
<pre> tags. Because replacing them would result in losing your text
formatting."
<http://smarty.incutio.com/?page=SmartyTips>
Vonleigh Simmons [vanlei]
<www.illusionart.com/pi/>
| |
| Vonleigh Simmons 2004-05-30, 12:41 am |
| BTW, thank you both Joachem and Sarah for taking the time to think of
this and responding.
> What about having all your css tags and ids be named exactly the same
> but output
> differently depending on which stylesheet you include?
There would be lots of different tags, some named the same, some named
depending on the page they're located on, etc. For example:
Let's say you have a gallery page, a person might have more than one
gallery. So I have to include css tags specific to galleries in general
(which would be the same for everyone, e.g. galleryimages,
gallerytitle, etc.). However, someone might like to have a different
look to each one of their gallery pages, so now I have to include a tag
that's specific to their page, e.g. id=$pagename . "title". This would
accomodate a design like this one, where he has a different left image
depending on which gallery you're in:
<http://www.joshsong.com/>
Then there would be overlap, for example you can have the images of a
gallery floating, so as many images as can fit, do fit. However,
someone might want to make it in groups of four, so I'd have a tag
"groupFourImages". This would accomodate a design like this one:
<http://arthost.org/images/sketches/waterpaper-2.jpg>
> and depending which stylesheet you include, cellClass has a totally
> different
> defininition.
Yes, that's exactly the idea. So it has a completely different design
depending on what css is included. Read my original post, or better
yet, take a look at:
<http://www.csszengarden.com/>
It's the same XHTML page, with the same tags, however every CSS page
interprets the tags differently and builds a completely different page.
However, in order to achieve that, if you look at the code, there's
tons and tons of extra tags to accomodate every possible design. For
example: border1, border2, etc. As someone might want a decorative
border, someone might want two; but if you don't want one you have all
these extra tags.
Vonleigh Simmons [vanlei]
<www.illusionart.com/pi/>
| |
| Jochem Maas 2004-05-30, 12:41 am |
| either your awake at this ungodly hour, there is delay in the mail today
or you live somewhere where people go to bed at a decent hour ;-)
at any rate you might as well post any reply you make to my last email
- I just noticed that none of my posts went to the list.
Vonleigh Simmons wrote:
>
> --
> Re-reading your post, I think you mean to include only the display
> part in additional templates. But I don't think that's possible because
> the tags would be intermingled into the design. For example someone
> might have custom id's for paragraphs, or other functional tags.
>
| |
| Jochem Maas 2004-05-30, 12:41 am |
| Vonleigh Simmons wrote:
> BTW, thank you both Joachem and Sarah for taking the time to think of
> this and responding.
cheers.
>
>
>
> There would be lots of different tags, some named the same, some
> named depending on the page they're located on, etc. For example:
>
> Let's say you have a gallery page, a person might have more than one
> gallery. So I have to include css tags specific to galleries in general
> (which would be the same for everyone, e.g. galleryimages, gallerytitle,
> etc.). However, someone might like to have a different look to each one
> of their gallery pages, so now I have to include a tag that's specific
> to their page, e.g. id=$pagename . "title". This would accomodate a
> design like this one, where he has a different left image depending on
> which gallery you're in:
in this case give each gallery (I assume its got data coming out of DB
or something) a stylesheet attribute and then include this (if set)
instead of the client/owners default 'gallery' stylesheet. you will have
to define a new style sheet for every different design but the tags
still don't need to change (you still may need a mechanism to add some
custom HTML depending on the stylesheet/design that is selected to
accomdate special visual crap.)
>
> <http://www.joshsong.com/>
>
> Then there would be overlap, for example you can have the images of
> a gallery floating, so as many images as can fit, do fit. However,
> someone might want to make it in groups of four, so I'd have a tag
> "groupFourImages". This would accomodate a design like this one:
the end of your mail states 'go look at csszengarden' (I have read it
backwards, many times.) and I would politely say 'right back at ya'
- don't change the tag classname or id - change the style definition (by
switching the included stylesheet is a good way ;-)
>
> <http://arthost.org/images/sketches/waterpaper-2.jpg>
>
>
>
>
> Yes, that's exactly the idea. So it has a completely different
> design depending on what css is included. Read my original post, or
> better yet, take a look at:
>
> <http://www.csszengarden.com/>
>
> It's the same XHTML page, with the same tags, however every CSS page
> interprets the tags differently and builds a completely different page.
> However, in order to achieve that, if you look at the code, there's tons
> and tons of extra tags to accomodate every possible design. For example:
> border1, border2, etc. As someone might want a decorative border,
> someone might want two; but if you don't want one you have all these
> extra tags.
>
I think, Vonleigh, you have contradicted yourself.
(its late/early for me - so I might be reading funny.)
>
> Vonleigh Simmons [vanlei]
> <www.illusionart.com/pi/>
>
|
|
|
|
|