Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Data Model Questions /

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

[Solved] Question about automatic & created


Go to End


3 Posts   957 Views

Avatar
Graphicator

Community Member, 62 Posts

22 September 2011 at 10:45pm

	public function Title(){
		$replace = $this->Title;
		$replace = str_replace(' ',' ',$replace);
		
		return $replace;
	}

I am trying to display titles without being split.

What I get however, is the actual   showing up and not turned to html.

Avatar
Graphicator

Community Member, 62 Posts

23 September 2011 at 1:34am

$Title.RAW

Achieves the issue I was having

Avatar
Graphicator

Community Member, 62 Posts

23 September 2011 at 4:16pm

Edited: 23/09/2011 4:20pm

I'm taking down the [Solved] on the title, because this function produces quite a mess everywhere. In the backend, I still see "ampnbs" everywhere because I cannot program in {Title.RAW} everywhere the DataObject column shows up.

However....

I just switch the function to

public function Title2RAW(){...

and in the calling page

$Title2RAW.RAW

Cheers!