17488 Posts in 4473 Topics by 1978 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1020 Views |
-
Fixed : Customising content

17 September 2008 at 7:01pm Last edited: 24 September 2008 3:55am
Hi,
I have a little problem with the recipe "customising-content-in-your-templates" .I need to put an image inline with the content at the end of the paragraph like a punctuation mark. So i tried the recipe and though it seems so simple it doesn't show anything on the published site. Flushed the page many times but no way.
I put this code into my PageType_Controller
function Content() {
return $this->Content.'<a class="info_btn" href="$Link"><img src="$ThemeDir/images/info_btn.png"/></a>';
}even if I test with something like : return str_replace('have ','TEST',$this->Content) ;
i doesn't work.Can someone help me on this?
Thx, -
Re: Fixed : Customising content

17 September 2008 at 7:42pm
I don't see why this isn't working...
I'm doing the exact same thing in multiple sites....
Are you sure you are putting your content in the default "content" field ?
Is very other page in your site extending Page_Controller ?
-
Re: Fixed : Customising content

18 September 2008 at 9:55pm
Why is it in the controller? Try it in the PageType class.
-
Re: Fixed : Customising content

24 September 2008 at 3:55am
Thx guys,
Finally the code's working fine and the bug was from another part of the code.But the code didn't help me to do what i wanted to do : adding a punctuation mark at the of the text. $this->Content is wrapped into a <p> tag and the mark happened after the </p> ending.
I managed to get the Dataobject and handle string with php methods to add my mark before the </p>
@Hamish : it seems that it doesn't matter whether the function is in PageType class or the controller one.
| 1020 Views | ||
|
Page:
1
|
Go to Top |



