Jump to:

5519 Posts in 1734 Topics by 1223 members

Customising the CMS

SilverStripe Forums » Customising the CMS » Metadata URL field

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 457 Views
  • lucasoftnet
    Avatar
    Community Member
    2 Posts

    Metadata URL field Link to this post

    Hi,

    I need to maintain some URL of an old web site version. Those urls are like:

    http://www.pincopalla.it/articoli-bar/barmats_floormats/service_barmat/333

    however in Metadata-> URL filed of CMS if I try to add the char "_" it is replaced by "-"
    How can disable this behaviour?

    I'm using Silverstripe on Windows with IIS 6 and IIRF as url rewriting module...

    Can someone help me?
    Thanks

  • mishell
    Avatar
    Community Member
    19 Posts

    Re: Metadata URL field Link to this post

    The behavior is made on SiteTree::onBeforeWrite on line 1355, by ereg_replace. Maybe if You write on Your Page.php

       protected function onBeforeWrite() {
          parent::onBeforeWrite();
    if($this->isChanged('URLSegment')) {
    //Your replace here
    }
    }

    Hope it helps

  • lucasoftnet
    Avatar
    Community Member
    2 Posts

    Re: Metadata URL field Link to this post

    this is perfect!
    Many Thaks!!!

    457 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.