Search

I have made two pages now and I wonder if I can DRY them.

Here the xslt :

No one who can help me and help me discover how to do this a better way ?

@Roelof: I think there are many people who know how to do this, but as said before, this knowledge is not specific to Symphony CMS but to XSLT.

Please do read this excellent article by Allen Chang about importing templates and overriding them. If this doesn't help, try your luck with Google

Thanks, I will study this and I think it can solve the problem.

What's DRY mean?

Don't Repeat Yourself

Don't Repeat Yourself

I feel like I should've known that!

I had to Google it the other day, another term for work I do as standard ;o)

Personally I think DRY is overrated. There is nothing wrong with a little duplication, as long as you keep an eye on the bigger picture. Although XSLT (like many other templating languages) is perfect for preventing repetition, it does tend to get a bit complex if you have many exceptions. If that is the case, sometimes it is better to duplicate code instead of making it abstract and unintuitive.

I agree with Remie. Don't get too hung up on DRY.

XSLT, being a declarative, rule-based language inherently nudges people towards reusable templates.

When creating a template, if reusability emerges (based on the nature of the language), then those are generally the good reusable code. If you go too far out of your way to make it abstract, then more than likely it'll be something you won't ever touch again.

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details